mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-16 16:50:43 +08:00
feat(work): 新增创建或更新审批模板相关接口
This commit is contained in:
parent
e0bb4d7ca0
commit
ab375b7cc1
@ -10,47 +10,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
public static class WechatWorkClientExecuteCgibinOAExtensions
|
||||
{
|
||||
#region Approval
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/oa/approval/copytemplate 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92630 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinOAApprovalCopyTemplateResponse> ExecuteCgibinOAApprovalCopyTemplateAsync(this WechatWorkClient client, Models.CgibinOAApprovalCopyTemplateRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "oa", "approval", "copytemplate")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinOAApprovalCopyTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/oa/gettemplatedetail 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91982 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92631 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinOAGetTemplateDetailResponse> ExecuteCgibinOAGetTemplateDetailAsync(this WechatWorkClient client, Models.CgibinOAGetTemplateDetailRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "oa", "gettemplatedetail")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinOAGetTemplateDetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/oa/applyevent 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91853 </para>
|
||||
@ -113,6 +72,87 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinOAGetApprovalDetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/oa/approval/copytemplate 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92630 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinOAApprovalCopyTemplateResponse> ExecuteCgibinOAApprovalCopyTemplateAsync(this WechatWorkClient client, Models.CgibinOAApprovalCopyTemplateRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "oa", "approval", "copytemplate")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinOAApprovalCopyTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/oa/gettemplatedetail 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91982 </para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92631 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinOAGetTemplateDetailResponse> ExecuteCgibinOAGetTemplateDetailAsync(this WechatWorkClient client, Models.CgibinOAGetTemplateDetailRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "oa", "gettemplatedetail")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinOAGetTemplateDetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/oa/approval/create_template 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97437 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinOAApprovalCreateTemplateResponse> ExecuteCgibinOAApprovalCreateTemplateAsync(this WechatWorkClient client, Models.CgibinOAApprovalCreateTemplateRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "oa", "approval", "create_template")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinOAApprovalCreateTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/oa/approval/update_template 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97438 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinOAApprovalUpdateTemplateResponse> ExecuteCgibinOAApprovalUpdateTemplateAsync(this WechatWorkClient client, Models.CgibinOAApprovalUpdateTemplateRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "oa", "approval", "update_template")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinOAApprovalUpdateTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Vacation
|
||||
|
@ -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
|
@ -0,0 +1,33 @@
|
||||
{
|
||||
"template_name": [
|
||||
{
|
||||
"text": "我的api测试模版",
|
||||
"lang": "zh_CN"
|
||||
}
|
||||
],
|
||||
"template_content": {
|
||||
"controls": [
|
||||
{
|
||||
"property": {
|
||||
"control": "Text",
|
||||
"id": "Text-01",
|
||||
"title": [
|
||||
{
|
||||
"text": "控件名称",
|
||||
"lang": "zh_CN"
|
||||
}
|
||||
],
|
||||
"placeholder": [
|
||||
{
|
||||
"text": "控件说明",
|
||||
"lang": "zh_CN"
|
||||
}
|
||||
],
|
||||
"require": 0,
|
||||
"un_print": 1
|
||||
},
|
||||
"config": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"template_id": "C4RbNKm731MCFVgk6XLq1Rs9W4aNXPJV2mmXT4qGy"
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
{
|
||||
"template_id": "C4RbNKm731MCFVgk6XLq1Rs9W4aNXPJV2mmXT4qGy",
|
||||
"template_name": [
|
||||
{
|
||||
"text": "我的api测试模版",
|
||||
"lang": "zh_CN"
|
||||
}
|
||||
],
|
||||
"template_content": {
|
||||
"controls": [
|
||||
{
|
||||
"property": {
|
||||
"control": "Text",
|
||||
"id": "Text-01",
|
||||
"title": [
|
||||
{
|
||||
"text": "控件名称",
|
||||
"lang": "zh_CN"
|
||||
}
|
||||
],
|
||||
"placeholder": [
|
||||
{
|
||||
"text": "控件说明",
|
||||
"lang": "zh_CN"
|
||||
}
|
||||
],
|
||||
"require": 0,
|
||||
"un_print": 1
|
||||
},
|
||||
"config": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user