feat(work): 随官方更新审批模板相关接口模型

This commit is contained in:
Fu Diwei 2025-06-20 10:44:47 +08:00
parent 969ea5f066
commit 480e7fa91c
5 changed files with 1166 additions and 129 deletions

View File

@ -191,6 +191,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("departments")]
public ContactControlValueAsDepartment[]? ContactDepartments { get; set; }
/// <summary>
/// 获取或设置 Tips 控件值。
/// </summary>
[Newtonsoft.Json.JsonProperty("tips")]
[System.Text.Json.Serialization.JsonPropertyName("tips")]
public TipsControlValue[]? Tips { get; set; }
/// <summary>
/// 获取或设置 File 控件值。
/// </summary>
@ -205,6 +212,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("children")]
public TableControlValue[]? TableChildren { get; set; }
/// <summary>
/// 获取或设置 Vacation 控件值。
/// </summary>
[Newtonsoft.Json.JsonProperty("vacation")]
[System.Text.Json.Serialization.JsonPropertyName("vacation")]
public VacationControlValue? Vacation { get; set; }
/// <summary>
/// 获取或设置 Attendance 控件值。
/// </summary>
@ -213,11 +227,18 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public AttendanceControlValue? Attendance { get; set; }
/// <summary>
/// 获取或设置 Vacation 控件值。
/// 获取或设置 PunchCorrection 控件值。
/// </summary>
[Newtonsoft.Json.JsonProperty("vacation")]
[System.Text.Json.Serialization.JsonPropertyName("vacation")]
public VacationControlValue? Vacation { get; set; }
[Newtonsoft.Json.JsonProperty("punch_correction")]
[System.Text.Json.Serialization.JsonPropertyName("punch_correction")]
public CheckinControlValue? Checkin { get; set; }
/// <summary>
/// 获取或设置 DateRange 控件值。
/// </summary>
[Newtonsoft.Json.JsonProperty("date_range")]
[System.Text.Json.Serialization.JsonPropertyName("date_range")]
public DateRangeControlValue? DateRange { get; set; }
/// <summary>
/// 获取或设置 Location 控件值。
@ -240,20 +261,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("formula")]
public FormulaControlValue? Formula { get; set; }
/// <summary>
/// 获取或设置 DateRange 控件值。
/// </summary>
[Newtonsoft.Json.JsonProperty("date_range")]
[System.Text.Json.Serialization.JsonPropertyName("date_range")]
public DateRangeControlValue? DateRange { get; set; }
/// <summary>
/// 获取或设置 PunchCorrection 控件值。
/// </summary>
[Newtonsoft.Json.JsonProperty("punch_correction")]
[System.Text.Json.Serialization.JsonPropertyName("punch_correction")]
public CheckinControlValue? Checkin { get; set; }
/// <summary>
/// 获取或设置 BankAccount 控件值。
/// </summary>
@ -379,6 +386,119 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string? Name { get; set; }
}
public class TipsControlValue
{
public static class Types
{
public class TipsContent
{
public static class Types
{
public class Text
{
public static class Types
{
public class SubText
{
public static class Types
{
public class Content
{
public static class Types
{
public class PlainText
{
/// <summary>
/// 获取或设置纯文本文字。
/// </summary>
[Newtonsoft.Json.JsonProperty("content")]
[System.Text.Json.Serialization.JsonPropertyName("content")]
public string Content { get; set; } = default!;
}
public class Link
{
/// <summary>
/// 获取或设置链接标题。
/// </summary>
[Newtonsoft.Json.JsonProperty("title")]
[System.Text.Json.Serialization.JsonPropertyName("title")]
public string Title { get; set; } = default!;
/// <summary>
/// 获取或设置链接 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("url")]
[System.Text.Json.Serialization.JsonPropertyName("url")]
public string URL { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置纯文本类型的内容信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("plain_text")]
[System.Text.Json.Serialization.JsonPropertyName("plain_text")]
public Types.PlainText? PlainText { get; set; }
/// <summary>
/// 获取或设置链接类型的内容信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("link")]
[System.Text.Json.Serialization.JsonPropertyName("link")]
public Types.Link? Link { get; set; }
}
}
/// <summary>
/// 获取或设置文本类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置文本内容。
/// </summary>
[Newtonsoft.Json.JsonProperty("content")]
[System.Text.Json.Serialization.JsonPropertyName("content")]
public Types.Content Content { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置说明文字分段列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_text")]
[System.Text.Json.Serialization.JsonPropertyName("sub_text")]
public Types.SubText[] SubTextList { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置语言类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("lang")]
[System.Text.Json.Serialization.JsonPropertyName("lang")]
public string Language { get; set; } = default!;
/// <summary>
/// 获取或设置说明文字信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("text")]
[System.Text.Json.Serialization.JsonPropertyName("text")]
public Types.Text Text { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置说明文字列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("tips_content")]
[System.Text.Json.Serialization.JsonPropertyName("tips_content")]
public Types.TipsContent[] TipsList { get; set; } = default!;
}
public class FileControlValue
{
/// <summary>
@ -406,6 +526,34 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public Types.TableDetail[] TableDetailList { get; set; } = default!;
}
public class VacationControlValue
{
public static class Types
{
public class Selector : SelectorControlValue
{
}
public class Attendance : AttendanceControlValue
{
}
}
/// <summary>
/// 获取或设置请假类型选择信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("selector")]
[System.Text.Json.Serialization.JsonPropertyName("selector")]
public Types.Selector Selector { get; set; } = default!;
/// <summary>
/// 获取或设置假勤内容填写信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("attendance")]
[System.Text.Json.Serialization.JsonPropertyName("attendance")]
public Types.Attendance Attendance { get; set; } = default!;
}
public class AttendanceControlValue
{
public static class Types
@ -481,32 +629,82 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public Types.Slice? Slice { get; set; }
}
public class VacationControlValue
public class CheckinControlValue
{
/// <summary>
/// 获取或设置异常状态说明。
/// </summary>
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string State { get; set; } = default!;
/// <summary>
/// 获取或设置版本标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("version")]
[System.Text.Json.Serialization.JsonPropertyName("version")]
public int? Version { get; set; }
/// <summary>
/// 获取或设置补卡时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("time")]
[System.Text.Json.Serialization.JsonPropertyName("time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))]
public long? Timestamp { get; set; }
/// <summary>
/// 获取或设置补卡日期时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("daymonthyear")]
[System.Text.Json.Serialization.JsonPropertyName("daymonthyear")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))]
public long? DateTimestamp { get; set; }
}
public class DateRangeControlValue
{
public static class Types
{
public class Selector : SelectorControlValue
{
}
public class Attendance : AttendanceControlValue
public class Timezone : DateControlValue.Types.Timezone
{
}
}
/// <summary>
/// 获取或设置请假类型选择信息。
/// 获取或设置时间展示类型
/// </summary>
[Newtonsoft.Json.JsonProperty("selector")]
[System.Text.Json.Serialization.JsonPropertyName("selector")]
public Types.Selector Selector { get; set; } = default!;
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string Type { get; set; } = default!;
/// <summary>
/// 获取或设置假勤内容填写信息。
/// 获取或设置开始时间戳
/// </summary>
[Newtonsoft.Json.JsonProperty("attendance")]
[System.Text.Json.Serialization.JsonPropertyName("attendance")]
public Types.Attendance Attendance { get; set; } = default!;
[Newtonsoft.Json.JsonProperty("new_begin")]
[System.Text.Json.Serialization.JsonPropertyName("new_begin")]
public long BeginTimestamp { get; set; }
/// <summary>
/// 获取或设置结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("new_end")]
[System.Text.Json.Serialization.JsonPropertyName("new_end")]
public long EndTimestamp { get; set; }
/// <summary>
/// 获取或设置时长范围(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("new_duration")]
[System.Text.Json.Serialization.JsonPropertyName("new_duration")]
public int Duration { get; set; }
/// <summary>
/// 获取或设置时区信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("timezone_info")]
[System.Text.Json.Serialization.JsonPropertyName("timezone_info")]
public Types.Timezone? Timezone { get; set; }
}
public class LocationControlValue
@ -596,84 +794,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string Value { get; set; } = default!;
}
public class DateRangeControlValue
{
public static class Types
{
public class Timezone : DateControlValue.Types.Timezone
{
}
}
/// <summary>
/// 获取或设置时间展示类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string Type { get; set; } = default!;
/// <summary>
/// 获取或设置开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("new_begin")]
[System.Text.Json.Serialization.JsonPropertyName("new_begin")]
public long BeginTimestamp { get; set; }
/// <summary>
/// 获取或设置结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("new_end")]
[System.Text.Json.Serialization.JsonPropertyName("new_end")]
public long EndTimestamp { get; set; }
/// <summary>
/// 获取或设置时长范围(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("new_duration")]
[System.Text.Json.Serialization.JsonPropertyName("new_duration")]
public int Duration { get; set; }
/// <summary>
/// 获取或设置时区信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("timezone_info")]
[System.Text.Json.Serialization.JsonPropertyName("timezone_info")]
public Types.Timezone? Timezone { get; set; }
}
public class CheckinControlValue
{
/// <summary>
/// 获取或设置异常状态说明。
/// </summary>
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string State { get; set; } = default!;
/// <summary>
/// 获取或设置版本标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("version")]
[System.Text.Json.Serialization.JsonPropertyName("version")]
public int? Version { get; set; }
/// <summary>
/// 获取或设置补卡时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("time")]
[System.Text.Json.Serialization.JsonPropertyName("time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))]
public long? Timestamp { get; set; }
/// <summary>
/// 获取或设置补卡日期时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("daymonthyear")]
[System.Text.Json.Serialization.JsonPropertyName("daymonthyear")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))]
public long? DateTimestamp { get; set; }
}
public class BankAccountControlValue
{
public static class Types
@ -802,6 +922,15 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public Types.Value Value { get; set; } = default!;
/// <summary>
/// 获取或设置是否为必填项。
/// </summary>
[Newtonsoft.Json.JsonProperty("require")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("require")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanConverter))]
public bool? IsRequired { get; set; }
}
}

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
@ -93,6 +93,20 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("contact")]
public ContactControlConfig? Contact { get; set; }
/// <summary>
/// 获取或设置 Tips 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("tips")]
[System.Text.Json.Serialization.JsonPropertyName("tips")]
public TipsControlConfig? Tips { get; set; }
/// <summary>
/// 获取或设置 File 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("file")]
[System.Text.Json.Serialization.JsonPropertyName("file")]
public FileControlConfig? File { get; set; }
/// <summary>
/// 获取或设置 Table 控件配置信息。
/// </summary>
@ -113,6 +127,27 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[Newtonsoft.Json.JsonProperty("vacation_list")]
[System.Text.Json.Serialization.JsonPropertyName("vacation_list")]
public VacationControlConfig? Vacation { get; set; }
/// <summary>
/// 获取或设置 DateRange 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("date_range")]
[System.Text.Json.Serialization.JsonPropertyName("date_range")]
public DateRangeControlConfig? DateRange { get; set; }
/// <summary>
/// 获取或设置 Location 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("location")]
[System.Text.Json.Serialization.JsonPropertyName("location")]
public LocationControlConfig? Location { get; set; }
/// <summary>
/// 获取或设置 RelatedApproval 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("related_approval")]
[System.Text.Json.Serialization.JsonPropertyName("related_approval")]
public RelatedApprovalControlConfig? RelatedApproval { get; set; }
}
public class DateControlConfig
@ -179,8 +214,140 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string Mode { get; set; } = string.Empty;
}
public class TipsControlConfig
{
public static class Types
{
public class TipsContent
{
public static class Types
{
public class Text
{
public static class Types
{
public class SubText
{
public static class Types
{
public class Content
{
public static class Types
{
public class PlainText
{
/// <summary>
/// 获取或设置纯文本文字。
/// </summary>
[Newtonsoft.Json.JsonProperty("content")]
[System.Text.Json.Serialization.JsonPropertyName("content")]
public string Content { get; set; } = string.Empty;
}
public class Link
{
/// <summary>
/// 获取或设置链接标题。
/// </summary>
[Newtonsoft.Json.JsonProperty("title")]
[System.Text.Json.Serialization.JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;
/// <summary>
/// 获取或设置链接 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("url")]
[System.Text.Json.Serialization.JsonPropertyName("url")]
public string URL { get; set; } = string.Empty;
}
}
/// <summary>
/// 获取或设置纯文本类型的内容信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("plain_text")]
[System.Text.Json.Serialization.JsonPropertyName("plain_text")]
public Types.PlainText? PlainText { get; set; }
/// <summary>
/// 获取或设置链接类型的内容信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("link")]
[System.Text.Json.Serialization.JsonPropertyName("link")]
public Types.Link? Link { get; set; }
}
}
/// <summary>
/// 获取或设置文本类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置文本内容。
/// </summary>
[Newtonsoft.Json.JsonProperty("content")]
[System.Text.Json.Serialization.JsonPropertyName("content")]
public Types.Content Content { get; set; } = new Types.Content();
}
}
/// <summary>
/// 获取或设置说明文字分段列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_text")]
[System.Text.Json.Serialization.JsonPropertyName("sub_text")]
public IList<Types.SubText> SubTextList { get; set; } = new List<Types.SubText>();
}
}
/// <summary>
/// 获取或设置语言类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("lang")]
[System.Text.Json.Serialization.JsonPropertyName("lang")]
public string Language { get; set; } = string.Empty;
/// <summary>
/// 获取或设置说明文字信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("text")]
[System.Text.Json.Serialization.JsonPropertyName("text")]
public Types.Text Text { get; set; } = new Types.Text();
}
}
/// <summary>
/// 获取或设置说明文字列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("tips_content")]
[System.Text.Json.Serialization.JsonPropertyName("tips_content")]
public IList<Types.TipsContent> TipsList { get; set; } = new List<Types.TipsContent>();
}
public class FileControlConfig
{
/// <summary>
/// 获取或设置是否只允许拍照。
/// </summary>
[Newtonsoft.Json.JsonProperty("is_only_photo")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("is_only_photo")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanConverter))]
public bool IsOnlyPhoto { get; set; }
}
public class TableControlConfig
{
/// <summary>
/// 获取或设置打印格式。
/// </summary>
[Newtonsoft.Json.JsonProperty("print_format")]
[System.Text.Json.Serialization.JsonPropertyName("print_format")]
public int PrintFormat { get; set; }
/// <summary>
/// 获取或设置子控件。
/// </summary>
@ -193,14 +360,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
public static class Types
{
public class DateRange
public class DateRange : DateRangeControlConfig
{
/// <summary>
/// 获取或设置时间刻度。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string Type { get; set; } = string.Empty;
}
}
@ -248,6 +409,50 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("item")]
public IList<Types.Vacation> VacationList { get; set; } = new List<Types.Vacation>();
}
public class DateRangeControlConfig
{
/// <summary>
/// 获取或设置时间刻度。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string Type { get; set; } = string.Empty;
/// <summary>
/// 获取或设置自然日或工作日。
/// </summary>
[Newtonsoft.Json.JsonProperty("official_holiday")]
[System.Text.Json.Serialization.JsonPropertyName("official_holiday")]
public int? OfficialHoliday { get; set; }
/// <summary>
/// 获取或设置一天的时长(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("perday_duration")]
[System.Text.Json.Serialization.JsonPropertyName("perday_duration")]
public int? PerdayDuration { get; set; }
}
public class LocationControlConfig
{
/// <summary>
/// 获取或设置距离(单位:米)。
/// </summary>
[Newtonsoft.Json.JsonProperty("distance")]
[System.Text.Json.Serialization.JsonPropertyName("distance")]
public int Distance { get; set; }
}
public class RelatedApprovalControlConfig
{
/// <summary>
/// 获取或设置审批单模板 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("template_id")]
[System.Text.Json.Serialization.JsonPropertyName("template_id")]
public IList<string> TemplateIdList { get; set; } = new List<string>();
}
}
/// <summary>

View File

@ -104,6 +104,20 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("contact")]
public ContactControlConfig? Contact { get; set; }
/// <summary>
/// 获取或设置 File 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("file")]
[System.Text.Json.Serialization.JsonPropertyName("file")]
public FileControlConfig? File { get; set; }
/// <summary>
/// 获取或设置 Tips 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("tips")]
[System.Text.Json.Serialization.JsonPropertyName("tips")]
public TipsControlConfig? Tips { get; set; }
/// <summary>
/// 获取或设置 Table 控件配置信息。
/// </summary>
@ -124,6 +138,27 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[Newtonsoft.Json.JsonProperty("vacation_list")]
[System.Text.Json.Serialization.JsonPropertyName("vacation_list")]
public VacationControlConfig? Vacation { get; set; }
/// <summary>
/// 获取或设置 DateRange 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("date_range")]
[System.Text.Json.Serialization.JsonPropertyName("date_range")]
public DateRangeControlConfig? DateRange { get; set; }
/// <summary>
/// 获取或设置 Location 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("location")]
[System.Text.Json.Serialization.JsonPropertyName("location")]
public LocationControlConfig? Location { get; set; }
/// <summary>
/// 获取或设置 RelatedApproval 控件配置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("related_approval")]
[System.Text.Json.Serialization.JsonPropertyName("related_approval")]
public RelatedApprovalControlConfig? RelatedApproval { get; set; }
}
public class DateControlConfig
@ -190,8 +225,140 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string Mode { get; set; } = default!;
}
public class TipsControlConfig
{
public static class Types
{
public class TipsContent
{
public static class Types
{
public class Text
{
public static class Types
{
public class SubText
{
public static class Types
{
public class Content
{
public static class Types
{
public class PlainText
{
/// <summary>
/// 获取或设置纯文本文字。
/// </summary>
[Newtonsoft.Json.JsonProperty("content")]
[System.Text.Json.Serialization.JsonPropertyName("content")]
public string Content { get; set; } = default!;
}
public class Link
{
/// <summary>
/// 获取或设置链接标题。
/// </summary>
[Newtonsoft.Json.JsonProperty("title")]
[System.Text.Json.Serialization.JsonPropertyName("title")]
public string Title { get; set; } = default!;
/// <summary>
/// 获取或设置链接 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("url")]
[System.Text.Json.Serialization.JsonPropertyName("url")]
public string URL { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置纯文本类型的内容信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("plain_text")]
[System.Text.Json.Serialization.JsonPropertyName("plain_text")]
public Types.PlainText? PlainText { get; set; }
/// <summary>
/// 获取或设置链接类型的内容信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("link")]
[System.Text.Json.Serialization.JsonPropertyName("link")]
public Types.Link? Link { get; set; }
}
}
/// <summary>
/// 获取或设置文本类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置文本内容。
/// </summary>
[Newtonsoft.Json.JsonProperty("content")]
[System.Text.Json.Serialization.JsonPropertyName("content")]
public Types.Content Content { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置说明文字分段列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_text")]
[System.Text.Json.Serialization.JsonPropertyName("sub_text")]
public Types.SubText[] SubTextList { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置语言类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("lang")]
[System.Text.Json.Serialization.JsonPropertyName("lang")]
public string Language { get; set; } = default!;
/// <summary>
/// 获取或设置说明文字信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("text")]
[System.Text.Json.Serialization.JsonPropertyName("text")]
public Types.Text Text { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置说明文字列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("tips_content")]
[System.Text.Json.Serialization.JsonPropertyName("tips_content")]
public Types.TipsContent[] TipsList { get; set; } = default!;
}
public class FileControlConfig
{
/// <summary>
/// 获取或设置是否只允许拍照。
/// </summary>
[Newtonsoft.Json.JsonProperty("is_only_photo")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("is_only_photo")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanConverter))]
public bool IsOnlyPhoto { get; set; }
}
public class TableControlConfig
{
/// <summary>
/// 获取或设置打印格式。
/// </summary>
[Newtonsoft.Json.JsonProperty("print_format")]
[System.Text.Json.Serialization.JsonPropertyName("print_format")]
public int PrintFormat { get; set; }
/// <summary>
/// 获取或设置子控件。
/// </summary>
@ -204,14 +371,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
public static class Types
{
public class DateRange
public class DateRange : DateRangeControlConfig
{
/// <summary>
/// 获取或设置时间刻度。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string Type { get; set; } = default!;
}
}
@ -259,6 +420,50 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("item")]
public Types.Vacation[] VacationList { get; set; } = default!;
}
public class DateRangeControlConfig
{
/// <summary>
/// 获取或设置时间刻度。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string Type { get; set; } = default!;
/// <summary>
/// 获取或设置自然日或工作日。
/// </summary>
[Newtonsoft.Json.JsonProperty("official_holiday")]
[System.Text.Json.Serialization.JsonPropertyName("official_holiday")]
public int? OfficialHoliday { get; set; }
/// <summary>
/// 获取或设置一天的时长(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("perday_duration")]
[System.Text.Json.Serialization.JsonPropertyName("perday_duration")]
public int? PerdayDuration { get; set; }
}
public class LocationControlConfig
{
/// <summary>
/// 获取或设置距离(单位:米)。
/// </summary>
[Newtonsoft.Json.JsonProperty("distance")]
[System.Text.Json.Serialization.JsonPropertyName("distance")]
public int Distance { get; set; }
}
public class RelatedApprovalControlConfig
{
/// <summary>
/// 获取或设置审批单模板 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("template_id")]
[System.Text.Json.Serialization.JsonPropertyName("template_id")]
public string[] TemplateIdList { get; set; } = default!;
}
}
/// <summary>

View File

@ -1,4 +1,4 @@
{
{
"template_name": [
{
"text": "我的api测试模版",
@ -13,13 +13,13 @@
"id": "Text-01",
"title": [
{
"text": "控件名称",
"text": "文本控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "控件说明",
"text": "文本控件说明",
"lang": "zh_CN"
}
],
@ -27,6 +27,452 @@
"un_print": 1
},
"config": {}
},
{
"property": {
"control": "Number",
"id": "Number-01",
"title": [
{
"text": "数字控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "数字控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {}
},
{
"property": {
"control": "Money",
"id": "Money-01",
"title": [
{
"text": "金额控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "金额控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {}
},
{
"property": {
"control": "Date",
"id": "Date-01",
"title": [
{
"text": "日期控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "日期控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"date": {
"type": "day"
}
}
},
{
"property": {
"control": "Selector",
"id": "Selector-01",
"title": [
{
"text": "多选控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "多选控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"selector": {
"type": "multi",
"options": [
{
"key": "option-1",
"value": [
{
"text": "选项1",
"lang": "zh_CN"
}
]
},
{
"key": "option-2",
"value": [
{
"text": "选项2",
"lang": "zh_CN"
}
]
}
]
}
}
},
{
"property": {
"control": "Contact",
"id": "Contact-01",
"title": [
{
"text": "成员控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "成员控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"contact": {
"type": "single",
"mode": "user"
}
}
},
{
"property": {
"control": "Tips",
"id": "Tips-01",
"title": [
{
"text": "说明文字控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "说明文字控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"tips": {
"tips_content": [
{
"text": {
"sub_text": [
{
"type": 1,
"content": {
"plain_text": {
"content": "说明文字"
}
}
},
{
"type": 2,
"content": {
"link": {
"title": "这是一个链接",
"url": "https://work.weixin.qq.com"
}
}
}
]
},
"lang": "zh_CN"
},
{
"text": {
"sub_text": [
{
"type": 1,
"content": {
"plain_text": {
"content": "tips"
}
}
},
{
"type": 2,
"content": {
"link": {
"title": "this is a link",
"url": "https://work.weixin.qq.com"
}
}
}
]
},
"lang": "en"
}
]
}
}
},
{
"property": {
"control": "File",
"id": "File-01",
"title": [
{
"text": "附件控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "附件控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"file": {
"is_only_photo": 1
}
}
},
{
"property": {
"control": "File",
"id": "File-01",
"title": [
{
"text": "附件控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "附件控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"file": {
"is_only_photo": 1
}
}
},
{
"property": {
"control": "Table",
"id": "Table-01",
"title": [
{
"text": "明细控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "明细控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"table": {
"print_format": 0,
"children": [
{
"property": {
"control": "File",
"id": "File-01",
"title": [
{
"text": "File控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"file": {
"is_only_photo": 1
}
}
},
{
"property": {
"control": "Date",
"id": "Date-01",
"title": [
{
"text": "Date控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"date": {
"type": "day"
}
}
}
]
}
}
},
{
"property": {
"control": "Attendance",
"id": "Attendance-01",
"title": [
{
"text": "假勤控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "假勤控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"attendance": {
"type": 3,
"date_range": {
"type": "halfday",
"official_holiday": 0,
"perday_duration": 86400
}
}
}
},
{
"property": {
"control": "DateRange",
"id": "DateRange-01",
"title": [
{
"text": "时长控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "时长控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"date_range": {
"type": "halfday",
"official_holiday": 0,
"perday_duration": 86400
}
}
},
{
"property": {
"control": "Location",
"id": "Location-01",
"title": [
{
"text": "位置控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "位置控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"location": {
"distance": 100
}
}
},
{
"property": {
"control": "RelatedApproval",
"id": "RelatedApproval-01",
"title": [
{
"text": "关联审批单控件名称",
"lang": "zh_CN"
}
],
"placeholder": [
{
"text": "关联审批单控件说明",
"lang": "zh_CN"
}
],
"require": 0,
"un_print": 1
},
"config": {
"related_approval": {
"template_id": [ "C4RbNKm731MCFVgk6XLq1Rs9W4aNXPJV2mmXT4qGy" ]
}
}
}
]
}

View File

@ -1,4 +1,4 @@
{
{
"errcode": 0,
"errmsg": "ok",
"template_names": [
@ -59,6 +59,58 @@
"type": "multi",
"mode": "department"
},
"tips": {
"tips_content": [
{
"text": {
"sub_text": [
{
"type": 1,
"content": {
"plain_text": {
"content": "说明文字"
}
}
},
{
"type": 2,
"content": {
"link": {
"title": "这是一个链接",
"url": "https://work.weixin.qq.com"
}
}
}
]
},
"lang": "zh_CN"
},
{
"text": {
"sub_text": [
{
"type": 1,
"content": {
"plain_text": {
"content": "tips"
}
}
},
{
"type": 2,
"content": {
"link": {
"title": "this is a link",
"url": "https://work.weixin.qq.com"
}
}
}
]
},
"lang": "en"
}
]
},
"table": {
"children": [
{