mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-14 03:56:22 +08:00
feat(work): 新增创建或更新审批模板相关接口
This commit is contained in:
@@ -173,7 +173,7 @@
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class MultiLangText : CgibinOAGetTemplateDetailResponse.Types.MultiLangText
|
||||
public class MultiLangText : CgibinOAApplyEventRequest.Types.MultiLangText
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/oa/approval/create_template 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinOAApprovalCreateTemplateRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class MultiLangText : CgibinOAApplyEventRequest.Types.MultiLangText
|
||||
{
|
||||
}
|
||||
|
||||
public class TemplateContent
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Control
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Property
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置控件类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("control")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("control")]
|
||||
public string Control { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string ControlId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("title")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("title")]
|
||||
public IList<MultiLangText>? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件说明。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("placeholder")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("placeholder")]
|
||||
public IList<MultiLangText>? Placeholder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否为必填项。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("require")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("require")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))]
|
||||
public bool? IsRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否不可打印。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("un_print")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("un_print")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
|
||||
public bool IsUnprintable { get; set; }
|
||||
}
|
||||
|
||||
public class Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 Date 控件配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("date")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("date")]
|
||||
public DateControlConfig? Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 Selector 控件配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("selector")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("selector")]
|
||||
public SelectorControlConfig? Selector { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 Contact 控件配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact")]
|
||||
public ContactControlConfig? Contact { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 Table 控件配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("table")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("table")]
|
||||
public TableControlConfig? Table { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 Attendance 控件配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("attendance")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("attendance")]
|
||||
public AttendanceControlConfig? Attendance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 Vacation 控件配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("vacation_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("vacation_list")]
|
||||
public VacationControlConfig? Vacation { get; set; }
|
||||
}
|
||||
|
||||
public class DateControlConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置时间展示类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class SelectorControlConfig
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Option
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置选项 Key。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("key")]
|
||||
public string Key { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置选项值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("value")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("value")]
|
||||
public IList<MultiLangText> Value { get; set; } = new List<MultiLangText>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置选择类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置选择列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("options")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("options")]
|
||||
public IList<Types.Option> OptionList { get; set; } = new List<Types.Option>();
|
||||
}
|
||||
|
||||
public class ContactControlConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置选择方式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置选择对象。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mode")]
|
||||
public string Mode { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class TableControlConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置子控件。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("children")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("children")]
|
||||
public IList<Control> Children { get; set; } = new List<Control>();
|
||||
}
|
||||
|
||||
public class AttendanceControlConfig
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class DateRange
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置时间刻度。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置假勤类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置时间选择范围。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("date_range")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("date_range")]
|
||||
public Types.DateRange DateRange { get; set; } = new Types.DateRange();
|
||||
}
|
||||
|
||||
public class VacationControlConfig
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Vacation
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置假期类型标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public int VacationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置假期类型名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public IList<MultiLangText> Name { get; set; } = new List<MultiLangText>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置假期列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("item")]
|
||||
public IList<Types.Vacation> VacationList { get; set; } = new List<Types.Vacation>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模板控件属性。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("property")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("property")]
|
||||
public Types.Property Property { get; set; } = new Types.Property();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模板控件配置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config")]
|
||||
public Types.Config? Config { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模板控件列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("controls")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("controls")]
|
||||
public IList<Types.Control> ControlList { get; set; } = new List<Types.Control>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模板名称列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("template_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("template_name")]
|
||||
public IList<Types.MultiLangText> TemplateName { get; set; } = new List<Types.MultiLangText>();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模板内容信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("template_content")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("template_content")]
|
||||
public Types.TemplateContent TemplateContent { get; set; } = new Types.TemplateContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/oa/approval/create_template 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinOAApprovalCreateTemplateResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置模版 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("template_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("template_id")]
|
||||
public string TemplateId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/oa/approval/update_template 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinOAApprovalUpdateTemplateRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class MultiLangText : CgibinOAApprovalCreateTemplateRequest.Types.MultiLangText
|
||||
{
|
||||
}
|
||||
|
||||
public class TemplateContent : CgibinOAApprovalCreateTemplateRequest.Types.TemplateContent
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模版 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("template_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("template_id")]
|
||||
public string TemplateId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模板名称列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("template_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("template_name")]
|
||||
public IList<Types.MultiLangText> TemplateName { get; set; } = new List<Types.MultiLangText>();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置模板内容信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("template_content")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("template_content")]
|
||||
public Types.TemplateContent TemplateContent { get; set; } = new Types.TemplateContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/oa/approval/update_template 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinOAApprovalUpdateTemplateResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -72,13 +72,13 @@
|
||||
public bool IsRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否参与打印。
|
||||
/// 获取或设置是否不可打印。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("un_print")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("un_print")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))]
|
||||
public bool IsPrintable { get; set; }
|
||||
public bool IsUnprintable { get; set; }
|
||||
}
|
||||
|
||||
public class Config
|
||||
Reference in New Issue
Block a user