feat(work): 随官方更新文档智能表格相关接口模型

This commit is contained in:
Fu Diwei 2025-06-20 10:57:29 +08:00
parent 480e7fa91c
commit ff251444e2
8 changed files with 278 additions and 122 deletions

View File

@ -0,0 +1,57 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.doc_change 事件的数据。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/100986 ]]> <br/>
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/100987 ]]> <br/>
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/101016 ]]> <br/>
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/101017 ]]> <br/>
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/101018 ]]> <br/>
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/101019 ]]>
/// </para>
/// </summary>
public class SmartSheetChangeEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置变更类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("ChangeType")]
[System.Text.Json.Serialization.JsonPropertyName("ChangeType")]
[System.Xml.Serialization.XmlElement("ChangeType")]
public string ChangeType { get; set; } = default!;
/// <summary>
/// 获取或设置文档 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("DocId")]
[System.Text.Json.Serialization.JsonPropertyName("DocId")]
[System.Xml.Serialization.XmlElement("DocId", IsNullable = true)]
public string? DocumentId { get; set; }
/// <summary>
/// 获取或设置子表 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("SheetId")]
[System.Text.Json.Serialization.JsonPropertyName("SheetId")]
[System.Xml.Serialization.XmlElement("SheetId", IsNullable = true)]
public string? SheetId { get; set; }
/// <summary>
/// 获取或设置字段 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("FieldId")]
[System.Text.Json.Serialization.JsonPropertyName("FieldId")]
[System.Xml.Serialization.XmlElement("FieldId", Type = typeof(string), IsNullable = true)]
public string[]? FieldIdList { get; set; }
/// <summary>
/// 获取或设置记录 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("RecordId")]
[System.Text.Json.Serialization.JsonPropertyName("RecordId")]
[System.Xml.Serialization.XmlElement("RecordId", Type = typeof(string), IsNullable = true)]
public string[]? RecordIdList { get; set; }
}
}

View File

@ -331,6 +331,16 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("use_separate")] [System.Text.Json.Serialization.JsonPropertyName("use_separate")]
public bool IsUseSeparate { get; set; } public bool IsUseSeparate { get; set; }
} }
public class BarcodeFieldProperty
{
/// <summary>
/// 获取或设置是否仅限手机扫描录入。
/// </summary>
[Newtonsoft.Json.JsonProperty("mobile_scan_only")]
[System.Text.Json.Serialization.JsonPropertyName("mobile_scan_only")]
public bool IsMobileScanOnly { get; set; }
}
} }
/// <summary> /// <summary>
@ -472,6 +482,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[Newtonsoft.Json.JsonProperty("property_percentage")] [Newtonsoft.Json.JsonProperty("property_percentage")]
[System.Text.Json.Serialization.JsonPropertyName("property_percentage")] [System.Text.Json.Serialization.JsonPropertyName("property_percentage")]
public Types.PercentageFieldProperty? PropertyAsPercentage { get; set; } public Types.PercentageFieldProperty? PropertyAsPercentage { get; set; }
/// <summary>
/// 获取或设置条码的字段属性。
/// </summary>
[Newtonsoft.Json.JsonProperty("property_barcode")]
[System.Text.Json.Serialization.JsonPropertyName("property_barcode")]
public Types.BarcodeFieldProperty? PropertyAsBarcode { get; set; }
} }
} }

View File

@ -329,6 +329,16 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("use_separate")] [System.Text.Json.Serialization.JsonPropertyName("use_separate")]
public bool IsUseSeparate { get; set; } public bool IsUseSeparate { get; set; }
} }
public class BarcodeFieldProperty
{
/// <summary>
/// 获取或设置是否仅限手机扫描录入。
/// </summary>
[Newtonsoft.Json.JsonProperty("mobile_scan_only")]
[System.Text.Json.Serialization.JsonPropertyName("mobile_scan_only")]
public bool IsMobileScanOnly { get; set; }
}
} }
/// <summary> /// <summary>
@ -477,6 +487,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[Newtonsoft.Json.JsonProperty("property_percentage")] [Newtonsoft.Json.JsonProperty("property_percentage")]
[System.Text.Json.Serialization.JsonPropertyName("property_percentage")] [System.Text.Json.Serialization.JsonPropertyName("property_percentage")]
public Types.PercentageFieldProperty? PropertyAsPercentage { get; set; } public Types.PercentageFieldProperty? PropertyAsPercentage { get; set; }
/// <summary>
/// 获取或设置条码的字段属性。
/// </summary>
[Newtonsoft.Json.JsonProperty("property_barcode")]
[System.Text.Json.Serialization.JsonPropertyName("property_barcode")]
public Types.BarcodeFieldProperty? PropertyAsBarcode { get; set; }
} }
} }

View File

@ -25,6 +25,158 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("desc")] [System.Text.Json.Serialization.JsonPropertyName("desc")]
public bool IsDescend { get; set; } public bool IsDescend { get; set; }
} }
public class FilterSpec
{
public static class Types
{
public class Condition
{
public static class Types
{
public class StringValue
{
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public IList<string> Value { get; set; } = new List<string>();
}
public class NumberValue
{
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public decimal Value { get; set; }
}
public class BoolValue
{
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public bool Value { get; set; }
}
public class UserValue
{
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public IList<string> Value { get; set; } = new List<string>();
}
public class DateTimeValue
{
public static class Types
{
public class Value
{
/// <summary>
/// 获取或设置日期类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string Type { get; set; } = string.Empty;
/// <summary>
/// 获取或设置日期时间值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public IList<string>? DateTimes { get; set; }
}
}
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public Types.Value Value { get; set; } = new Types.Value();
}
}
/// <summary>
/// 获取或设置字段 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("field_id")]
[System.Text.Json.Serialization.JsonPropertyName("field_id")]
public string FieldId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置字段类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("field_type")]
[System.Text.Json.Serialization.JsonPropertyName("field_type")]
public string? FieldType { get; set; }
/// <summary>
/// 获取或设置判断类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("operator")]
[System.Text.Json.Serialization.JsonPropertyName("operator")]
public string Operator { get; set; } = string.Empty;
/// <summary>
/// 获取或设置文本值。
/// </summary>
[Newtonsoft.Json.JsonProperty("string_value")]
[System.Text.Json.Serialization.JsonPropertyName("string_value")]
public Types.StringValue? StringValue { get; set; }
/// <summary>
/// 获取或设置数字值。
/// </summary>
[Newtonsoft.Json.JsonProperty("number_value")]
[System.Text.Json.Serialization.JsonPropertyName("number_value")]
public Types.NumberValue? NumberValue { get; set; }
/// <summary>
/// 获取或设置布尔值。
/// </summary>
[Newtonsoft.Json.JsonProperty("bool_value")]
[System.Text.Json.Serialization.JsonPropertyName("bool_value")]
public Types.BoolValue? BoolValue { get; set; }
/// <summary>
/// 获取或设置人员值。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_value")]
[System.Text.Json.Serialization.JsonPropertyName("user_value")]
public Types.UserValue? UserValue { get; set; }
/// <summary>
/// 获取或设置日期时间值。
/// </summary>
[Newtonsoft.Json.JsonProperty("date_time_value")]
[System.Text.Json.Serialization.JsonPropertyName("date_time_value")]
public Types.DateTimeValue? DateTimeValue { get; set; }
}
}
/// <summary>
/// 获取或设置条件连词。
/// </summary>
[Newtonsoft.Json.JsonProperty("conjunction")]
[System.Text.Json.Serialization.JsonPropertyName("conjunction")]
public string Conjunction { get; set; } = string.Empty;
/// <summary>
/// 获取或设置条件列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("conditions")]
[System.Text.Json.Serialization.JsonPropertyName("conditions")]
public IList<Types.Condition> ConditionList { get; set; } = new List<Types.Condition>();
}
} }
/// <summary> /// <summary>
@ -83,6 +235,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[System.Text.Json.Serialization.JsonPropertyName("sort")] [System.Text.Json.Serialization.JsonPropertyName("sort")]
public IList<Types.SortField>? SortFieldList { get; set; } public IList<Types.SortField>? SortFieldList { get; set; }
/// <summary>
/// 获取或设置过滤设置。
/// </summary>
[Newtonsoft.Json.JsonProperty("filter_spec")]
[System.Text.Json.Serialization.JsonPropertyName("filter_spec")]
public Types.FilterSpec? FilterSpec { get; set; }
/// <summary> /// <summary>
/// 获取或设置分页起始位置。 /// 获取或设置分页起始位置。
/// </summary> /// </summary>

View File

@ -102,6 +102,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public class PercentageFieldProperty : CgibinWedocSmartSheetAddFieldsRequest.Types.Field.Types.PercentageFieldProperty public class PercentageFieldProperty : CgibinWedocSmartSheetAddFieldsRequest.Types.Field.Types.PercentageFieldProperty
{ {
} }
public class BarcodeFieldProperty : CgibinWedocSmartSheetAddFieldsRequest.Types.Field.Types.BarcodeFieldProperty
{
}
} }
/// <summary> /// <summary>
@ -250,6 +254,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
[Newtonsoft.Json.JsonProperty("property_percentage")] [Newtonsoft.Json.JsonProperty("property_percentage")]
[System.Text.Json.Serialization.JsonPropertyName("property_percentage")] [System.Text.Json.Serialization.JsonPropertyName("property_percentage")]
public Types.PercentageFieldProperty? PropertyAsPercentage { get; set; } public Types.PercentageFieldProperty? PropertyAsPercentage { get; set; }
/// <summary>
/// 获取或设置条码的字段属性。
/// </summary>
[Newtonsoft.Json.JsonProperty("property_barcode")]
[System.Text.Json.Serialization.JsonPropertyName("property_barcode")]
public Types.BarcodeFieldProperty? PropertyAsBarcode { get; set; }
} }
} }

View File

@ -77,129 +77,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{ {
public static class Types public static class Types
{ {
public class Condition public class Condition : CgibinWedocSmartSheetGetRecordsRequest.Types.FilterSpec.Types.Condition
{ {
public static class Types
{
public class StringValue
{
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public IList<string> Value { get; set; } = new List<string>();
}
public class NumberValue
{
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public decimal Value { get; set; }
}
public class BoolValue
{
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public bool Value { get; set; }
}
public class UserValue
{
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public IList<string> Value { get; set; } = new List<string>();
}
public class DateTimeValue
{
public static class Types
{
public class Value
{
/// <summary>
/// 获取或设置日期类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string Type { get; set; } = string.Empty;
/// <summary>
/// 获取或设置日期时间值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public IList<string>? DateTimes { get; set; }
}
}
/// <summary>
/// 获取或设置值。
/// </summary>
[Newtonsoft.Json.JsonProperty("value")]
[System.Text.Json.Serialization.JsonPropertyName("value")]
public Types.Value Value { get; set; } = new Types.Value();
}
}
/// <summary>
/// 获取或设置字段 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("field_id")]
[System.Text.Json.Serialization.JsonPropertyName("field_id")]
public string FieldId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置判断类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("operator")]
[System.Text.Json.Serialization.JsonPropertyName("operator")]
public string Operator { get; set; } = string.Empty;
/// <summary>
/// 获取或设置文本值。
/// </summary>
[Newtonsoft.Json.JsonProperty("string_value")]
[System.Text.Json.Serialization.JsonPropertyName("string_value")]
public Types.StringValue? StringValue { get; set; }
/// <summary>
/// 获取或设置数字值。
/// </summary>
[Newtonsoft.Json.JsonProperty("number_value")]
[System.Text.Json.Serialization.JsonPropertyName("number_value")]
public Types.NumberValue? NumberValue { get; set; }
/// <summary>
/// 获取或设置布尔值。
/// </summary>
[Newtonsoft.Json.JsonProperty("bool_value")]
[System.Text.Json.Serialization.JsonPropertyName("bool_value")]
public Types.BoolValue? BoolValue { get; set; }
/// <summary>
/// 获取或设置人员值。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_value")]
[System.Text.Json.Serialization.JsonPropertyName("user_value")]
public Types.UserValue? UserValue { get; set; }
/// <summary>
/// 获取或设置日期时间值。
/// </summary>
[Newtonsoft.Json.JsonProperty("date_time_value")]
[System.Text.Json.Serialization.JsonPropertyName("date_time_value")]
public Types.DateTimeValue? DateTimeValue { get; set; }
} }
} }

View File

@ -0,0 +1,14 @@
<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1348831860</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[smart_sheet_change]]></Event>
<ChangeType><![CDATA[update_field_or_record]]></ChangeType>
<DocId><![CDATA[dcjgewCwAAqeJcPI1d8Pwbjt7nttzAAA]]></DocId>
<SheetId><![CDATA[SheetId]]></SheetId>
<FieldId><![CDATA[FieldId1]]></FieldId>
<FieldId><![CDATA[FieldId2]]></FieldId>
<RecordId><![CDATA[RecordId1]]></RecordId>
<RecordId><![CDATA[RecordId2]]></RecordId>
</xml>

View File

@ -16,6 +16,8 @@
"desc": false "desc": false
} }
], ],
"filter_spec": {
},
"offset": 0, "offset": 0,
"limit": 100 "limit": 100
} }