feat(work): 升级公共组件

This commit is contained in:
Fu Diwei 2024-01-29 23:12:28 +08:00 committed by RHQYZ
parent 43eeb6fe6e
commit 84ee19d614
267 changed files with 3026 additions and 2972 deletions

View File

@ -1,54 +0,0 @@
using System;
namespace Newtonsoft.Json.Converters
{
internal class TextualIntegerArrayWithPipeSplitConverter : JsonConverter<int[]?>
{
public override bool CanRead
{
get { return true; }
}
public override bool CanWrite
{
get { return true; }
}
public override int[]? ReadJson(JsonReader reader, Type objectType, int[]? existingValue, bool hasExistingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null)
{
return null;
}
else if (reader.TokenType == JsonToken.String)
{
string? value = serializer.Deserialize<string>(reader);
if (value == null)
return null;
if (string.IsNullOrEmpty(value))
return Array.Empty<int>();
string[] strArr = value.Split('|');
int[] intArr = new int[strArr.Length];
for (int i = 0; i < strArr.Length; i++)
{
if (!int.TryParse(strArr[i], out int j))
throw new JsonSerializationException("Unexpected token when parsing string to integer.");
intArr[i] = j;
}
return intArr;
}
throw new JsonSerializationException();
}
public override void WriteJson(JsonWriter writer, int[]? value, JsonSerializer serializer)
{
if (value != null)
writer.WriteValue(string.Join("|", value));
else
writer.WriteNull();
}
}
}

View File

@ -1,54 +0,0 @@
using System;
namespace Newtonsoft.Json.Converters
{
internal class TextualLongArrayWithPipeSplitConverter : JsonConverter<long[]?>
{
public override bool CanRead
{
get { return true; }
}
public override bool CanWrite
{
get { return true; }
}
public override long[]? ReadJson(JsonReader reader, Type objectType, long[]? existingValue, bool hasExistingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null)
{
return null;
}
else if (reader.TokenType == JsonToken.String)
{
string? value = serializer.Deserialize<string>(reader);
if (value == null)
return null;
if (string.IsNullOrEmpty(value))
return Array.Empty<long>();
string[] strArr = value.Split('|');
long[] intArr = new long[strArr.Length];
for (int i = 0; i < strArr.Length; i++)
{
if (!long.TryParse(strArr[i], out long j))
throw new JsonSerializationException("Unexpected token when parsing string to long.");
intArr[i] = j;
}
return intArr;
}
throw new JsonSerializationException();
}
public override void WriteJson(JsonWriter writer, long[]? value, JsonSerializer serializer)
{
if (value != null)
writer.WriteValue(string.Join("|", value));
else
writer.WriteNull();
}
}
}

View File

@ -1,45 +0,0 @@
using System;
namespace Newtonsoft.Json.Converters
{
internal class TextualStringArrayWithPipeSplitConverter : JsonConverter<string[]?>
{
public override bool CanRead
{
get { return true; }
}
public override bool CanWrite
{
get { return true; }
}
public override string[]? ReadJson(JsonReader reader, Type objectType, string[]? existingValue, bool hasExistingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null)
{
return null;
}
else if (reader.TokenType == JsonToken.String)
{
string? value = serializer.Deserialize<string>(reader);
if (value == null)
return null;
if (string.IsNullOrEmpty(value))
return Array.Empty<string>();
return value.Split('|');
}
throw new JsonSerializationException();
}
public override void WriteJson(JsonWriter writer, string[]? value, JsonSerializer serializer)
{
if (value != null)
writer.WriteValue(string.Join("|", value));
else
writer.WriteNull();
}
}
}

View File

@ -1,39 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Newtonsoft.Json.Converters
{
internal class TextualIntegerListWithPipeSplitConverter : JsonConverter
{
private readonly JsonConverter<int[]?> _converter = new TextualIntegerArrayWithPipeSplitConverter();
public override bool CanConvert(Type objectType)
{
return objectType.IsGenericType &&
typeof(IList<>).IsAssignableFrom(objectType.GetGenericTypeDefinition()) &&
typeof(int) == objectType.GetGenericArguments()[0];
}
public override bool CanRead
{
get { return true; }
}
public override bool CanWrite
{
get { return true; }
}
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{
int[]? array = _converter.ReadJson(reader, objectType, null, false, serializer);
return array?.ToList();
}
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
_converter.WriteJson(writer, ((IList<int>?)value)?.ToArray(), serializer);
}
}
}

View File

@ -1,39 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Newtonsoft.Json.Converters
{
internal class TextualLongListWithPipeSplitConverter : JsonConverter
{
private readonly JsonConverter<long[]?> _converter = new TextualLongArrayWithPipeSplitConverter();
public override bool CanConvert(Type objectType)
{
return objectType.IsGenericType &&
typeof(IList<>).IsAssignableFrom(objectType.GetGenericTypeDefinition()) &&
typeof(long) == objectType.GetGenericArguments()[0];
}
public override bool CanRead
{
get { return true; }
}
public override bool CanWrite
{
get { return true; }
}
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{
long[]? array = _converter.ReadJson(reader, objectType, null, false, serializer);
return array?.ToList();
}
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
_converter.WriteJson(writer, ((IList<long>?)value)?.ToArray(), serializer);
}
}
}

View File

@ -1,39 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Newtonsoft.Json.Converters
{
internal class TextualStringListWithPipeSplitConverter : JsonConverter
{
private readonly JsonConverter<string[]?> _converter = new TextualStringArrayWithPipeSplitConverter();
public override bool CanConvert(Type objectType)
{
return objectType.IsGenericType &&
typeof(IList<>).IsAssignableFrom(objectType.GetGenericTypeDefinition()) &&
typeof(string) == objectType.GetGenericArguments()[0];
}
public override bool CanRead
{
get { return true; }
}
public override bool CanWrite
{
get { return true; }
}
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{
string[]? array = _converter.ReadJson(reader, objectType, null, false, serializer);
return array?.ToList();
}
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
_converter.WriteJson(writer, ((IList<string>?)value)?.ToArray(), serializer);
}
}
}

View File

@ -1,44 +0,0 @@
using System.Text.Json.Serialization;
namespace System.Text.Json.Converters
{
internal class TextualIntegerArrayWithPipeSplitConverter : JsonConverter<int[]?>
{
public override int[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Null)
{
return null;
}
else if (reader.TokenType == JsonTokenType.String)
{
string? value = reader.GetString();
if (value == null)
return null;
if (string.IsNullOrEmpty(value))
return Array.Empty<int>();
string[] strArr = value.Split('|');
int[] intArr = new int[strArr.Length];
for (int i = 0; i < strArr.Length; i++)
{
if (!int.TryParse(strArr[i], out int j))
throw new JsonException("Unexpected token when parsing string to integer.");
intArr[i] = j;
}
return intArr;
}
throw new JsonException();
}
public override void Write(Utf8JsonWriter writer, int[]? value, JsonSerializerOptions options)
{
if (value != null)
writer.WriteStringValue(string.Join("|", value));
else
writer.WriteNullValue();
}
}
}

View File

@ -1,44 +0,0 @@
using System.Text.Json.Serialization;
namespace System.Text.Json.Converters
{
internal class TextualLongArrayWithPipeSplitConverter : JsonConverter<long[]?>
{
public override long[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Null)
{
return null;
}
else if (reader.TokenType == JsonTokenType.String)
{
string? value = reader.GetString();
if (value == null)
return null;
if (string.IsNullOrEmpty(value))
return Array.Empty<long>();
string[] strArr = value.Split('|');
long[] intArr = new long[strArr.Length];
for (int i = 0; i < strArr.Length; i++)
{
if (!long.TryParse(strArr[i], out long j))
throw new JsonException("Unexpected token when parsing string to long.");
intArr[i] = j;
}
return intArr;
}
throw new JsonException();
}
public override void Write(Utf8JsonWriter writer, long[]? value, JsonSerializerOptions options)
{
if (value != null)
writer.WriteStringValue(string.Join("|", value));
else
writer.WriteNullValue();
}
}
}

View File

@ -1,35 +0,0 @@
using System.Text.Json.Serialization;
namespace System.Text.Json.Converters
{
internal class TextualStringArrayWithPipeSplitConverter : JsonConverter<string[]?>
{
public override string[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Null)
{
return null;
}
else if (reader.TokenType == JsonTokenType.String)
{
string? value = reader.GetString();
if (value == null)
return null;
if (string.IsNullOrEmpty(value))
return Array.Empty<string>();
return value.Split('|');
}
throw new JsonException();
}
public override void Write(Utf8JsonWriter writer, string[]? value, JsonSerializerOptions options)
{
if (value != null)
writer.WriteStringValue(string.Join("|", value));
else
writer.WriteNullValue();
}
}
}

View File

@ -1,38 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
namespace System.Text.Json.Converters
{
internal class TextualIntegerListWithPipeSplitConverter : JsonConverterFactory
{
private sealed class InnerTextualIntegerListWithVBarSplitConverter : JsonConverter<IList<int>?>
{
private readonly JsonConverter<int[]?> _converter = new TextualIntegerArrayWithPipeSplitConverter();
public override IList<int>? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
int[]? array = _converter.Read(ref reader, typeToConvert, options);
IList<int>? list = array?.ToList();
return list;
}
public override void Write(Utf8JsonWriter writer, IList<int>? value, JsonSerializerOptions options)
{
_converter.Write(writer, value?.ToArray(), options);
}
}
public override bool CanConvert(Type typeToConvert)
{
return typeToConvert.IsGenericType &&
typeof(IList<>).IsAssignableFrom(typeToConvert.GetGenericTypeDefinition()) &&
typeof(int) == typeToConvert.GetGenericArguments()[0];
}
public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options)
{
return new InnerTextualIntegerListWithVBarSplitConverter();
}
}
}

View File

@ -1,38 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
namespace System.Text.Json.Converters
{
internal class TextualLongListWithPipeSplitConverter : JsonConverterFactory
{
private sealed class InnerTextualIntegerListWithVBarSplitConverter : JsonConverter<IList<long>?>
{
private readonly JsonConverter<long[]?> _converter = new TextualLongArrayWithPipeSplitConverter();
public override IList<long>? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
long[]? array = _converter.Read(ref reader, typeToConvert, options);
IList<long>? list = array?.ToList();
return list;
}
public override void Write(Utf8JsonWriter writer, IList<long>? value, JsonSerializerOptions options)
{
_converter.Write(writer, value?.ToArray(), options);
}
}
public override bool CanConvert(Type typeToConvert)
{
return typeToConvert.IsGenericType &&
typeof(IList<>).IsAssignableFrom(typeToConvert.GetGenericTypeDefinition()) &&
typeof(long) == typeToConvert.GetGenericArguments()[0];
}
public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options)
{
return new InnerTextualIntegerListWithVBarSplitConverter();
}
}
}

View File

@ -1,38 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
namespace System.Text.Json.Converters
{
internal class TextualStringListWithPipeSplitConverter : JsonConverterFactory
{
private sealed class InnerTextualStringListWithVBarSplitConverter : JsonConverter<IList<string>?>
{
private readonly JsonConverter<string[]?> _converter = new TextualStringArrayWithPipeSplitConverter();
public override IList<string>? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
string[]? array = _converter.Read(ref reader, typeToConvert, options);
IList<string>? list = array?.ToList();
return list;
}
public override void Write(Utf8JsonWriter writer, IList<string>? value, JsonSerializerOptions options)
{
_converter.Write(writer, value?.ToArray(), options);
}
}
public override bool CanConvert(Type typeToConvert)
{
return typeToConvert.IsGenericType &&
typeof(IList<>).IsAssignableFrom(typeToConvert.GetGenericTypeDefinition()) &&
typeof(string) == typeToConvert.GetGenericArguments()[0];
}
public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options)
{
return new InnerTextualStringListWithVBarSplitConverter();
}
}
}

View File

@ -1,38 +0,0 @@
using System.Text.Json.Serialization;
namespace System.Text.Json.Converters
{
internal class TextualNullableLongConverter : JsonConverter<long?>
{
public override long? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Null)
{
return null;
}
else if (reader.TokenType == JsonTokenType.Number)
{
return reader.GetInt64();
}
else if (reader.TokenType == JsonTokenType.String)
{
string? value = reader.GetString();
if (string.IsNullOrEmpty(value))
return null;
if (long.TryParse(value, out long l))
return l;
}
throw new JsonException();
}
public override void Write(Utf8JsonWriter writer, long? value, JsonSerializerOptions options)
{
if (value.HasValue)
writer.WriteNumberValue(value.Value);
else
writer.WriteNullValue();
}
}
}

View File

@ -1,20 +1,24 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.switch_workbench_mode 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92535 </para>
/// </summary>
public class SwitchWorkbenchModeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class SwitchWorkbenchModeEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置自定义模式。
/// </summary>
[Newtonsoft.Json.JsonProperty("Mode")]
[System.Text.Json.Serialization.JsonPropertyName("Mode")]
[System.Xml.Serialization.XmlElement("Mode")]
public int Mode { get; set; }
}

View File

@ -1,11 +1,11 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.open_approval_change 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90269 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93798 </para>
/// </summary>
public class OpenApprovalChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class OpenApprovalChangeEvent : WechatWorkEvent
{
public static class Types
{
@ -26,6 +26,8 @@
/// <summary>
/// 获取或设置审批人列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Item")]
[System.Text.Json.Serialization.JsonPropertyName("Item")]
[System.Xml.Serialization.XmlElement("Item", typeof(ApprovalerItem))]
public ApprovalerItem[] Items { get; set; } = default!;
}
@ -35,42 +37,56 @@
/// <summary>
/// 获取或设置审批人成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemUserid")]
[System.Text.Json.Serialization.JsonPropertyName("ItemUserid")]
[System.Xml.Serialization.XmlElement("ItemUserid")]
public string UserId { get; set; } = default!;
/// <summary>
/// 获取或设置审批人名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemName")]
[System.Text.Json.Serialization.JsonPropertyName("ItemName")]
[System.Xml.Serialization.XmlElement("ItemName")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置审批人部门名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemParty")]
[System.Text.Json.Serialization.JsonPropertyName("ItemParty")]
[System.Xml.Serialization.XmlElement("ItemParty")]
public string DepartmentName { get; set; } = default!;
/// <summary>
/// 获取或设置审批人头像 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemImage")]
[System.Text.Json.Serialization.JsonPropertyName("ItemImage")]
[System.Xml.Serialization.XmlElement("ItemImage")]
public string AvatarUrl { get; set; } = default!;
/// <summary>
/// 获取或设置分支审批状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemStatus")]
[System.Text.Json.Serialization.JsonPropertyName("ItemStatus")]
[System.Xml.Serialization.XmlElement("ItemStatus")]
public int ApproveStatus { get; set; }
/// <summary>
/// 获取或设置分支审批时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemOpTime")]
[System.Text.Json.Serialization.JsonPropertyName("ItemOpTime")]
[System.Xml.Serialization.XmlElement("ItemOpTime", IsNullable = true)]
public long? ApproveTimestamp { get; set; }
/// <summary>
/// 获取或设置审批意见。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemSpeech")]
[System.Text.Json.Serialization.JsonPropertyName("ItemSpeech")]
[System.Xml.Serialization.XmlElement("ItemSpeech", IsNullable = true)]
public string? Speech { get; set; }
}
@ -79,24 +95,32 @@
/// <summary>
/// 获取或设置节点审批状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("NodeStatus")]
[System.Text.Json.Serialization.JsonPropertyName("NodeStatus")]
[System.Xml.Serialization.XmlElement("NodeStatus")]
public int ApproveStatus { get; set; }
/// <summary>
/// 获取或设置节点审批方式。
/// </summary>
[Newtonsoft.Json.JsonProperty("NodeAttr")]
[System.Text.Json.Serialization.JsonPropertyName("NodeAttr")]
[System.Xml.Serialization.XmlElement("NodeAttr")]
public int ApproveType { get; set; }
/// <summary>
/// 获取或设置节点类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("NodeType")]
[System.Text.Json.Serialization.JsonPropertyName("NodeType")]
[System.Xml.Serialization.XmlElement("NodeType")]
public int NodeType { get; set; }
/// <summary>
/// 获取或设置节点审批人列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Items")]
[System.Text.Json.Serialization.JsonPropertyName("Items")]
[System.Xml.Serialization.XmlElement("Items")]
public Types.ApprovalerList ApprovalerList { get; set; } = default!;
}
@ -105,6 +129,8 @@
/// <summary>
/// 获取或设置审批流程详情列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApprovalNode")]
[System.Text.Json.Serialization.JsonPropertyName("ApprovalNode")]
[System.Xml.Serialization.XmlElement("ApprovalNode", typeof(Types.RecordDetail))]
public Types.RecordDetail[] RecordDetailList { get; set; } = default!;
}
@ -118,24 +144,32 @@
/// <summary>
/// 获取或设置抄送人成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemUserid")]
[System.Text.Json.Serialization.JsonPropertyName("ItemUserid")]
[System.Xml.Serialization.XmlElement("ItemUserid")]
public string UserId { get; set; } = default!;
/// <summary>
/// 获取或设置抄送人名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemName")]
[System.Text.Json.Serialization.JsonPropertyName("ItemName")]
[System.Xml.Serialization.XmlElement("ItemName")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置抄送人部门名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemParty")]
[System.Text.Json.Serialization.JsonPropertyName("ItemParty")]
[System.Xml.Serialization.XmlElement("ItemParty")]
public string DepartmentName { get; set; } = default!;
/// <summary>
/// 获取或设置抄送人头像 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("ItemImage")]
[System.Text.Json.Serialization.JsonPropertyName("ItemImage")]
[System.Xml.Serialization.XmlElement("ItemImage")]
public string AvatarUrl { get; set; } = default!;
}
@ -144,6 +178,8 @@
/// <summary>
/// 获取或设置审批抄送列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("NotifyNode")]
[System.Text.Json.Serialization.JsonPropertyName("NotifyNode")]
[System.Xml.Serialization.XmlElement("NotifyNode", typeof(Types.Notifier))]
public Types.Notifier[] NotifierList { get; set; } = default!;
}
@ -152,72 +188,96 @@
/// <summary>
/// 获取或设置第三方审批单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("ThirdNo")]
[System.Text.Json.Serialization.JsonPropertyName("ThirdNo")]
[System.Xml.Serialization.XmlElement("ThirdNo")]
public string ThirdPartyApprovalNumber { get; set; } = default!;
/// <summary>
/// 获取或设置服务商审批模板 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("OpenTemplateId")]
[System.Text.Json.Serialization.JsonPropertyName("OpenTemplateId")]
[System.Xml.Serialization.XmlElement("OpenTemplateId")]
public string OpenTemplateId { get; set; } = default!;
/// <summary>
/// 获取或设置审批单名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("OpenSpName")]
[System.Text.Json.Serialization.JsonPropertyName("OpenSpName")]
[System.Xml.Serialization.XmlElement("OpenSpName")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置审批单状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("OpenSpStatus")]
[System.Text.Json.Serialization.JsonPropertyName("OpenSpStatus")]
[System.Xml.Serialization.XmlElement("OpenSpStatus")]
public int Status { get; set; }
/// <summary>
/// 获取或设置申请时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApplyTime")]
[System.Text.Json.Serialization.JsonPropertyName("ApplyTime")]
[System.Xml.Serialization.XmlElement("ApplyTime")]
public long ApplyTimestamp { get; set; }
/// <summary>
/// 获取或设置申请人成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApplyUserId")]
[System.Text.Json.Serialization.JsonPropertyName("ApplyUserId")]
[System.Xml.Serialization.XmlElement("ApplyUserId")]
public string ApplicantUserId { get; set; } = default!;
/// <summary>
/// 获取或设置申请人成员名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApplyUserName")]
[System.Text.Json.Serialization.JsonPropertyName("ApplyUserName")]
[System.Xml.Serialization.XmlElement("ApplyUserName")]
public string ApplicantName { get; set; } = default!;
/// <summary>
/// 获取或设置提单部门名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApplyUserParty")]
[System.Text.Json.Serialization.JsonPropertyName("ApplyUserParty")]
[System.Xml.Serialization.XmlElement("ApplyUserParty")]
public string ApplicantDepartmentName { get; set; } = default!;
/// <summary>
/// 获取或设置申请人头像 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApplyUserImage")]
[System.Text.Json.Serialization.JsonPropertyName("ApplyUserImage")]
[System.Xml.Serialization.XmlElement("ApplyUserImage")]
public string ApplicantAvatarUrl { get; set; } = default!;
/// <summary>
/// 获取或设置审批信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApprovalNodes")]
[System.Text.Json.Serialization.JsonPropertyName("ApprovalNodes")]
[System.Xml.Serialization.XmlElement("ApprovalNodes")]
public Types.ApprovalRecord ApprovalRecord { get; set; } = default!;
/// <summary>
/// 获取或设置抄送信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("NotifyNodes")]
[System.Text.Json.Serialization.JsonPropertyName("NotifyNodes")]
[System.Xml.Serialization.XmlElement("NotifyNodes")]
public Types.Notification Notification { get; set; } = default!;
/// <summary>
/// 获取或设置当前审批节点。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApproverStep")]
[System.Text.Json.Serialization.JsonPropertyName("ApproverStep")]
[System.Xml.Serialization.XmlElement("ApproverStep")]
public int ApproverStep { get; set; }
}
@ -226,12 +286,16 @@
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置第三方审批单信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApprovalInfo")]
[System.Text.Json.Serialization.JsonPropertyName("ApprovalInfo")]
[System.Xml.Serialization.XmlElement("ApprovalInfo")]
public Types.Approval Approval { get; set; } = default!;
}

View File

@ -1,11 +1,11 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.sys_approval_change 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91815 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92633 </para>
/// </summary>
public class SystemApprovalChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class SystemApprovalChangeEvent : WechatWorkEvent
{
public static class Types
{
@ -18,12 +18,16 @@
/// <summary>
/// 获取或设置申请人成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserId")]
[System.Text.Json.Serialization.JsonPropertyName("UserId")]
[System.Xml.Serialization.XmlElement("UserId")]
public string UserId { get; set; } = default!;
/// <summary>
/// 获取或设置提单部门 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("Party")]
[System.Text.Json.Serialization.JsonPropertyName("Party")]
[System.Xml.Serialization.XmlElement("Party")]
public long DepartmentId { get; set; }
}
@ -33,6 +37,8 @@
/// <summary>
/// 获取或设置抄送人成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserId")]
[System.Text.Json.Serialization.JsonPropertyName("UserId")]
[System.Xml.Serialization.XmlElement("UserId")]
public string UserId { get; set; } = default!;
}
@ -50,6 +56,8 @@
/// <summary>
/// 获取或设置审批人成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserId")]
[System.Text.Json.Serialization.JsonPropertyName("UserId")]
[System.Xml.Serialization.XmlElement("UserId")]
public string UserId { get; set; } = default!;
}
@ -58,30 +66,40 @@
/// <summary>
/// 获取或设置审批人信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("Approver")]
[System.Text.Json.Serialization.JsonPropertyName("Approver")]
[System.Xml.Serialization.XmlElement("Approver")]
public Types.Approver Approver { get; set; } = default!;
/// <summary>
/// 获取或设置分支审批状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("SpStatus")]
[System.Text.Json.Serialization.JsonPropertyName("SpStatus")]
[System.Xml.Serialization.XmlElement("SpStatus")]
public int ApproveStatus { get; set; }
/// <summary>
/// 获取或设置分支审批时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("SpTime")]
[System.Text.Json.Serialization.JsonPropertyName("SpTime")]
[System.Xml.Serialization.XmlElement("SpTime", IsNullable = true)]
public long? ApproveTimestamp { get; set; }
/// <summary>
/// 获取或设置审批意见。
/// </summary>
[Newtonsoft.Json.JsonProperty("Speech")]
[System.Text.Json.Serialization.JsonPropertyName("Speech")]
[System.Xml.Serialization.XmlElement("Speech", IsNullable = true)]
public string? Speech { get; set; }
/// <summary>
/// 获取或设置审批意见附件 MediaId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Attach")]
[System.Text.Json.Serialization.JsonPropertyName("Attach")]
[System.Xml.Serialization.XmlElement("Attach", Type = typeof(string), IsNullable = true)]
public string[]? SpeechMediaIdList { get; set; }
}
@ -90,18 +108,24 @@
/// <summary>
/// 获取或设置节点审批状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("SpStatus")]
[System.Text.Json.Serialization.JsonPropertyName("SpStatus")]
[System.Xml.Serialization.XmlElement("SpStatus")]
public int ApproveStatus { get; set; }
/// <summary>
/// 获取或设置审批方式。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApproverAttr")]
[System.Text.Json.Serialization.JsonPropertyName("ApproverAttr")]
[System.Xml.Serialization.XmlElement("ApproverAttr")]
public int ApproveType { get; set; }
/// <summary>
/// 获取或设置审批流程详情列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Details")]
[System.Text.Json.Serialization.JsonPropertyName("Details")]
[System.Xml.Serialization.XmlElement("Details", typeof(Types.RecordDetail))]
public Types.RecordDetail[] DetailList { get; set; } = default!;
}
@ -115,6 +139,8 @@
/// <summary>
/// 获取或设置评论人成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserId")]
[System.Text.Json.Serialization.JsonPropertyName("UserId")]
[System.Xml.Serialization.XmlElement("UserId")]
public string UserId { get; set; } = default!;
}
@ -123,30 +149,40 @@
/// <summary>
/// 获取或设置评论 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("CommentId")]
[System.Text.Json.Serialization.JsonPropertyName("CommentId")]
[System.Xml.Serialization.XmlElement("CommentId")]
public string CommentId { get; set; } = default!;
/// <summary>
/// 获取或设置评论人信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("CommentUserInfo")]
[System.Text.Json.Serialization.JsonPropertyName("CommentUserInfo")]
[System.Xml.Serialization.XmlElement("CommentUserInfo")]
public Types.CommentUser CommentUser { get; set; } = default!;
/// <summary>
/// 获取或设置评论内容。
/// </summary>
[Newtonsoft.Json.JsonProperty("CommentContent")]
[System.Text.Json.Serialization.JsonPropertyName("CommentContent")]
[System.Xml.Serialization.XmlElement("CommentContent")]
public string Content { get; set; } = default!;
/// <summary>
/// 获取或设置评论内容附件 MediaId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Attach")]
[System.Text.Json.Serialization.JsonPropertyName("Attach")]
[System.Xml.Serialization.XmlElement("Attach", Type = typeof(string))]
public string[] MediaIdList { get; set; } = default!;
/// <summary>
/// 获取或设置评论时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("CommentTime")]
[System.Text.Json.Serialization.JsonPropertyName("CommentTime")]
[System.Xml.Serialization.XmlElement("CommentTime")]
public long CreateTimestamp { get; set; }
}
@ -155,60 +191,80 @@
/// <summary>
/// 获取或设置审批申请状态变化类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("StatuChangeEvent")]
[System.Text.Json.Serialization.JsonPropertyName("StatuChangeEvent")]
[System.Xml.Serialization.XmlElement("StatuChangeEvent")]
public int StatusChangeEvent { get; set; }
/// <summary>
/// 获取或设置审批单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("SpNo")]
[System.Text.Json.Serialization.JsonPropertyName("SpNo")]
[System.Xml.Serialization.XmlElement("SpNo")]
public string ApprovalNumber { get; set; } = default!;
/// <summary>
/// 获取或设置审批单名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("SpName")]
[System.Text.Json.Serialization.JsonPropertyName("SpName")]
[System.Xml.Serialization.XmlElement("SpName")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置审批单状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("SpStatus")]
[System.Text.Json.Serialization.JsonPropertyName("SpStatus")]
[System.Xml.Serialization.XmlElement("SpStatus")]
public int Status { get; set; }
/// <summary>
/// 获取或设置审批模板 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("TemplateId")]
[System.Text.Json.Serialization.JsonPropertyName("TemplateId")]
[System.Xml.Serialization.XmlElement("TemplateId")]
public string TemplateId { get; set; } = default!;
/// <summary>
/// 获取或设置申请人信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("Applyer")]
[System.Text.Json.Serialization.JsonPropertyName("Applyer")]
[System.Xml.Serialization.XmlElement("Applyer")]
public Types.Applicant Applicant { get; set; } = default!;
/// <summary>
/// 获取或设置申请时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApplyTime")]
[System.Text.Json.Serialization.JsonPropertyName("ApplyTime")]
[System.Xml.Serialization.XmlElement("ApplyTime")]
public long ApplyTimestamp { get; set; }
/// <summary>
/// 获取或设置抄送人列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Notifyer")]
[System.Text.Json.Serialization.JsonPropertyName("Notifyer")]
[System.Xml.Serialization.XmlElement("Notifyer", Type = typeof(Types.Notifier))]
public Types.Notifier[]? NotifyerList { get; set; }
/// <summary>
/// 获取或设置审批流程列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("SpRecord")]
[System.Text.Json.Serialization.JsonPropertyName("SpRecord")]
[System.Xml.Serialization.XmlElement("SpRecord", Type = typeof(Types.Record))]
public Types.Record[] RecordList { get; set; } = default!;
/// <summary>
/// 获取或设置评论列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Comments")]
[System.Text.Json.Serialization.JsonPropertyName("Comments")]
[System.Xml.Serialization.XmlElement("Comments", Type = typeof(Types.Comment))]
public Types.Comment[] CommentList { get; set; } = default!;
}
@ -217,12 +273,16 @@
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置审批单信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ApprovalInfo")]
[System.Text.Json.Serialization.JsonPropertyName("ApprovalInfo")]
[System.Xml.Serialization.XmlElement("ApprovalInfo")]
public Types.Approval Approval { get; set; } = default!;
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.batch_job_result 事件的数据。</para>
@ -11,7 +11,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95797 </para>
/// </summary>
public class BatchJobResultEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class BatchJobResultEvent : WechatWorkEvent
{
public static class Types
{
@ -20,24 +20,32 @@
/// <summary>
/// 获取或设置任务 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("JobId")]
[System.Text.Json.Serialization.JsonPropertyName("JobId")]
[System.Xml.Serialization.XmlElement("JobId")]
public string JobId { get; set; } = default!;
/// <summary>
/// 获取或设置任务类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("JobType")]
[System.Text.Json.Serialization.JsonPropertyName("JobType")]
[System.Xml.Serialization.XmlElement("JobType")]
public string Type { get; set; } = default!;
/// <summary>
/// 获取或设置错误码。
/// </summary>
[Newtonsoft.Json.JsonProperty("ErrCode")]
[System.Text.Json.Serialization.JsonPropertyName("ErrCode")]
[System.Xml.Serialization.XmlElement("ErrCode")]
public int ErrorCode { get; set; }
/// <summary>
/// 获取或设置错误信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ErrMsg")]
[System.Text.Json.Serialization.JsonPropertyName("ErrMsg")]
[System.Xml.Serialization.XmlElement("ErrMsg", IsNullable = true)]
public string? ErrorMessage { get; set; }
}
@ -46,6 +54,8 @@
/// <summary>
/// 获取或设置异步任务信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("BatchJob")]
[System.Text.Json.Serialization.JsonPropertyName("BatchJob")]
[System.Xml.Serialization.XmlElement("BatchJob")]
public Types.BatchJob BatchJob { get; set; } = default!;
}

View File

@ -1,10 +1,10 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.change_chain 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95796 </para>
/// </summary>
public class ChangeChainEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeChainEvent : WechatWorkEvent
{
public static class Types
{
@ -13,6 +13,8 @@
/// <summary>
/// 获取或设置分组 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("GroupId")]
[System.Text.Json.Serialization.JsonPropertyName("GroupId")]
[System.Xml.Serialization.XmlElement("GroupId", Type = typeof(int))]
public int[] Items { get; set; } = default!;
}
@ -22,6 +24,8 @@
/// <summary>
/// 获取或设置企业 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("CorpId")]
[System.Text.Json.Serialization.JsonPropertyName("CorpId")]
[System.Xml.Serialization.XmlElement("CorpId", Type = typeof(string))]
public string[] Items { get; set; } = default!;
}
@ -30,24 +34,32 @@
/// <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("ChainId")]
[System.Text.Json.Serialization.JsonPropertyName("ChainId")]
[System.Xml.Serialization.XmlElement("ChainId")]
public string ChainId { get; set; } = default!;
/// <summary>
/// 获取或设置分组 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("GroupIds")]
[System.Text.Json.Serialization.JsonPropertyName("GroupIds")]
[System.Xml.Serialization.XmlElement("GroupIds", IsNullable = true)]
public Types.GroupIdList? GroupIdList { get; set; }
/// <summary>
/// 获取或设置企业 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("CorpIds")]
[System.Text.Json.Serialization.JsonPropertyName("CorpIds")]
[System.Xml.Serialization.XmlElement("CorpIds", IsNullable = true)]
public Types.CorpIdList? CorpIdList { get; set; }
}

View File

@ -1,4 +1,4 @@
using System;
using System;
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
@ -20,7 +20,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90798 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class ChangeContactEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeContactEvent : WechatWorkEvent
{
public static class Types
{
@ -33,24 +33,32 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置属性类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("Type")]
[System.Text.Json.Serialization.JsonPropertyName("Type")]
[System.Xml.Serialization.XmlElement("Type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置属性名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("Name")]
[System.Text.Json.Serialization.JsonPropertyName("Name")]
[System.Xml.Serialization.XmlElement("Name")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置文本属性值。
/// </summary>
[Newtonsoft.Json.JsonProperty("Text")]
[System.Text.Json.Serialization.JsonPropertyName("Text")]
[System.Xml.Serialization.XmlElement("Text", IsNullable = true)]
public TextAttribute? Text { get; set; }
/// <summary>
/// 获取或设置网页属性值。
/// </summary>
[Newtonsoft.Json.JsonProperty("Web")]
[System.Text.Json.Serialization.JsonPropertyName("Web")]
[System.Xml.Serialization.XmlElement("Web", IsNullable = true)]
public WebAttribute? Web { get; set; }
}
@ -60,6 +68,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置文本内容。
/// </summary>
[Newtonsoft.Json.JsonProperty("Value")]
[System.Text.Json.Serialization.JsonPropertyName("Value")]
[System.Xml.Serialization.XmlElement("Value")]
public string Value { get; set; } = default!;
}
@ -69,12 +79,16 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置网页标题。
/// </summary>
[Newtonsoft.Json.JsonProperty("Title")]
[System.Text.Json.Serialization.JsonPropertyName("Title")]
[System.Xml.Serialization.XmlElement("Title")]
public string Title { get; set; } = default!;
/// <summary>
/// 获取或设置网页 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("Url")]
[System.Text.Json.Serialization.JsonPropertyName("Url")]
[System.Xml.Serialization.XmlElement("Url")]
public string Url { get; set; } = default!;
}
@ -83,6 +97,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置自定义字段列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Item")]
[System.Text.Json.Serialization.JsonPropertyName("Item")]
[System.Xml.Serialization.XmlElement("Item", Type = typeof(Types.Attribute))]
public Types.Attribute[] AttributeList { get; set; } = default!;
}
@ -91,36 +107,48 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
public string? SuiteId { get; set; }
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置变更类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("ChangeType")]
[System.Text.Json.Serialization.JsonPropertyName("ChangeType")]
[System.Xml.Serialization.XmlElement("ChangeType")]
public string ChangeType { get; set; } = default!;
/// <summary>
/// 获取或设置成员、部门或标签名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("Name")]
[System.Text.Json.Serialization.JsonPropertyName("Name")]
[System.Xml.Serialization.XmlElement("Name")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置用户成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserID")]
[System.Text.Json.Serialization.JsonPropertyName("UserID")]
[System.Xml.Serialization.XmlElement("UserID", IsNullable = true)]
public string? UserId { get; set; }
/// <summary>
/// 获取或设置新的用户成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("NewUserID")]
[System.Text.Json.Serialization.JsonPropertyName("NewUserID")]
[System.Xml.Serialization.XmlElement("NewUserID", IsNullable = true)]
public string? NewUserId { get; set; }
@ -128,12 +156,16 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户成员别名。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Alias")]
[System.Text.Json.Serialization.JsonPropertyName("Alias")]
[System.Xml.Serialization.XmlElement("Alias", IsNullable = true)]
public string? UserAlias { get; set; }
/// <summary>
/// 获取或设置用户所在部门 ID以逗号分割
/// </summary>
[Newtonsoft.Json.JsonProperty("Department")]
[System.Text.Json.Serialization.JsonPropertyName("Department")]
[System.Xml.Serialization.XmlElement("Department", IsNullable = true)]
public string? UserDepartmentIds { get; set; }
@ -141,6 +173,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户的部门领导状态(以逗号分割)。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("IsLeaderInDept")]
[System.Text.Json.Serialization.JsonPropertyName("IsLeaderInDept")]
[System.Xml.Serialization.XmlElement("IsLeaderInDept", IsNullable = true)]
public string? UserDepartmentLeaderStatus { get; set; }
@ -148,6 +182,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户的主部门 ID。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("MainDepartment")]
[System.Text.Json.Serialization.JsonPropertyName("MainDepartment")]
[System.Xml.Serialization.XmlElement("MainDepartment", IsNullable = true)]
public long? UserMainDepartmentId { get; set; }
@ -155,6 +191,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户邮箱。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Email")]
[System.Text.Json.Serialization.JsonPropertyName("Email")]
[System.Xml.Serialization.XmlElement("Email", IsNullable = true)]
public string? UserEmail { get; set; }
@ -162,6 +200,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户企业邮箱。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("BizMail")]
[System.Text.Json.Serialization.JsonPropertyName("BizMail")]
[System.Xml.Serialization.XmlElement("BizMail", IsNullable = true)]
public string? UserBusinessEmail { get; set; }
@ -169,6 +209,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户手机号码。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Mobile")]
[System.Text.Json.Serialization.JsonPropertyName("Mobile")]
[System.Xml.Serialization.XmlElement("Mobile", IsNullable = true)]
public string? UserMobileNumber { get; set; }
@ -176,6 +218,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户座机号码。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Telephone")]
[System.Text.Json.Serialization.JsonPropertyName("Telephone")]
[System.Xml.Serialization.XmlElement("Telephone", IsNullable = true)]
public string? UserTeleNumber { get; set; }
@ -183,6 +227,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户性别。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Gender")]
[System.Text.Json.Serialization.JsonPropertyName("Gender")]
[System.Xml.Serialization.XmlElement("Gender", IsNullable = true)]
public int? UserGender { get; set; }
@ -190,6 +236,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户地址。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Address")]
[System.Text.Json.Serialization.JsonPropertyName("Address")]
[System.Xml.Serialization.XmlElement("Address", IsNullable = true)]
public string? UserAddress { get; set; }
@ -197,6 +245,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户职务。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Position")]
[System.Text.Json.Serialization.JsonPropertyName("Position")]
[System.Xml.Serialization.XmlElement("Position", IsNullable = true)]
public string? UserPosition { get; set; }
@ -204,6 +254,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户头像 URL。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Avatar")]
[System.Text.Json.Serialization.JsonPropertyName("Avatar")]
[System.Xml.Serialization.XmlElement("Avatar", IsNullable = true)]
public string? UserAvatarUrl { get; set; }
@ -211,6 +263,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户激活状态。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Status")]
[System.Text.Json.Serialization.JsonPropertyName("Status")]
[System.Xml.Serialization.XmlElement("Status", IsNullable = true)]
public int? UserStatus { get; set; }
@ -218,18 +272,24 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置用户自定义字段信息。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("ExtAttr")]
[System.Text.Json.Serialization.JsonPropertyName("ExtAttr")]
[System.Xml.Serialization.XmlElement("ExtAttr", IsNullable = true)]
public Types.ExtendedAttribute? UserExtendedAttribute { get; set; }
/// <summary>
/// 获取或设置部门 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("Id")]
[System.Text.Json.Serialization.JsonPropertyName("Id")]
[System.Xml.Serialization.XmlElement("Id", IsNullable = true)]
public long? DepartmentId { get; set; }
/// <summary>
/// 获取或设置上级部门 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("ParentId")]
[System.Text.Json.Serialization.JsonPropertyName("ParentId")]
[System.Xml.Serialization.XmlElement("ParentId", IsNullable = true)]
public string? DepartmentParentId { get; set; }
@ -237,36 +297,48 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// 获取或设置部门次序值。
/// </summary>
[Obsolete("相关接口或字段于 2022-08-15 下线。")]
[Newtonsoft.Json.JsonProperty("Order")]
[System.Text.Json.Serialization.JsonPropertyName("Order")]
[System.Xml.Serialization.XmlElement("Order", IsNullable = true)]
public long? DepartmentOrder { get; set; }
/// <summary>
/// 获取或设置标签 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("TagId")]
[System.Text.Json.Serialization.JsonPropertyName("TagId")]
[System.Xml.Serialization.XmlElement("TagId", IsNullable = true)]
public int? TagId { get; set; }
/// <summary>
/// 获取或设置标签中新增的成员账号(以逗号分隔)。
/// </summary>
[Newtonsoft.Json.JsonProperty("AddUserItems")]
[System.Text.Json.Serialization.JsonPropertyName("AddUserItems")]
[System.Xml.Serialization.XmlElement("AddUserItems", IsNullable = true)]
public string? TagAddedUserIds { get; set; }
/// <summary>
/// 获取或设置标签中删除的成员账号(以逗号分隔)。
/// </summary>
[Newtonsoft.Json.JsonProperty("DelUserItems")]
[System.Text.Json.Serialization.JsonPropertyName("DelUserItems")]
[System.Xml.Serialization.XmlElement("DelUserItems", IsNullable = true)]
public string? TagRemovedUserIds { get; set; }
/// <summary>
/// 获取或设置标签中新增的部门 ID以逗号分隔
/// </summary>
[Newtonsoft.Json.JsonProperty("AddPartyItems")]
[System.Text.Json.Serialization.JsonPropertyName("AddPartyItems")]
[System.Xml.Serialization.XmlElement("AddPartyItems", IsNullable = true)]
public string? TagAddedDepartmentIds { get; set; }
/// <summary>
/// 获取或设置标签中删除的部门 ID以逗号分隔
/// </summary>
[Newtonsoft.Json.JsonProperty("DelPartyItems")]
[System.Text.Json.Serialization.JsonPropertyName("DelPartyItems")]
[System.Xml.Serialization.XmlElement("DelPartyItems", IsNullable = true)]
public string? TagRemovedDepartmentIds { get; set; }
}

View File

@ -4,41 +4,53 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>表示 EVENT.customer_acquisition 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97299 </para>
/// </summary>
public class CustomerAcquisitionEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class CustomerAcquisitionEvent : 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("LinkId")]
[System.Text.Json.Serialization.JsonPropertyName("LinkId")]
[System.Xml.Serialization.XmlElement("LinkId", IsNullable = true)]
public string? LinkId { get; set; }
/// <summary>
/// 获取或设置企业服务人员的成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserID")]
[System.Text.Json.Serialization.JsonPropertyName("UserID")]
[System.Xml.Serialization.XmlElement("UserID", IsNullable = true)]
public string? UserId { get; set; }
/// <summary>
/// 获取或设置外部联系人 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("ExternalUserID")]
[System.Text.Json.Serialization.JsonPropertyName("ExternalUserID")]
[System.Xml.Serialization.XmlElement("ExternalUserID", IsNullable = true)]
public string? ExternalUserId { get; set; }
/// <summary>
/// 获取或设置过期时间戳戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("ExpireTime")]
[System.Text.Json.Serialization.JsonPropertyName("ExpireTime")]
[System.Xml.Serialization.XmlElement("ExpireTime", IsNullable = true)]
public long? ExpireTimestamp { get; set; }
/// <summary>
/// 获取或设置过期获客额度数。
/// </summary>
[Newtonsoft.Json.JsonProperty("ExpireQuotaNum")]
[System.Text.Json.Serialization.JsonPropertyName("ExpireQuotaNum")]
[System.Xml.Serialization.XmlElement("ExpireQuotaNum", IsNullable = true)]
public int? ExpireQuota { get; set; }
}

View File

@ -1,38 +1,48 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.add_device 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90751 </para>
/// </summary>
public class AddDeviceEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class AddDeviceEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("DeviceSn")]
[System.Text.Json.Serialization.JsonPropertyName("DeviceSn")]
[System.Xml.Serialization.XmlElement("DeviceSn")]
public string DeviceSerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置设备型号 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("ModelId")]
[System.Text.Json.Serialization.JsonPropertyName("ModelId")]
[System.Xml.Serialization.XmlElement("ModelId")]
public string ModelId { get; set; } = default!;
/// <summary>
/// 获取或设置设备备注名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("RemarkName")]
[System.Text.Json.Serialization.JsonPropertyName("RemarkName")]
[System.Xml.Serialization.XmlElement("RemarkName")]
public string? RemarkName { get; set; }
}

View File

@ -1,32 +1,40 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.connect_info 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90751 </para>
/// </summary>
public class ConnectInfoEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ConnectInfoEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("DeviceSn")]
[System.Text.Json.Serialization.JsonPropertyName("DeviceSn")]
[System.Xml.Serialization.XmlElement("DeviceSn")]
public string DeviceSerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置设备成功连接企业微信后台时的时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("ConnectTime")]
[System.Text.Json.Serialization.JsonPropertyName("ConnectTime")]
[System.Xml.Serialization.XmlElement("ConnectTime")]
public long ConnectTimestamp { get; set; }
}

View File

@ -1,26 +1,32 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.del_device 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90751 </para>
/// </summary>
public class DeleteDeviceEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class DeleteDeviceEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("DeviceSn")]
[System.Text.Json.Serialization.JsonPropertyName("DeviceSn")]
[System.Xml.Serialization.XmlElement("DeviceSn")]
public string DeviceSerialNumber { get; set; } = default!;
}

View File

@ -1,26 +1,32 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.device_feature_change 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90751 </para>
/// </summary>
public class DeviceFeatureChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class DeviceFeatureChangeEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("DeviceSn")]
[System.Text.Json.Serialization.JsonPropertyName("DeviceSn")]
[System.Xml.Serialization.XmlElement("DeviceSn")]
public string DeviceSerialNumber { get; set; } = default!;
}

View File

@ -1,38 +1,48 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.disconnect_info 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90751 </para>
/// </summary>
public class DisconnectInfoEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class DisconnectInfoEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("DeviceSn")]
[System.Text.Json.Serialization.JsonPropertyName("DeviceSn")]
[System.Xml.Serialization.XmlElement("DeviceSn")]
public string DeviceSerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置设备与企业微信后台网络连接断开时的时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("DisconnectTime")]
[System.Text.Json.Serialization.JsonPropertyName("DisconnectTime")]
[System.Xml.Serialization.XmlElement("DisconnectTime")]
public long DiconnectTimestamp { get; set; }
/// <summary>
/// 获取或设置设备连接断开原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("Reason")]
[System.Text.Json.Serialization.JsonPropertyName("Reason")]
[System.Xml.Serialization.XmlElement("Reason")]
public string DisconnectReason { get; set; } = default!;
}

View File

@ -1,38 +1,48 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.error_report 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90751 </para>
/// </summary>
public class ErrorReportEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ErrorReportEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("DeviceSn")]
[System.Text.Json.Serialization.JsonPropertyName("DeviceSn")]
[System.Xml.Serialization.XmlElement("DeviceSn")]
public string DeviceSerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置设备上报的错误码。
/// </summary>
[Newtonsoft.Json.JsonProperty("ErrCode")]
[System.Text.Json.Serialization.JsonPropertyName("ErrCode")]
[System.Xml.Serialization.XmlElement("ErrCode")]
public int ErrorCode { get; set; }
/// <summary>
/// 获取或设置设备上报的错误信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ErrMsg")]
[System.Text.Json.Serialization.JsonPropertyName("ErrMsg")]
[System.Xml.Serialization.XmlElement("ErrMsg")]
public string? ErrorMessage { get; set; }
}

View File

@ -1,32 +1,40 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.fetch_log_finish 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90751 </para>
/// </summary>
public class FetchLogFinishEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class FetchLogFinishEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("DeviceSn")]
[System.Text.Json.Serialization.JsonPropertyName("DeviceSn")]
[System.Xml.Serialization.XmlElement("DeviceSn")]
public string DeviceSerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置日志文件的 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("MediaId")]
[System.Text.Json.Serialization.JsonPropertyName("MediaId")]
[System.Xml.Serialization.XmlElement("MediaId")]
public string MediaId { get; set; } = default!;
}

View File

@ -1,32 +1,40 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.remark_device_name 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90751 </para>
/// </summary>
public class RemarkDeviceNameEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class RemarkDeviceNameEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("DeviceSn")]
[System.Text.Json.Serialization.JsonPropertyName("DeviceSn")]
[System.Xml.Serialization.XmlElement("DeviceSn")]
public string DeviceSerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置设备备注名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("RemarkName")]
[System.Text.Json.Serialization.JsonPropertyName("RemarkName")]
[System.Xml.Serialization.XmlElement("RemarkName")]
public string RemarkName { get; set; } = default!;
}

View File

@ -1,26 +1,32 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.device_data_auth_change 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96103 </para>
/// </summary>
public class DeviceDataAuthChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class DeviceDataAuthChangeEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
}

View File

@ -1,20 +1,24 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.app_email_change 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97506 </para>
/// </summary>
public class AppEmailChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class AppEmailChangeEvent : 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>
/// 获取或设置新邮件数。
/// </summary>
[Newtonsoft.Json.JsonProperty("Amount")]
[System.Text.Json.Serialization.JsonPropertyName("Amount")]
[System.Xml.Serialization.XmlElement("Amount")]
public int MailCount { get; set; }
}

View File

@ -5,7 +5,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92130 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92277 </para>
/// </summary>
public class ChangeExternalChatEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeExternalChatEvent : WechatWorkEvent
{
public static class Types
{
@ -14,6 +14,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置成员账号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Item")]
[System.Text.Json.Serialization.JsonPropertyName("Item")]
[System.Xml.Serialization.XmlElement("Item")]
public string[] Items { get; set; } = default!;
}
@ -22,66 +24,88 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
public string? SuiteId { get; set; }
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <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("ChatId")]
[System.Text.Json.Serialization.JsonPropertyName("ChatId")]
[System.Xml.Serialization.XmlElement("ChatId", IsNullable = true)]
public string? GroupChatId { get; set; }
/// <summary>
/// 获取或设置客户群变更详情。
/// </summary>
[Newtonsoft.Json.JsonProperty("UpdateDetail")]
[System.Text.Json.Serialization.JsonPropertyName("UpdateDetail")]
[System.Xml.Serialization.XmlElement("UpdateDetail", IsNullable = true)]
public string? UpdateDetail { get; set; }
/// <summary>
/// 获取或设置客户群入群场景值。
/// </summary>
[Newtonsoft.Json.JsonProperty("JoinScene")]
[System.Text.Json.Serialization.JsonPropertyName("JoinScene")]
[System.Xml.Serialization.XmlElement("JoinScene", IsNullable = true)]
public int? JoinScene { get; set; }
/// <summary>
/// 获取或设置客户群退群场景值。
/// </summary>
[Newtonsoft.Json.JsonProperty("QuitScene")]
[System.Text.Json.Serialization.JsonPropertyName("QuitScene")]
[System.Xml.Serialization.XmlElement("QuitScene", IsNullable = true)]
public int? QuitScene { get; set; }
/// <summary>
/// 获取或设置成员变更数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("MemChangeCnt")]
[System.Text.Json.Serialization.JsonPropertyName("MemChangeCnt")]
[System.Xml.Serialization.XmlElement("MemChangeCnt", IsNullable = true)]
public int? MemberChangedCount { get; set; }
/// <summary>
/// 获取或设置成员变更列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("MemChangeList")]
[System.Text.Json.Serialization.JsonPropertyName("MemChangeList")]
[System.Xml.Serialization.XmlElement("MemChangeList", IsNullable = true)]
public Types.MemberChangedList? MemberChangedList { get; set; }
/// <summary>
/// 获取或设置变更前的群成员版本号。
/// </summary>
[Newtonsoft.Json.JsonProperty("LastMemVer")]
[System.Text.Json.Serialization.JsonPropertyName("LastMemVer")]
[System.Xml.Serialization.XmlElement("LastMemVer", IsNullable = true)]
public string? LastMemberVersion { get; set; }
/// <summary>
/// 获取或设置变更后的群成员版本号。
/// </summary>
[Newtonsoft.Json.JsonProperty("CurMemVer")]
[System.Text.Json.Serialization.JsonPropertyName("CurMemVer")]
[System.Xml.Serialization.XmlElement("CurMemVer", IsNullable = true)]
public string? CurrentMemberVersion { get; set; }
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.change_external_contact 或 INFO.change_external_contact 事件的数据。</para>
@ -6,59 +6,77 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92005 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92277 </para>
/// </summary>
public class ChangeExternalContactEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeExternalContactEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
public string? SuiteId { get; set; }
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <summary>
/// 获取或设置变更类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("ChangeType")]
[System.Text.Json.Serialization.JsonPropertyName("ChangeType")]
[System.Xml.Serialization.XmlElement("ChangeType")]
public string ChangeType { get; set; } = default!;
/// <summary>
/// 获取或设置用户成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserID")]
[System.Text.Json.Serialization.JsonPropertyName("UserID")]
[System.Xml.Serialization.XmlElement("UserID", IsNullable = true)]
public string? UserId { get; set; }
/// <summary>
/// 获取或设置外部联系人账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("ExternalUserID")]
[System.Text.Json.Serialization.JsonPropertyName("ExternalUserID")]
[System.Xml.Serialization.XmlElement("ExternalUserID", IsNullable = true)]
public string? ExternalUserId { get; set; }
/// <summary>
/// 获取或设置自定义渠道参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("State")]
[System.Text.Json.Serialization.JsonPropertyName("State")]
[System.Xml.Serialization.XmlElement("State", IsNullable = true)]
public string? State { get; set; }
/// <summary>
/// 获取或设置欢迎语 Code。
/// </summary>
[Newtonsoft.Json.JsonProperty("WelcomeCode")]
[System.Text.Json.Serialization.JsonPropertyName("WelcomeCode")]
[System.Xml.Serialization.XmlElement("WelcomeCode", IsNullable = true)]
public string? WelcomeCode { get; set; }
/// <summary>
/// 获取或设置接替失败原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("FailReason")]
[System.Text.Json.Serialization.JsonPropertyName("FailReason")]
[System.Xml.Serialization.XmlElement("FailReason", IsNullable = true)]
public string? TransferFailReason { get; set; }
/// <summary>
/// 获取或设置删除客户的操作来源。
/// </summary>
[Newtonsoft.Json.JsonProperty("Source")]
[System.Text.Json.Serialization.JsonPropertyName("Source")]
[System.Xml.Serialization.XmlElement("Source", IsNullable = true)]
public string? Source { get; set; }
}

View File

@ -1,45 +1,57 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.change_external_tag 或 INFO.change_external_tag 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92130 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92277 </para>
/// </summary>
public class ChangeExternalTagEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeExternalTagEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
public string? SuiteId { get; set; }
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <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("TagType")]
[System.Text.Json.Serialization.JsonPropertyName("TagType")]
[System.Xml.Serialization.XmlElement("TagType", IsNullable = true)]
public string? IdType { get; set; }
/// <summary>
/// 获取或设置企业标签或标签分组 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("Id")]
[System.Text.Json.Serialization.JsonPropertyName("Id")]
[System.Xml.Serialization.XmlElement("Id", IsNullable = true)]
public string? TagOrGroupId { get; set; }
/// <summary>
/// 获取或设置规则组 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("StrategyId")]
[System.Text.Json.Serialization.JsonPropertyName("StrategyId")]
[System.Xml.Serialization.XmlElement("StrategyId", IsNullable = true)]
public string? StrategyId { get; set; }
}

View File

@ -4,17 +4,21 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>表示 EVENT.kf_account_auth_change 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97712 </para>
/// </summary>
public class KfAccountAuthChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class KfAccountAuthChangeEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置新增授权的客服账号 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthAddOpenKfId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthAddOpenKfId")]
[System.Xml.Serialization.XmlElement("AuthAddOpenKfId", Type = typeof(string), IsNullable = true)]
public string[]? AuthAddedOpenKfId { get; set; }
/// <summary>
/// 获取或设置取消授权的客服账号 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthDelOpenKfId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthDelOpenKfId")]
[System.Xml.Serialization.XmlElement("AuthDelOpenKfId", Type = typeof(string), IsNullable = true)]
public string[]? AuthDeletedOpenKfId { get; set; }
}

View File

@ -5,17 +5,21 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>REF: https://developer.work.weixin.qq.com/document/path/94670 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/94699 </para>
/// </summary>
public class KfMessageEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class KfMessageEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置调用拉取消息的 Token。
/// </summary>
[Newtonsoft.Json.JsonProperty("Token")]
[System.Text.Json.Serialization.JsonPropertyName("Token")]
[System.Xml.Serialization.XmlElement("Token")]
public string Token { get; set; } = default!;
/// <summary>
/// 获取或设置客服账号 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("OpenKfId")]
[System.Text.Json.Serialization.JsonPropertyName("OpenKfId")]
[System.Xml.Serialization.XmlElement("OpenKfId")]
public string OpenKfId { get; set; } = default!;
}

View File

@ -1,10 +1,10 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.auto_activate 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95994 </para>
/// </summary>
public class LicenseAutoActivateEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class LicenseAutoActivateEvent : WechatWorkEvent
{
public static class Types
{
@ -13,36 +13,48 @@
/// <summary>
/// 获取或设置激活码。
/// </summary>
[Newtonsoft.Json.JsonProperty("ActiveCode")]
[System.Text.Json.Serialization.JsonPropertyName("ActiveCode")]
[System.Xml.Serialization.XmlElement("ActiveCode")]
public string ActiveCode { get; set; } = default!;
/// <summary>
/// 获取或设置类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("Type")]
[System.Text.Json.Serialization.JsonPropertyName("Type")]
[System.Xml.Serialization.XmlElement("Type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置许可到期时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("ExpireTime")]
[System.Text.Json.Serialization.JsonPropertyName("ExpireTime")]
[System.Xml.Serialization.XmlElement("ExpireTime")]
public long ExpireTimestamp { get; set; }
/// <summary>
/// 获取或设置成员 UserId。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserId")]
[System.Text.Json.Serialization.JsonPropertyName("UserId")]
[System.Xml.Serialization.XmlElement("UserId")]
public string UserId { get; set; } = default!;
/// <summary>
/// 获取或设置之前的许可状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("PreviousStatus")]
[System.Text.Json.Serialization.JsonPropertyName("PreviousStatus")]
[System.Xml.Serialization.XmlElement("PreviousStatus", IsNullable = true)]
public int? PreviousStatus { get; set; }
/// <summary>
/// 获取或设置之前的激活码。
/// </summary>
[Newtonsoft.Json.JsonProperty("PreviousActiveCode")]
[System.Text.Json.Serialization.JsonPropertyName("PreviousActiveCode")]
[System.Xml.Serialization.XmlElement("PreviousActiveCode", IsNullable = true)]
public string? PreviousActiveCode { get; set; }
}
@ -51,24 +63,32 @@
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置许可自动激活场景值。
/// </summary>
[Newtonsoft.Json.JsonProperty("Scene")]
[System.Text.Json.Serialization.JsonPropertyName("Scene")]
[System.Xml.Serialization.XmlElement("Scene")]
public int Scene { get; set; }
/// <summary>
/// 获取或设置激活的许可账号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("AccountList")]
[System.Text.Json.Serialization.JsonPropertyName("AccountList")]
[System.Xml.Serialization.XmlElement("AccountList", Type = typeof(Types.Account))]
public Types.Account[] AccountList { get; set; } = default!;
}

View File

@ -1,32 +1,40 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.license_pay_success 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95716 </para>
/// </summary>
public class LicensePaySuccessEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class LicensePaySuccessEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置订单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("OrderId")]
[System.Text.Json.Serialization.JsonPropertyName("OrderId")]
[System.Xml.Serialization.XmlElement("OrderId")]
public string OrderId { get; set; } = default!;
/// <summary>
/// 获取或设置服务商内下单用户 UserId。
/// </summary>
[Newtonsoft.Json.JsonProperty("BuyerUserId")]
[System.Text.Json.Serialization.JsonPropertyName("BuyerUserId")]
[System.Xml.Serialization.XmlElement("BuyerUserId")]
public string BuyerUserId { get; set; } = default!;
}

View File

@ -1,32 +1,40 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.license_refund 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95805 </para>
/// </summary>
public class LicenseRefundEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class LicenseRefundEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置订单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("OrderId")]
[System.Text.Json.Serialization.JsonPropertyName("OrderId")]
[System.Xml.Serialization.XmlElement("OrderId")]
public string OrderId { get; set; } = default!;
/// <summary>
/// 获取或设置订单状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("OrderStatus")]
[System.Text.Json.Serialization.JsonPropertyName("OrderStatus")]
[System.Xml.Serialization.XmlElement("OrderStatus")]
public int OrderStatus { get; set; }
}

View File

@ -1,14 +1,16 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.unlicensed_notify 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95716 </para>
/// </summary>
public class UnlicensedNotifyEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class UnlicensedNotifyEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
}

View File

@ -1,27 +1,33 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.living_status_change 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/94145 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/94308 </para>
/// </summary>
public class LivingStatusChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class LivingStatusChangeEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置直播 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("LivingId")]
[System.Text.Json.Serialization.JsonPropertyName("LivingId")]
[System.Xml.Serialization.XmlElement("LivingId")]
public string LivingId { get; set; } = default!;
/// <summary>
/// 获取或设置直播状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("Status")]
[System.Text.Json.Serialization.JsonPropertyName("Status")]
[System.Xml.Serialization.XmlElement("Status")]
public int Status { get; set; }
}

View File

@ -1,14 +1,16 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.upload_media_job_finish 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96219 </para>
/// </summary>
public class UploadMediaJobFinishEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class UploadMediaJobFinishEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置任务 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("JobId")]
[System.Text.Json.Serialization.JsonPropertyName("JobId")]
[System.Xml.Serialization.XmlElement("JobId")]
public string JobId { get; set; } = default!;
}

View File

@ -32,7 +32,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98782 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98783 </para>
/// </summary>
public class MeetingChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class MeetingChangeEvent : WechatWorkEvent
{
public static class Types
{
@ -41,18 +41,24 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserId")]
[System.Text.Json.Serialization.JsonPropertyName("UserId")]
[System.Xml.Serialization.XmlElement("UserId", IsNullable = true)]
public string? UserId { get; set; }
/// <summary>
/// 获取或设置会中临时 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("TmpOpenId")]
[System.Text.Json.Serialization.JsonPropertyName("TmpOpenId")]
[System.Xml.Serialization.XmlElement("TmpOpenId", IsNullable = true)]
public string? TempOpenId { get; set; }
/// <summary>
/// 获取或设置成员角色。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserRole")]
[System.Text.Json.Serialization.JsonPropertyName("UserRole")]
[System.Xml.Serialization.XmlElement("UserRole", IsNullable = true)]
public int? Role { get; set; }
}
@ -62,24 +68,32 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置暖场图片 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("WarmUpPicture")]
[System.Text.Json.Serialization.JsonPropertyName("WarmUpPicture")]
[System.Xml.Serialization.XmlElement("WarmUpPicture", IsNullable = true)]
public string? WarmUpPictureUrl { get; set; }
/// <summary>
/// 获取或设置暖场视频 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("WarmUpVideo")]
[System.Text.Json.Serialization.JsonPropertyName("WarmUpVideo")]
[System.Xml.Serialization.XmlElement("WarmUpVideo", IsNullable = true)]
public string? WarmUpVideoUrl { get; set; }
/// <summary>
/// 获取或设置上传结果。
/// </summary>
[Newtonsoft.Json.JsonProperty("UploadStatus")]
[System.Text.Json.Serialization.JsonPropertyName("UploadStatus")]
[System.Xml.Serialization.XmlElement("UploadStatus")]
public int UploadStatus { get; set; }
/// <summary>
/// 获取或设置错误描述。
/// </summary>
[Newtonsoft.Json.JsonProperty("ErrorMsg")]
[System.Text.Json.Serialization.JsonPropertyName("ErrorMsg")]
[System.Xml.Serialization.XmlElement("ErrorMsg", IsNullable = true)]
public string? ErrorMessage { get; set; }
}
@ -89,24 +103,32 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置素材类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("MediumType")]
[System.Text.Json.Serialization.JsonPropertyName("MediumType")]
[System.Xml.Serialization.XmlElement("MediumType")]
public int MediumType { get; set; }
/// <summary>
/// 获取或设置素材 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("MediumUrl")]
[System.Text.Json.Serialization.JsonPropertyName("MediumUrl")]
[System.Xml.Serialization.XmlElement("MediumUrl")]
public string MediumUrl { get; set; } = default!;
/// <summary>
/// 获取或设置上传结果。
/// </summary>
[Newtonsoft.Json.JsonProperty("UploadStatus")]
[System.Text.Json.Serialization.JsonPropertyName("UploadStatus")]
[System.Xml.Serialization.XmlElement("UploadStatus")]
public int UploadStatus { get; set; }
/// <summary>
/// 获取或设置错误描述。
/// </summary>
[Newtonsoft.Json.JsonProperty("ErrorMsg")]
[System.Text.Json.Serialization.JsonPropertyName("ErrorMsg")]
[System.Xml.Serialization.XmlElement("ErrorMsg", IsNullable = true)]
public string? ErrorMessage { get; set; }
}
@ -116,12 +138,16 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置信令协议。
/// </summary>
[Newtonsoft.Json.JsonProperty("Protocol")]
[System.Text.Json.Serialization.JsonPropertyName("Protocol")]
[System.Xml.Serialization.XmlElement("Protocol")]
public int Protocol { get; set; }
/// <summary>
/// 获取或设置信令。
/// </summary>
[Newtonsoft.Json.JsonProperty("DialString")]
[System.Text.Json.Serialization.JsonPropertyName("DialString")]
[System.Xml.Serialization.XmlElement("DialString")]
public string DialogString { get; set; } = default!;
}
@ -130,60 +156,80 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <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("MeetingId")]
[System.Text.Json.Serialization.JsonPropertyName("MeetingId")]
[System.Xml.Serialization.XmlElement("MeetingId")]
public string MeetingId { get; set; } = default!;
/// <summary>
/// 获取或设置会议室 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("MeetingRoomId")]
[System.Text.Json.Serialization.JsonPropertyName("MeetingRoomId")]
[System.Xml.Serialization.XmlElement("MeetingRoomId", IsNullable = true)]
public string? MeetingRoomId { get; set; }
/// <summary>
/// 获取或设置操作者会中临时 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("FromUserTmpOpenId")]
[System.Text.Json.Serialization.JsonPropertyName("FromUserTmpOpenId")]
[System.Xml.Serialization.XmlElement("FromUserTmpOpenId", IsNullable = true)]
public string? FromUserTempOpenId { get; set; }
/// <summary>
/// 获取或设置被操作者信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("OperatedUser")]
[System.Text.Json.Serialization.JsonPropertyName("OperatedUser")]
[System.Xml.Serialization.XmlElement("OperatedUser", IsNullable = true)]
public Types.OperatedUser? OperatedUser { get; set; }
/// <summary>
/// 获取或设置暖场信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("WarmUpInfo")]
[System.Text.Json.Serialization.JsonPropertyName("WarmUpInfo")]
[System.Xml.Serialization.XmlElement("WarmUpInfo", IsNullable = true)]
public Types.WarmUpInfo? WarmUpInfo { get; set; }
/// <summary>
/// 获取或设置上传信息列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("UploadInfo")]
[System.Text.Json.Serialization.JsonPropertyName("UploadInfo")]
[System.Xml.Serialization.XmlElement("UploadInfo", Type = typeof(Types.UploadInfo), IsNullable = true)]
public Types.UploadInfo[]? UploadInfoList { get; set; }
/// <summary>
/// 获取或设置报名 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("EnrollId")]
[System.Text.Json.Serialization.JsonPropertyName("EnrollId")]
[System.Xml.Serialization.XmlElement("EnrollId", IsNullable = true)]
public string? EnrollId { get; set; }
/// <summary>
/// 获取或设置 Rooms MRA 信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("MraAddress")]
[System.Text.Json.Serialization.JsonPropertyName("MraAddress")]
[System.Xml.Serialization.XmlElement("MraAddress", IsNullable = true)]
public Types.MRAInfo? RoomsMRAInfo { get; set; }
/// <summary>
/// 获取或设置 Rooms 应答结果。
/// </summary>
[Newtonsoft.Json.JsonProperty("RoomResponseStatus")]
[System.Text.Json.Serialization.JsonPropertyName("RoomResponseStatus")]
[System.Xml.Serialization.XmlElement("RoomResponseStatus", IsNullable = true)]
public int? RoomsResponseStatus { get; set; }
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 IMAGE 事件的数据。</para>
@ -6,29 +6,37 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90375 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90855 </para>
/// </summary>
public class ImageMessageEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ImageMessageEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置消息 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("MsgId")]
[System.Text.Json.Serialization.JsonPropertyName("MsgId")]
[System.Xml.Serialization.XmlElement("MsgId")]
public long MessageId { get; set; }
/// <summary>
/// 获取或设置图片 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("PicUrl")]
[System.Text.Json.Serialization.JsonPropertyName("PicUrl")]
[System.Xml.Serialization.XmlElement("PicUrl")]
public string PictureUrl { get; set; } = default!;
/// <summary>
/// 获取或设置图片消息 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("MediaId")]
[System.Text.Json.Serialization.JsonPropertyName("MediaId")]
[System.Xml.Serialization.XmlElement("MediaId")]
public string MediaId { get; set; } = default!;
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 LINK 事件的数据。</para>
@ -6,41 +6,53 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90375 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90855 </para>
/// </summary>
public class LinkMessageEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class LinkMessageEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置消息 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("MsgId")]
[System.Text.Json.Serialization.JsonPropertyName("MsgId")]
[System.Xml.Serialization.XmlElement("MsgId")]
public long MessageId { get; set; }
/// <summary>
/// 获取或设置标题。
/// </summary>
[Newtonsoft.Json.JsonProperty("Title")]
[System.Text.Json.Serialization.JsonPropertyName("Title")]
[System.Xml.Serialization.XmlElement("Title")]
public string Title { get; set; } = default!;
/// <summary>
/// 获取或设置描述。
/// </summary>
[Newtonsoft.Json.JsonProperty("Description")]
[System.Text.Json.Serialization.JsonPropertyName("Description")]
[System.Xml.Serialization.XmlElement("Description")]
public string Description { get; set; } = default!;
/// <summary>
/// 获取或设置跳转链接 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("Url")]
[System.Text.Json.Serialization.JsonPropertyName("Url")]
[System.Xml.Serialization.XmlElement("Url")]
public string Url { get; set; } = default!;
/// <summary>
/// 获取或设置封面图片 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("PicUrl")]
[System.Text.Json.Serialization.JsonPropertyName("PicUrl")]
[System.Xml.Serialization.XmlElement("PicUrl")]
public string PictureUrl { get; set; } = default!;
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 LOCATION 事件的数据。</para>
@ -6,47 +6,61 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90375 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90855 </para>
/// </summary>
public class LocationMessageEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class LocationMessageEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置应用类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("AppType")]
[System.Text.Json.Serialization.JsonPropertyName("AppType")]
[System.Xml.Serialization.XmlElement("AppType", IsNullable = true)]
public string? AppType { get; set; }
/// <summary>
/// 获取或设置消息 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("MsgId")]
[System.Text.Json.Serialization.JsonPropertyName("MsgId")]
[System.Xml.Serialization.XmlElement("MsgId")]
public long MessageId { get; set; }
/// <summary>
/// 获取或设置纬度坐标。
/// </summary>
[Newtonsoft.Json.JsonProperty("Location_X")]
[System.Text.Json.Serialization.JsonPropertyName("Location_X")]
[System.Xml.Serialization.XmlElement("Location_X")]
public double Latitude { get; set; }
public decimal Latitude { get; set; }
/// <summary>
/// 获取或设置经度坐标。
/// </summary>
[Newtonsoft.Json.JsonProperty("Location_Y")]
[System.Text.Json.Serialization.JsonPropertyName("Location_Y")]
[System.Xml.Serialization.XmlElement("Location_Y")]
public double Longitude { get; set; }
public decimal Longitude { get; set; }
/// <summary>
/// 获取或设置地图缩放大小。
/// </summary>
[Newtonsoft.Json.JsonProperty("Scale")]
[System.Text.Json.Serialization.JsonPropertyName("Scale")]
[System.Xml.Serialization.XmlElement("Scale")]
public double Scale { get; set; }
public decimal Scale { get; set; }
/// <summary>
/// 获取或设置地理位置信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("Label")]
[System.Text.Json.Serialization.JsonPropertyName("Label")]
[System.Xml.Serialization.XmlElement("Label")]
public string Label { get; set; } = default!;
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 TEXT 事件的数据。</para>
@ -6,23 +6,29 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90375 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90855 </para>
/// </summary>
public class TextMessageEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class TextMessageEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置消息 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("MsgId")]
[System.Text.Json.Serialization.JsonPropertyName("MsgId")]
[System.Xml.Serialization.XmlElement("MsgId")]
public long MessageId { get; set; }
/// <summary>
/// 获取或设置消息内容。
/// </summary>
[Newtonsoft.Json.JsonProperty("Content")]
[System.Text.Json.Serialization.JsonPropertyName("Content")]
[System.Xml.Serialization.XmlElement("Content")]
public string Content { get; set; } = default!;
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 VIDEO 事件的数据。</para>
@ -6,29 +6,37 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90375 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90855 </para>
/// </summary>
public class VideoMessageEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class VideoMessageEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置消息 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("MsgId")]
[System.Text.Json.Serialization.JsonPropertyName("MsgId")]
[System.Xml.Serialization.XmlElement("MsgId")]
public long MessageId { get; set; }
/// <summary>
/// 获取或设置视频消息 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("MediaId")]
[System.Text.Json.Serialization.JsonPropertyName("MediaId")]
[System.Xml.Serialization.XmlElement("MediaId")]
public string MediaId { get; set; } = default!;
/// <summary>
/// 获取或设置视频消息缩略图 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ThumbMediaId")]
[System.Text.Json.Serialization.JsonPropertyName("ThumbMediaId")]
[System.Xml.Serialization.XmlElement("ThumbMediaId")]
public string ThumbnailMediaId { get; set; } = default!;
}

View File

@ -6,7 +6,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90375 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90855 </para>
/// </summary>
public class VoiceMessageEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class VoiceMessageEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。

View File

@ -1,11 +1,11 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.add_calendar 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93651 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93704 </para>
/// </summary>
public class AddCalendarEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IJsonSerializable, WechatWorkEvent.Serialization.IXmlSerializable
public class AddCalendarEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置日历 ID。

View File

@ -5,7 +5,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93651 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93704 </para>
/// </summary>
public class DeleteCalendarEvent : AddCalendarEvent, WechatWorkEvent.Serialization.IJsonSerializable, WechatWorkEvent.Serialization.IXmlSerializable
public class DeleteCalendarEvent : AddCalendarEvent
{
}
}

View File

@ -5,7 +5,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93651 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93704 </para>
/// </summary>
public class ModifyCalendarEvent : AddCalendarEvent, WechatWorkEvent.Serialization.IJsonSerializable, WechatWorkEvent.Serialization.IXmlSerializable
public class ModifyCalendarEvent : AddCalendarEvent
{
}
}

View File

@ -4,7 +4,7 @@
/// <para>表示 EVENT.book_meeting_room 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95333 </para>
/// </summary>
public class BookMeetingRoomEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IJsonSerializable, WechatWorkEvent.Serialization.IXmlSerializable
public class BookMeetingRoomEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置会议室 ID。

View File

@ -4,7 +4,7 @@
/// <para>表示 EVENT.cancel_meeting_room 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95333 </para>
/// </summary>
public class CancelMeetingRoomEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IJsonSerializable, WechatWorkEvent.Serialization.IXmlSerializable
public class CancelMeetingRoomEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置会议室 ID。

View File

@ -5,7 +5,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93651 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93704 </para>
/// </summary>
public class AddScheduleEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IJsonSerializable, WechatWorkEvent.Serialization.IXmlSerializable
public class AddScheduleEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置日程 ID。

View File

@ -5,7 +5,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93651 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93704 </para>
/// </summary>
public class DeleteScheduleEvent : AddScheduleEvent, WechatWorkEvent.Serialization.IJsonSerializable, WechatWorkEvent.Serialization.IXmlSerializable
public class DeleteScheduleEvent : AddScheduleEvent
{
}
}

View File

@ -5,7 +5,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93651 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93704 </para>
/// </summary>
public class ModifyScheduleEvent : AddScheduleEvent, WechatWorkEvent.Serialization.IJsonSerializable, WechatWorkEvent.Serialization.IXmlSerializable
public class ModifyScheduleEvent : AddScheduleEvent
{
}
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.click 事件的数据。</para>
@ -6,17 +6,21 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class ClickPushEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ClickPushEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置事件 Key即自定义菜单接口中的 Key 值。
/// </summary>
[Newtonsoft.Json.JsonProperty("EventKey")]
[System.Text.Json.Serialization.JsonPropertyName("EventKey")]
[System.Xml.Serialization.XmlElement("EventKey")]
public string EventKey { get; set; } = default!;
}

View File

@ -6,11 +6,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class CloseInactiveAgentEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class CloseInactiveAgentEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.enter_agent 事件的数据。</para>
@ -6,17 +6,21 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class EnterAgentPushEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class EnterAgentPushEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置事件 Key。
/// </summary>
[Newtonsoft.Json.JsonProperty("EventKey")]
[System.Text.Json.Serialization.JsonPropertyName("EventKey")]
[System.Xml.Serialization.XmlElement("EventKey")]
public string? EventKey { get; set; }
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.LOCATION 事件的数据。</para>
@ -6,36 +6,46 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class LocationPushEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class LocationPushEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置应用类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("AppType")]
[System.Text.Json.Serialization.JsonPropertyName("AppType")]
[System.Xml.Serialization.XmlElement("AppType", IsNullable = true)]
public string? AppType { get; set; }
/// <summary>
/// 获取或设置地理位置纬度。
/// </summary>
[Newtonsoft.Json.JsonProperty("Latitude")]
[System.Text.Json.Serialization.JsonPropertyName("Latitude")]
[System.Xml.Serialization.XmlElement("Latitude")]
public double Latitude { get; set; }
public decimal Latitude { get; set; }
/// <summary>
/// 获取或设置地理位置经度。
/// </summary>
[Newtonsoft.Json.JsonProperty("Longitude")]
[System.Text.Json.Serialization.JsonPropertyName("Longitude")]
[System.Xml.Serialization.XmlElement("Longitude")]
public double Longitude { get; set; }
public decimal Longitude { get; set; }
/// <summary>
/// 获取或设置地理位置精度。
/// </summary>
[Newtonsoft.Json.JsonProperty("Precision")]
[System.Text.Json.Serialization.JsonPropertyName("Precision")]
[System.Xml.Serialization.XmlElement("Precision")]
public double Precision { get; set; }
public decimal Precision { get; set; }
}
}

View File

@ -6,11 +6,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class ReopenInactiveAgentEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ReopenInactiveAgentEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.scancode_push 事件的数据。</para>
@ -6,7 +6,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class ScanCodePushEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ScanCodePushEvent : WechatWorkEvent
{
public static class Types
{
@ -15,12 +15,16 @@
/// <summary>
/// 获取或设置扫描类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("ScanType")]
[System.Text.Json.Serialization.JsonPropertyName("ScanType")]
[System.Xml.Serialization.XmlElement("ScanType")]
public string ScanType { get; set; } = default!;
/// <summary>
/// 获取或设置扫描结果。
/// </summary>
[Newtonsoft.Json.JsonProperty("ScanResult")]
[System.Text.Json.Serialization.JsonPropertyName("ScanResult")]
[System.Xml.Serialization.XmlElement("ScanResult")]
public string ScanResult { get; set; } = default!;
}
@ -29,18 +33,24 @@
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置事件 Key即自定义菜单接口中的 Key 值。
/// </summary>
[Newtonsoft.Json.JsonProperty("EventKey")]
[System.Text.Json.Serialization.JsonPropertyName("EventKey")]
[System.Xml.Serialization.XmlElement("EventKey")]
public string EventKey { get; set; } = default!;
/// <summary>
/// 获取或设置扫描信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ScanCodeInfo")]
[System.Text.Json.Serialization.JsonPropertyName("ScanCodeInfo")]
[System.Xml.Serialization.XmlElement("ScanCodeInfo")]
public Types.ScanCode ScanCode { get; set; } = default!;
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.subscribe 事件的数据。</para>
@ -6,17 +6,21 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class SubscribePushEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class SubscribePushEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置事件 Key。
/// </summary>
[Newtonsoft.Json.JsonProperty("EventKey")]
[System.Text.Json.Serialization.JsonPropertyName("EventKey")]
[System.Xml.Serialization.XmlElement("EventKey", IsNullable = true)]
public string? EventKey { get; set; }
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.taskcard_click 事件的数据。</para>
@ -6,23 +6,29 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class TaskCardClickPushEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class TaskCardClickPushEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置事件 Key即发送任务卡片时自定义按钮的 Key 值。
/// </summary>
[Newtonsoft.Json.JsonProperty("EventKey")]
[System.Text.Json.Serialization.JsonPropertyName("EventKey")]
[System.Xml.Serialization.XmlElement("EventKey")]
public string EventKey { get; set; } = default!;
/// <summary>
/// 获取或设置任务 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("TaskId")]
[System.Text.Json.Serialization.JsonPropertyName("TaskId")]
[System.Xml.Serialization.XmlElement("TaskId")]
public string TaskId { get; set; } = default!;
}

View File

@ -1,11 +1,11 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.template_card_event 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90240 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90240 </para>
/// </summary>
public class TemplateCardPushEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class TemplateCardPushEvent : WechatWorkEvent
{
public static class Types
{
@ -18,6 +18,8 @@
/// <summary>
/// 获取或设置选项列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("OpitonId")]
[System.Text.Json.Serialization.JsonPropertyName("OpitonId")]
[System.Xml.Serialization.XmlElement("OpitonId", Type = typeof(string))]
public string[] Items { get; set; } = default!;
}
@ -26,12 +28,16 @@
/// <summary>
/// 获取或设置问题的 Key 值。
/// </summary>
[Newtonsoft.Json.JsonProperty("QuestionKey")]
[System.Text.Json.Serialization.JsonPropertyName("QuestionKey")]
[System.Xml.Serialization.XmlElement("QuestionKey")]
public string QuestionKey { get; set; } = default!;
/// <summary>
/// 获取或设置选项 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("OpitonIds")]
[System.Text.Json.Serialization.JsonPropertyName("OpitonIds")]
[System.Xml.Serialization.XmlElement("OpitonIds")]
public Types.OptionIdList OptionIdList { get; set; } = default!;
}
@ -41,6 +47,8 @@
/// <summary>
/// 获取或设置下拉框列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("SelectedItem")]
[System.Text.Json.Serialization.JsonPropertyName("SelectedItem")]
[System.Xml.Serialization.XmlElement("SelectedItem", Type = typeof(SelectItem))]
public SelectItem[]? Items { get; set; } = default!;
}
@ -49,36 +57,48 @@
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置任务 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("TaskId")]
[System.Text.Json.Serialization.JsonPropertyName("TaskId")]
[System.Xml.Serialization.XmlElement("TaskId")]
public string TaskId { get; set; } = default!;
/// <summary>
/// 获取或设置模板卡片类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("CardType")]
[System.Text.Json.Serialization.JsonPropertyName("CardType")]
[System.Xml.Serialization.XmlElement("CardType")]
public string CardType { get; set; } = default!;
/// <summary>
/// 获取或设置用于更新卡片接口的 Code。
/// </summary>
[Newtonsoft.Json.JsonProperty("ResponseCode")]
[System.Text.Json.Serialization.JsonPropertyName("ResponseCode")]
[System.Xml.Serialization.XmlElement("ResponseCode")]
public string ResponseCode { get; set; } = default!;
/// <summary>
/// 获取或设置用户点击的按钮 Key 值。
/// </summary>
[Newtonsoft.Json.JsonProperty("EventKey")]
[System.Text.Json.Serialization.JsonPropertyName("EventKey")]
[System.Xml.Serialization.XmlElement("EventKey", IsNullable = true)]
public string? ButtonKey { get; set; }
/// <summary>
/// 获取或设置下拉框列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("SelectedItems")]
[System.Text.Json.Serialization.JsonPropertyName("SelectedItems")]
[System.Xml.Serialization.XmlElement("SelectedItems")]
public Types.SelectList SelectList { get; set; } = default!;
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.view 事件的数据。</para>
@ -6,17 +6,21 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90858 </para>
/// </summary>
public class ViewPushEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ViewPushEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置事件 Key即跳转的 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("EventKey")]
[System.Text.Json.Serialization.JsonPropertyName("EventKey")]
[System.Xml.Serialization.XmlElement("EventKey")]
public string EventKey { get; set; } = default!;
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示被动回复图片消息的数据。</para>
@ -6,7 +6,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90377#%E5%9B%BE%E7%89%87%E6%B6%88%E6%81%AF </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90859#%E5%9B%BE%E7%89%87%E6%B6%88%E6%81%AF </para>
/// </summary>
public class ImageMessageReply : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ImageMessageReply : WechatWorkEvent
{
public static class Types
{
@ -15,6 +15,8 @@
/// <summary>
/// 获取或设置图片 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("MediaId")]
[System.Text.Json.Serialization.JsonPropertyName("MediaId")]
[System.Xml.Serialization.XmlElement("MediaId")]
public string MediaId { get; set; } = string.Empty;
}
@ -23,6 +25,8 @@
/// <summary>
/// 获取或设置图片信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("Image")]
[System.Text.Json.Serialization.JsonPropertyName("Image")]
[System.Xml.Serialization.XmlElement("Image")]
public Types.Image Image { get; set; } = new Types.Image();

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示被动回复图文消息的数据。</para>
@ -6,7 +6,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90377#%E5%9B%BE%E6%96%87%E6%B6%88%E6%81%AF </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90859#%E5%9B%BE%E6%96%87%E6%B6%88%E6%81%AF </para>
/// </summary>
public class NewsMessageReply : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class NewsMessageReply : WechatWorkEvent
{
public static class Types
{
@ -15,24 +15,32 @@
/// <summary>
/// 获取或设置图文链接。
/// </summary>
[Newtonsoft.Json.JsonProperty("Url")]
[System.Text.Json.Serialization.JsonPropertyName("Url")]
[System.Xml.Serialization.XmlElement("Url")]
public string Url { get; set; } = string.Empty;
/// <summary>
/// 获取或设置图文封面图片链接。
/// </summary>
[Newtonsoft.Json.JsonProperty("PicUrl")]
[System.Text.Json.Serialization.JsonPropertyName("PicUrl")]
[System.Xml.Serialization.XmlElement("PicUrl")]
public string PictureUrl { get; set; } = string.Empty;
/// <summary>
/// 获取或设置图文标题。
/// </summary>
[Newtonsoft.Json.JsonProperty("Title")]
[System.Text.Json.Serialization.JsonPropertyName("Title")]
[System.Xml.Serialization.XmlElement("Title")]
public string Title { get; set; } = string.Empty;
/// <summary>
/// 获取或设置图文描述。
/// </summary>
[Newtonsoft.Json.JsonProperty("Description")]
[System.Text.Json.Serialization.JsonPropertyName("Description")]
[System.Xml.Serialization.XmlElement("Description")]
public string Description { get; set; } = string.Empty;
}
@ -42,6 +50,8 @@
/// <summary>
/// 获取或设置图文列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("item")]
[System.Text.Json.Serialization.JsonPropertyName("item")]
[System.Xml.Serialization.XmlElement("item", Type = typeof(ArticleItem))]
public ArticleItem[] Items { get; set; } = new ArticleItem[0];
}
@ -50,12 +60,16 @@
/// <summary>
/// 获取或设置图文数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("ArticleCount")]
[System.Text.Json.Serialization.JsonPropertyName("ArticleCount")]
[System.Xml.Serialization.XmlElement("ArticleCount")]
public int ArticleCount { get; set; }
/// <summary>
/// 获取或设置图文列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("Articles")]
[System.Text.Json.Serialization.JsonPropertyName("Articles")]
[System.Xml.Serialization.XmlElement("Articles")]
public Types.ArticleList ArticleList { get; set; } = new Types.ArticleList();

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示被动回复文本消息的数据。</para>
@ -6,11 +6,13 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90377#%E6%96%87%E6%9C%AC%E6%B6%88%E6%81%AF </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90859#%E6%96%87%E6%9C%AC%E6%B6%88%E6%81%AF </para>
/// </summary>
public class TextMessageReply : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class TextMessageReply : WechatWorkEvent
{
/// <summary>
/// 获取或设置消息内容。
/// </summary>
[Newtonsoft.Json.JsonProperty("Content")]
[System.Text.Json.Serialization.JsonPropertyName("Content")]
[System.Xml.Serialization.XmlElement("Content")]
public string Content { get; set; } = string.Empty;

View File

@ -1,11 +1,11 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示被动回复更新点击用户的按钮点击文案消息的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90241#%E6%A8%A1%E6%9D%BF%E5%8D%A1%E7%89%87%E6%9B%B4%E6%96%B0%E6%B6%88%E6%81%AF </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90377#%E6%A8%A1%E6%9D%BF%E5%8D%A1%E7%89%87%E6%9B%B4%E6%96%B0%E6%B6%88%E6%81%AF </para>
/// </summary>
public class UpdateButtonReply : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class UpdateButtonReply : WechatWorkEvent
{
public static class Types
{
@ -14,6 +14,8 @@
/// <summary>
/// 获取或设置替换文案。
/// </summary>
[Newtonsoft.Json.JsonProperty("ReplaceName")]
[System.Text.Json.Serialization.JsonPropertyName("ReplaceName")]
[System.Xml.Serialization.XmlElement("ReplaceName")]
public string ReplacementText { get; set; } = string.Empty;
}
@ -22,6 +24,8 @@
/// <summary>
/// 获取或设置按钮信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("Button")]
[System.Text.Json.Serialization.JsonPropertyName("Button")]
[System.Xml.Serialization.XmlElement("Button")]
public Types.Button Button { get; set; } = new Types.Button();

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示被动回复任务卡片更新消息的数据。</para>
@ -6,7 +6,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90377#%E4%BB%BB%E5%8A%A1%E5%8D%A1%E7%89%87%E6%9B%B4%E6%96%B0%E6%B6%88%E6%81%AF </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90859#%E4%BB%BB%E5%8A%A1%E5%8D%A1%E7%89%87%E6%9B%B4%E6%96%B0%E6%B6%88%E6%81%AF </para>
/// </summary>
public class UpdateTaskCardReply : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class UpdateTaskCardReply : WechatWorkEvent
{
public static class Types
{
@ -15,6 +15,8 @@
/// <summary>
/// 获取或设置点击任务卡片按钮后显示的按钮名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("ReplaceName")]
[System.Text.Json.Serialization.JsonPropertyName("ReplaceName")]
[System.Xml.Serialization.XmlElement("ReplaceName")]
public string ReplacementText { get; set; } = string.Empty;
}
@ -23,6 +25,8 @@
/// <summary>
/// 获取或设置任务卡片信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("TaskCard")]
[System.Text.Json.Serialization.JsonPropertyName("TaskCard")]
[System.Xml.Serialization.XmlElement("TaskCard")]
public Types.TaskCard? TaskCard { get; set; }

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示被动回复视频消息的数据。</para>
@ -6,7 +6,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90377#%E8%A7%86%E9%A2%91%E6%B6%88%E6%81%AF </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90859#%E8%A7%86%E9%A2%91%E6%B6%88%E6%81%AF </para>
/// </summary>
public class VideoMessageReply : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class VideoMessageReply : WechatWorkEvent
{
public static class Types
{
@ -15,18 +15,24 @@
/// <summary>
/// 获取或设置视频 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("MediaId")]
[System.Text.Json.Serialization.JsonPropertyName("MediaId")]
[System.Xml.Serialization.XmlElement("MediaId")]
public string MediaId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置视频标题。
/// </summary>
[Newtonsoft.Json.JsonProperty("Title")]
[System.Text.Json.Serialization.JsonPropertyName("Title")]
[System.Xml.Serialization.XmlElement("Title")]
public string Title { get; set; } = string.Empty;
/// <summary>
/// 获取或设置视频描述。
/// </summary>
[Newtonsoft.Json.JsonProperty("Description")]
[System.Text.Json.Serialization.JsonPropertyName("Description")]
[System.Xml.Serialization.XmlElement("Description")]
public string Description { get; set; } = string.Empty;
}
@ -35,6 +41,8 @@
/// <summary>
/// 获取或设置视频信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("Video")]
[System.Text.Json.Serialization.JsonPropertyName("Video")]
[System.Xml.Serialization.XmlElement("Video")]
public Types.Video Video { get; set; } = new Types.Video();

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示被动回复语音消息的数据。</para>
@ -6,7 +6,7 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90377#%E8%AF%AD%E9%9F%B3%E6%B6%88%E6%81%AF </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90859#%E8%AF%AD%E9%9F%B3%E6%B6%88%E6%81%AF </para>
/// </summary>
public class VoiceMessageReply : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class VoiceMessageReply : WechatWorkEvent
{
public static class Types
{
@ -15,6 +15,8 @@
/// <summary>
/// 获取或设置语音 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("MediaId")]
[System.Text.Json.Serialization.JsonPropertyName("MediaId")]
[System.Xml.Serialization.XmlElement("MediaId")]
public string MediaId { get; set; } = string.Empty;
}
@ -23,6 +25,8 @@
/// <summary>
/// 获取或设置语音信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("Voice")]
[System.Text.Json.Serialization.JsonPropertyName("Voice")]
[System.Xml.Serialization.XmlElement("Voice")]
public Types.Voice Voice { get; set; } = new Types.Voice();

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.change_school_contact 或 INFO.change_school_contact 事件的数据。</para>
@ -7,29 +7,37 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92051 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/92050 </para>
/// </summary>
public class ChangeSchoolContactEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeSchoolContactEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
public string? SuiteId { get; set; }
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId", IsNullable = true)]
public string? AuthorizerCorpId { get; set; }
/// <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("Id")]
[System.Text.Json.Serialization.JsonPropertyName("Id")]
[System.Xml.Serialization.XmlElement("Id", IsNullable = true)]
public string? StudentOrParentOrDepartmentId { get; set; }
}

View File

@ -4,7 +4,7 @@
/// <para>表示 EVENT.agree_external_userid_migration 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95327 </para>
/// </summary>
public class AgreeExternalUserIdMigrationEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable, WechatWorkEvent.Serialization.IJsonSerializable
public class AgreeExternalUserIdMigrationEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置服务商 CorpId。

View File

@ -4,23 +4,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>表示 INFO.approve_special_auth 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98959 </para>
/// </summary>
public class ApproveSpecialAuthEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ApproveSpecialAuthEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置权限类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthType")]
[System.Text.Json.Serialization.JsonPropertyName("AuthType")]
[System.Xml.Serialization.XmlElement("AuthType")]
public string AuthType { get; set; } = default!;
}

View File

@ -4,23 +4,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>表示 INFO.cancel_special_auth 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98959 </para>
/// </summary>
public class CancelSpecialAuthEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class CancelSpecialAuthEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置权限类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthType")]
[System.Text.Json.Serialization.JsonPropertyName("AuthType")]
[System.Xml.Serialization.XmlElement("AuthType")]
public string AuthType { get; set; } = default!;
}

View File

@ -1,14 +1,16 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.change_app_admin 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95038 </para>
/// </summary>
public class ChangeAppAdminEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeAppAdminEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentID")]
[System.Text.Json.Serialization.JsonPropertyName("AgentID")]
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
}

View File

@ -5,7 +5,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90642 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/99401 </para>
/// </summary>
public class ChangeAuthEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeAuthEvent : WechatWorkEvent
{
public static class Types
{
@ -18,6 +18,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置客服账号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("OpenKfId")]
[System.Text.Json.Serialization.JsonPropertyName("OpenKfId")]
[System.Xml.Serialization.XmlElement("OpenKfId", Type = typeof(string))]
public string[] Items { get; set; } = default!;
}
@ -26,6 +28,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置用户本次授权的客服账号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthOpenKfIdList")]
[System.Text.Json.Serialization.JsonPropertyName("AuthOpenKfIdList")]
[System.Xml.Serialization.XmlElement("AuthOpenKfIdList", IsNullable = true)]
public Types.AuthorizedOpenKfIdList? AuthorizedOpenKfIdList { get; set; }
}
@ -34,18 +38,24 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置事件信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ExtraInfo")]
[System.Text.Json.Serialization.JsonPropertyName("ExtraInfo")]
[System.Xml.Serialization.XmlElement("ExtraInfo", IsNullable = true)]
public Types.Extra? Extra { get; set; }
}

View File

@ -1,20 +1,24 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.corp_arch_auth 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97378 </para>
/// </summary>
public class CorpArchitectureAuthEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class CorpArchitectureAuthEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
}

View File

@ -1,27 +1,33 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.create_auth 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90642 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90795 </para>
/// </summary>
public class CreateAuthEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class CreateAuthEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置授权码。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCode")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCode")]
[System.Xml.Serialization.XmlElement("AuthCode")]
public string AuthCode { get; set; } = default!;
/// <summary>
/// 获取或设置扫码或者授权链接中的自定义参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("State")]
[System.Text.Json.Serialization.JsonPropertyName("State")]
[System.Xml.Serialization.XmlElement("State", IsNullable = true)]
public string? State { get; set; }
}

View File

@ -5,7 +5,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90585 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90810 </para>
/// </summary>
public class EnterRegisterPackageEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class EnterRegisterPackageEvent : WechatWorkEvent
{
public static class Types
{
@ -14,6 +14,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserId")]
[System.Text.Json.Serialization.JsonPropertyName("UserId")]
[System.Xml.Serialization.XmlElement("UserId")]
public string UserId { get; set; } = default!;
}
@ -22,36 +24,48 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置注册码。
/// </summary>
[Newtonsoft.Json.JsonProperty("RegisterCode")]
[System.Text.Json.Serialization.JsonPropertyName("RegisterCode")]
[System.Xml.Serialization.XmlElement("RegisterCode")]
public string RegisterCode { get; set; } = default!;
/// <summary>
/// 获取或设置授权管理员信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthUserInfo")]
[System.Text.Json.Serialization.JsonPropertyName("AuthUserInfo")]
[System.Xml.Serialization.XmlElement("AuthUserInfo", IsNullable = true)]
public Types.AuthorizerUser? AuthorizerUser { get; set; }
/// <summary>
/// 获取或设置推广包 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("TemplateId")]
[System.Text.Json.Serialization.JsonPropertyName("TemplateId")]
[System.Xml.Serialization.XmlElement("TemplateId")]
public string TemplateId { get; set; } = default!;
/// <summary>
/// 获取或设置自定义渠道参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("State")]
[System.Text.Json.Serialization.JsonPropertyName("State")]
[System.Xml.Serialization.XmlElement("State", IsNullable = true)]
public string? State { get; set; }
}

View File

@ -1,20 +1,24 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.change_editon 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91933 </para>
/// </summary>
public class ChangeEditionEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeEditionEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置购买方 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("PaidCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("PaidCorpId")]
[System.Xml.Serialization.XmlElement("PaidCorpId")]
public string PayerCorpId { get; set; } = default!;
}

View File

@ -1,32 +1,40 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.change_order 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91930 </para>
/// </summary>
public class ChangeOrderEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ChangeOrderEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置购买方 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("PaidCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("PaidCorpId")]
[System.Xml.Serialization.XmlElement("PaidCorpId")]
public string PayerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置原订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("OldOrderId")]
[System.Text.Json.Serialization.JsonPropertyName("OldOrderId")]
[System.Xml.Serialization.XmlElement("OldOrderId")]
public string OldOrderId { get; set; }= default!;
/// <summary>
/// 获取或设置新订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("NewOrderId")]
[System.Text.Json.Serialization.JsonPropertyName("NewOrderId")]
[System.Xml.Serialization.XmlElement("NewOrderId")]
public string NewOrderId { get; set; }= default!;
}

View File

@ -1,32 +1,40 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.open_order 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91929 </para>
/// </summary>
public class OpenOrderEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class OpenOrderEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置购买方 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("PaidCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("PaidCorpId")]
[System.Xml.Serialization.XmlElement("PaidCorpId")]
public string PayerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("OrderId")]
[System.Text.Json.Serialization.JsonPropertyName("OrderId")]
[System.Xml.Serialization.XmlElement("OrderId")]
public string OrderId { get; set; } = default!;
/// <summary>
/// 获取或设置操作员 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("OperatorId")]
[System.Text.Json.Serialization.JsonPropertyName("OperatorId")]
[System.Xml.Serialization.XmlElement("OperatorId", IsNullable = true)]
public string? OperatorId { get; set; }
}

View File

@ -4,7 +4,7 @@
/// <para>表示 INFO.pay_for_app_success 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91931 </para>
/// </summary>
public class PayForAppSuccessEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class PayForAppSuccessEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。

View File

@ -1,26 +1,32 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.refund 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91932 </para>
/// </summary>
public class RefundEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class RefundEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置购买方 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("PaidCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("PaidCorpId")]
[System.Xml.Serialization.XmlElement("PaidCorpId")]
public string PayerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("OrderId")]
[System.Text.Json.Serialization.JsonPropertyName("OrderId")]
[System.Xml.Serialization.XmlElement("OrderId")]
public string OrderId { get; set; } = default!;
}

View File

@ -1,11 +1,11 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.register_corp 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90585 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90810 </para>
/// </summary>
public class RegisterCorpEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class RegisterCorpEvent : WechatWorkEvent
{
public static class Types
{
@ -14,12 +14,16 @@
/// <summary>
/// 获取或设置通讯录迁移凭证。
/// </summary>
[Newtonsoft.Json.JsonProperty("AccessToken")]
[System.Text.Json.Serialization.JsonPropertyName("AccessToken")]
[System.Xml.Serialization.XmlElement("AccessToken")]
public string AccessToken { get; set; } = default!;
/// <summary>
/// 获取或设置通讯录迁移凭证有效期(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("ExpiresIn")]
[System.Text.Json.Serialization.JsonPropertyName("ExpiresIn")]
[System.Xml.Serialization.XmlElement("ExpiresIn")]
public int ExpiresIn { get; set; }
}
@ -29,6 +33,8 @@
/// <summary>
/// 获取或设置成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("UserId")]
[System.Text.Json.Serialization.JsonPropertyName("UserId")]
[System.Xml.Serialization.XmlElement("UserId")]
public string UserId { get; set; } = default!;
}
@ -37,42 +43,56 @@
/// <summary>
/// 获取或设置服务商 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("ServiceCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("ServiceCorpId")]
[System.Xml.Serialization.XmlElement("ServiceCorpId")]
public string ServiceCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置注册码。
/// </summary>
[Newtonsoft.Json.JsonProperty("RegisterCode")]
[System.Text.Json.Serialization.JsonPropertyName("RegisterCode")]
[System.Xml.Serialization.XmlElement("RegisterCode")]
public string RegisterCode { get; set; } = default!;
/// <summary>
/// 获取或设置通讯录迁移信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ContactSync")]
[System.Text.Json.Serialization.JsonPropertyName("ContactSync")]
[System.Xml.Serialization.XmlElement("ContactSync", IsNullable = true)]
public Types.ContactSync? ContactSync { get; set; }
/// <summary>
/// 获取或设置授权管理员信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("AuthUserInfo")]
[System.Text.Json.Serialization.JsonPropertyName("AuthUserInfo")]
[System.Xml.Serialization.XmlElement("AuthUserInfo", IsNullable = true)]
public Types.AuthorizerUser? AuthorizerUser { get; set; }
/// <summary>
/// 获取或设置推广包 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("TemplateId")]
[System.Text.Json.Serialization.JsonPropertyName("TemplateId")]
[System.Xml.Serialization.XmlElement("TemplateId")]
public string TemplateId { get; set; } = default!;
/// <summary>
/// 获取或设置自定义渠道参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("State")]
[System.Text.Json.Serialization.JsonPropertyName("State")]
[System.Xml.Serialization.XmlElement("State", IsNullable = true)]
public string? State { get; set; }
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.share_agent_change 或 INFO.share_agent_change 事件的数据。</para>
@ -6,29 +6,37 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/93373 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90376 </para>
/// </summary>
public class ShareAgentChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class ShareAgentChangeEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId", IsNullable = true)]
public string? SuiteId { get; set; }
/// <summary>
/// 获取或设置上级企业 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("CorpId")]
[System.Text.Json.Serialization.JsonPropertyName("CorpId")]
[System.Xml.Serialization.XmlElement("CorpId", IsNullable = true)]
public string? ParentCorpId { get; set; }
/// <summary>
/// 获取或设置上级企业应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AgentId")]
[System.Text.Json.Serialization.JsonPropertyName("AgentId")]
[System.Xml.Serialization.XmlElement("AgentId")]
public int ParentAgentId { get; set; }
/// <summary>
/// 获取或设置下级企业应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("AppId")]
[System.Text.Json.Serialization.JsonPropertyName("AppId")]
[System.Xml.Serialization.XmlElement("AppId", IsNullable = true)]
public int? AgentId { get; set; }
}

View File

@ -1,21 +1,25 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.suite_ticket 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90628 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90794 </para>
/// </summary>
public class SuiteTicketEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class SuiteTicketEvent : WechatWorkEvent
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteId")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置第三方应用的 SuiteTicket。
/// </summary>
[Newtonsoft.Json.JsonProperty("SuiteTicket")]
[System.Text.Json.Serialization.JsonPropertyName("SuiteTicket")]
[System.Xml.Serialization.XmlElement("SuiteTicket")]
public string SuiteTicket { get; set; } = default!;
}

View File

@ -8,23 +8,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98095 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98096 </para>
/// </summary>
public class DocumentChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class DocumentChangeEvent : 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", Type = typeof(string), IsNullable = true)]
public string[]? DocumentIdList { get; set; }
/// <summary>
/// 获取或设置收集表 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("FormId")]
[System.Text.Json.Serialization.JsonPropertyName("FormId")]
[System.Xml.Serialization.XmlElement("FormId", Type = typeof(string), IsNullable = true)]
public string[]? FormIdList { get; set; }
}

View File

@ -1,20 +1,24 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.wedrive_file_change 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97975 </para>
/// </summary>
public class WedriveFileChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class WedriveFileChangeEvent : 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("FileId")]
[System.Text.Json.Serialization.JsonPropertyName("FileId")]
[System.Xml.Serialization.XmlElement("FileId", Type = typeof(string))]
public string[] FileIdList { get; set; } = default!;
}

View File

@ -4,7 +4,7 @@
/// <para>表示 EVENT.wedrive_insufficient_capacity 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97972 </para>
/// </summary>
public class WedriveInsufficientCapacityEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class WedriveInsufficientCapacityEvent : WechatWorkEvent
{
}
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 EVENT.wedrive_space_change 事件的数据。</para>
@ -7,17 +7,21 @@
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97977 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97978 </para>
/// </summary>
public class WedriveSpaceChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
public class WedriveSpaceChangeEvent : 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("SpaceId")]
[System.Text.Json.Serialization.JsonPropertyName("SpaceId")]
[System.Xml.Serialization.XmlElement("SpaceId", Type = typeof(string))]
public string[] SpaceIdList { get; set; } = default!;
}

View File

@ -1,24 +0,0 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Work.Exceptions
{
public class WechatWorkEventSerializationException : WechatWorkException
{
/// <inheritdoc/>
internal WechatWorkEventSerializationException()
{
}
/// <inheritdoc/>
internal WechatWorkEventSerializationException(string message)
: base(message)
{
}
/// <inheritdoc/>
internal WechatWorkEventSerializationException(string message, Exception innerException)
: base(message, innerException)
{
}
}
}

View File

@ -1,24 +0,0 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.Work.Exceptions
{
public class WechatWorkRequestTimeoutException : WechatWorkException
{
/// <inheritdoc/>
internal WechatWorkRequestTimeoutException()
{
}
/// <inheritdoc/>
internal WechatWorkRequestTimeoutException(string message)
: base(message)
{
}
/// <inheritdoc/>
internal WechatWorkRequestTimeoutException(string message, Exception innerException)
: base(message, innerException)
{
}
}
}

View File

@ -6,100 +6,30 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
/// <summary>
/// 为 <see cref="WechatWorkClient"/> 提供回调通知事件的扩展方法。
/// </summary>
public static class WechatWorkClientEventExtensions
public static partial class WechatWorkClientEventExtensions
{
private class InnerEncryptedEvent
{
[Newtonsoft.Json.JsonProperty("Encrypt")]
[System.Text.Json.Serialization.JsonPropertyName("Encrypt")]
public string EncryptedData { get; set; } = default!;
[Newtonsoft.Json.JsonProperty("TimeStamp")]
[System.Text.Json.Serialization.JsonPropertyName("TimeStamp")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringConverter))]
public string TimestampString { get; set; } = default!;
[Newtonsoft.Json.JsonProperty("Nonce")]
[System.Text.Json.Serialization.JsonPropertyName("Nonce")]
public string Nonce { get; set; } = default!;
[Newtonsoft.Json.JsonProperty("MsgSignature")]
[System.Text.Json.Serialization.JsonPropertyName("MsgSignature")]
public string Signature { get; set; } = default!;
}
private static TEvent InnerDeserializeEventFromJson<TEvent>(this WechatWorkClient client, string callbackJson)
where TEvent : WechatWorkEvent
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (callbackJson == null) throw new ArgumentNullException(callbackJson);
try
{
if (string.IsNullOrEmpty(client.Credentials.PushEncodingAESKey))
throw new Exceptions.WechatWorkEventSerializationException("Failed to decrypt event data, because there is no encoding AES key.");
InnerEncryptedEvent encryptedEvent = client.JsonSerializer.Deserialize<InnerEncryptedEvent>(callbackJson);
callbackJson = Utilities.WxMsgCryptor.AESDecrypt(cipherText: encryptedEvent.EncryptedData, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _);
return client.JsonSerializer.Deserialize<TEvent>(callbackJson);
}
catch (WechatWorkException)
{
throw;
}
catch (Exception ex)
{
throw new Exceptions.WechatWorkEventSerializationException("Failed to deserialize event data. Please see the inner exception for more details.", ex);
}
}
private static TEvent InnerDeserializeEventFromXml<TEvent>(this WechatWorkClient client, string callbackXml)
where TEvent : WechatWorkEvent
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (callbackXml == null) throw new ArgumentNullException(callbackXml);
try
{
if (!Utilities.WxMsgCryptor.TryParseXml(callbackXml, out string? encryptedXml))
throw new Exceptions.WechatWorkEventSerializationException("Failed to decrypt event data, because of empty encrypted data.");
callbackXml = Utilities.WxMsgCryptor.AESDecrypt(cipherText: encryptedXml!, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _);
return Utilities.XmlUtility.Deserialize<TEvent>(callbackXml);
}
catch (WechatWorkException)
{
throw;
}
catch (Exception ex)
{
throw new Exceptions.WechatWorkEventSerializationException("Failed to deserialize event data. Please see the inner exception for more details.", ex);
}
}
/// <summary>
/// <para>从 JSON 反序列化得到 <see cref="WechatWorkEvent"/> 对象。</para>
/// </summary>
/// <typeparam name="TEvent"></typeparam>
/// <param name="client"></param>
/// <param name="callbackJson"></param>
/// <param name="webhookJson"></param>
/// <returns></returns>
public static TEvent DeserializeEventFromJson<TEvent>(this WechatWorkClient client, string callbackJson)
where TEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IJsonSerializable, new()
public static TEvent DeserializeEventFromJson<TEvent>(this WechatWorkClient client, string webhookJson)
where TEvent : WechatWorkEvent, new()
{
return InnerDeserializeEventFromJson<TEvent>(client, callbackJson);
return InnerDeserializeEventFromJson<TEvent>(client, webhookJson);
}
/// <summary>
/// <para>从 JSON 反序列化得到 <see cref="WechatWorkEvent"/> 对象。</para>
/// </summary>
/// <param name="client"></param>
/// <param name="callbackJson"></param>
/// <param name="webhookJson"></param>
/// <returns></returns>
public static WechatWorkEvent DeserializeEventFromJson(this WechatWorkClient client, string callbackJson)
public static WechatWorkEvent DeserializeEventFromJson(this WechatWorkClient client, string webhookJson)
{
return InnerDeserializeEventFromJson<WechatWorkEvent>(client, callbackJson);
return InnerDeserializeEventFromJson<WechatWorkEvent>(client, webhookJson);
}
/// <summary>
@ -107,23 +37,23 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
/// </summary>
/// <typeparam name="TEvent"></typeparam>
/// <param name="client"></param>
/// <param name="callbackXml"></param>
/// <param name="webhookXml"></param>
/// <returns></returns>
public static TEvent DeserializeEventFromXml<TEvent>(this WechatWorkClient client, string callbackXml)
where TEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable, new()
public static TEvent DeserializeEventFromXml<TEvent>(this WechatWorkClient client, string webhookXml)
where TEvent : WechatWorkEvent, new()
{
return InnerDeserializeEventFromXml<TEvent>(client, callbackXml);
return InnerDeserializeEventFromXml<TEvent>(client, webhookXml);
}
/// <summary>
/// <para>从 XML 反序列化得到 <see cref="WechatWorkEvent"/> 对象。</para>
/// </summary>
/// <param name="client"></param>
/// <param name="callbackXml"></param>
/// <param name="webhookXml"></param>
/// <returns></returns>
public static WechatWorkEvent DeserializeEventFromXml(this WechatWorkClient client, string callbackXml)
public static WechatWorkEvent DeserializeEventFromXml(this WechatWorkClient client, string webhookXml)
{
return InnerDeserializeEventFromXml<WechatWorkEvent>(client, callbackXml);
return InnerDeserializeEventFromXml<WechatWorkEvent>(client, webhookXml);
}
/// <summary>
@ -131,26 +61,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
/// </summary>
/// <typeparam name="TEvent"></typeparam>
/// <param name="client"></param>
/// <param name="callbackModel"></param>
/// <param name="webhookEvent"></param>
/// <returns></returns>
public static string SerializeEventToJson<TEvent>(this WechatWorkClient client, TEvent callbackModel)
where TEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IJsonSerializable, new()
public static string SerializeEventToJson<TEvent>(this WechatWorkClient client, TEvent webhookEvent)
where TEvent : WechatWorkEvent, new()
{
string json;
try
{
json = client.JsonSerializer.Serialize(callbackModel);
json = client.JsonSerializer.Serialize(webhookEvent);
}
catch (Exception ex)
{
throw new Exceptions.WechatWorkEventSerializationException("Failed to serialize event data. Please see the inner exception for more details.", ex);
throw new WechatWorkException("Failed to serialize event data. Please see the inner exception for more details.", ex);
}
if (string.IsNullOrEmpty(client.Credentials.PushEncodingAESKey))
throw new Exceptions.WechatWorkEventSerializationException("Failed to encrypt event data, because there is no encoding AES key.");
throw new WechatWorkException("Failed to encrypt event data, because the push encoding AES key is empty.");
if (string.IsNullOrEmpty(client.Credentials.PushToken))
throw new Exceptions.WechatWorkEventSerializationException("Failed to encrypt event data, because there is no token.");
throw new WechatWorkException("Failed to encrypt event data, because the push token is empty.");
try
{
@ -178,7 +108,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
}
catch (Exception ex)
{
throw new Exceptions.WechatWorkEventSerializationException("Failed to encrypt event data. Please see the inner exception for more details.", ex);
throw new WechatWorkException("Failed to encrypt event data. Please see the inner exception for more details.", ex);
}
return json;
@ -189,26 +119,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
/// </summary>
/// <typeparam name="TEvent"></typeparam>
/// <param name="client"></param>
/// <param name="callbackModel"></param>
/// <param name="webhookEvent"></param>
/// <returns></returns>
public static string SerializeEventToXml<TEvent>(this WechatWorkClient client, TEvent callbackModel)
where TEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable, new()
public static string SerializeEventToXml<TEvent>(this WechatWorkClient client, TEvent webhookEvent)
where TEvent : WechatWorkEvent, new()
{
string xml;
try
{
xml = Utilities.XmlUtility.Serialize(callbackModel);
xml = Utilities.XmlHelper.Serialize(webhookEvent);
}
catch (Exception ex)
{
throw new Exceptions.WechatWorkEventSerializationException("Failed to serialize event data. Please see the inner exception for more details.", ex);
throw new WechatWorkException("Failed to serialize event data. Please see the inner exception for more details.", ex);
}
if (string.IsNullOrEmpty(client.Credentials.PushEncodingAESKey))
throw new Exceptions.WechatWorkEventSerializationException("Failed to encrypt event data, because there is no encoding AES key.");
throw new WechatWorkException("Failed to encrypt event data, because the push encoding AES key is empty.");
if (string.IsNullOrEmpty(client.Credentials.PushToken))
throw new Exceptions.WechatWorkEventSerializationException("Failed to encrypt event data, because there is no token.");
throw new WechatWorkException("Failed to encrypt event data, because the push token is empty.");
try
{
@ -222,7 +152,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
}
catch (Exception ex)
{
throw new Exceptions.WechatWorkEventSerializationException("Failed to encrypt event data. Please see the inner exception for more details.", ex);
throw new WechatWorkException("Failed to encrypt event data. Please see the inner exception for more details.", ex);
}
return xml;
@ -235,33 +165,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91148 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="callbackTimestamp">微信回调通知中的 "timestamp" 查询参数。</param>
/// <param name="callbackNonce">微信回调通知中的 "nonce" 查询参数。</param>
/// <param name="callbackEcho">微信回调通知中的 "echostr" 查询参数。</param>
/// <param name="callbackSignature">微信回调通知中的 "msg_signature" 查询参数。</param>
/// <param name="webhookTimestamp">微信回调通知中的 "timestamp" 查询参数。</param>
/// <param name="webhookNonce">微信回调通知中的 "nonce" 查询参数。</param>
/// <param name="webhookEcho">微信回调通知中的 "echostr" 查询参数。</param>
/// <param name="webhookSignature">微信回调通知中的 "msg_signature" 查询参数。</param>
/// <param name="replyEcho"></param>
/// <returns></returns>
public static bool VerifyEventSignatureForEcho(this WechatWorkClient client, string callbackTimestamp, string callbackNonce, string callbackEcho, string callbackSignature, out string? replyEcho)
public static bool VerifyEventSignatureForEcho(this WechatWorkClient client, string webhookTimestamp, string webhookNonce, string webhookEcho, string webhookSignature, out string? replyEcho)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (callbackTimestamp == null) throw new ArgumentNullException(nameof(callbackTimestamp));
if (callbackNonce == null) throw new ArgumentNullException(nameof(callbackNonce));
if (callbackEcho == null) throw new ArgumentNullException(nameof(callbackEcho));
if (callbackSignature == null) throw new ArgumentNullException(nameof(callbackSignature));
if (client is null) throw new ArgumentNullException(nameof(client));
try
{
bool ret = Utilities.WxMsgCryptor.VerifySignature(
sToken: client.Credentials.PushToken!,
sTimestamp: callbackTimestamp,
sNonce: callbackNonce,
sMsgEncrypt: callbackEcho,
sMsgSign: callbackSignature
sTimestamp: webhookTimestamp,
sNonce: webhookNonce,
sMsgEncrypt: webhookEcho,
sMsgSign: webhookSignature
);
if (ret)
{
replyEcho = Utilities.WxMsgCryptor.AESDecrypt(cipherText: callbackEcho, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _);
replyEcho = Utilities.WxMsgCryptor.AESDecrypt(cipherText: webhookEcho, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _);
return true;
}
}
@ -278,25 +204,24 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91148 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="callbackTimestamp">微信回调通知中的 "timestamp" 查询参数。</param>
/// <param name="callbackNonce">微信回调通知中的 "nonce" 查询参数。</param>
/// <param name="callbackJson">微信回调通知中请求正文JSON 格式)。</param>
/// <param name="callbackSignature">微信回调通知中的 "msg_signature" 查询参数。</param>
/// <param name="webhookTimestamp">微信回调通知中的 "timestamp" 查询参数。</param>
/// <param name="webhookNonce">微信回调通知中的 "nonce" 查询参数。</param>
/// <param name="webhookJson">微信回调通知中请求正文JSON 格式)。</param>
/// <param name="webhookSignature">微信回调通知中的 "msg_signature" 查询参数。</param>
/// <returns></returns>
public static bool VerifyEventSignatureFromJson(this WechatWorkClient client, string callbackTimestamp, string callbackNonce, string callbackJson, string callbackSignature)
public static bool VerifyEventSignatureFromJson(this WechatWorkClient client, string webhookTimestamp, string webhookNonce, string webhookJson, string webhookSignature)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (callbackJson == null) throw new ArgumentNullException(nameof(callbackJson));
if (client is null) throw new ArgumentNullException(nameof(client));
try
{
var encryptedEvent = client.JsonSerializer.Deserialize<InnerEncryptedEvent>(callbackJson);
var encryptedEvent = client.JsonSerializer.Deserialize<InnerEncryptedEvent>(webhookJson);
return Utilities.WxMsgCryptor.VerifySignature(
sToken: client.Credentials.PushToken!,
sTimestamp: callbackTimestamp,
sNonce: callbackNonce,
sTimestamp: webhookTimestamp,
sNonce: webhookNonce,
sMsgEncrypt: encryptedEvent.EncryptedData,
sMsgSign: callbackSignature
sMsgSign: webhookSignature
);
}
catch
@ -312,27 +237,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91148 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="callbackTimestamp">微信回调通知中的 "timestamp" 查询参数。</param>
/// <param name="callbackNonce">微信回调通知中的 "nonce" 查询参数。</param>
/// <param name="callbackXml">微信回调通知中请求正文XML 格式)。</param>
/// <param name="callbackSignature">微信回调通知中的 "msg_signature" 查询参数。</param>
/// <param name="webhookTimestamp">微信回调通知中的 "timestamp" 查询参数。</param>
/// <param name="webhookNonce">微信回调通知中的 "nonce" 查询参数。</param>
/// <param name="webhookXml">微信回调通知中请求正文XML 格式)。</param>
/// <param name="webhookSignature">微信回调通知中的 "msg_signature" 查询参数。</param>
/// <returns></returns>
public static bool VerifyEventSignatureFromXml(this WechatWorkClient client, string callbackTimestamp, string callbackNonce, string callbackXml, string callbackSignature)
public static bool VerifyEventSignatureFromXml(this WechatWorkClient client, string webhookTimestamp, string webhookNonce, string webhookXml, string webhookSignature)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (callbackXml == null) throw new ArgumentNullException(nameof(callbackXml));
if (client is null) throw new ArgumentNullException(nameof(client));
try
{
XDocument xDoc = XDocument.Parse(callbackXml);
XDocument xDoc = XDocument.Parse(webhookXml);
string? msgEncrypt = xDoc.Root?.Element("Encrypt")?.Value;
return Utilities.WxMsgCryptor.VerifySignature(
sToken: client.Credentials.PushToken!,
sTimestamp: callbackTimestamp,
sNonce: callbackNonce,
sTimestamp: webhookTimestamp,
sNonce: webhookNonce,
sMsgEncrypt: msgEncrypt!,
sMsgSign: callbackSignature
sMsgSign: webhookSignature
);
}
catch
@ -341,4 +265,75 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
}
}
}
partial class WechatWorkClientEventExtensions
{
private class InnerEncryptedEvent
{
[Newtonsoft.Json.JsonProperty("Encrypt")]
[System.Text.Json.Serialization.JsonPropertyName("Encrypt")]
public string EncryptedData { get; set; } = default!;
[Newtonsoft.Json.JsonProperty("TimeStamp")]
[System.Text.Json.Serialization.JsonPropertyName("TimeStamp")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))]
public string TimestampString { get; set; } = default!;
[Newtonsoft.Json.JsonProperty("Nonce")]
[System.Text.Json.Serialization.JsonPropertyName("Nonce")]
public string Nonce { get; set; } = default!;
[Newtonsoft.Json.JsonProperty("MsgSignature")]
[System.Text.Json.Serialization.JsonPropertyName("MsgSignature")]
public string Signature { get; set; } = default!;
}
private static TEvent InnerDeserializeEventFromJson<TEvent>(this WechatWorkClient client, string webhookJson)
where TEvent : WechatWorkEvent
{
if (client is null) throw new ArgumentNullException(nameof(client));
try
{
if (string.IsNullOrEmpty(client.Credentials.PushEncodingAESKey))
throw new WechatWorkException("Failed to decrypt event data, because the push encoding AES key is empty.");
InnerEncryptedEvent encryptedEvent = client.JsonSerializer.Deserialize<InnerEncryptedEvent>(webhookJson);
webhookJson = Utilities.WxMsgCryptor.AESDecrypt(cipherText: encryptedEvent.EncryptedData, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _);
return client.JsonSerializer.Deserialize<TEvent>(webhookJson);
}
catch (WechatWorkException)
{
throw;
}
catch (Exception ex)
{
throw new WechatWorkException("Failed to deserialize event data. Please see the inner exception for more details.", ex);
}
}
private static TEvent InnerDeserializeEventFromXml<TEvent>(this WechatWorkClient client, string webhookXml)
where TEvent : WechatWorkEvent
{
if (client is null) throw new ArgumentNullException(nameof(client));
try
{
if (!Utilities.WxMsgCryptor.TryParseXml(webhookXml, out string? encryptedXml))
throw new WechatWorkException("Failed to decrypt event data, because the encrypted data is empty.");
webhookXml = Utilities.WxMsgCryptor.AESDecrypt(cipherText: encryptedXml!, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _);
return Utilities.XmlHelper.Deserialize<TEvent>(webhookXml);
}
catch (WechatWorkException)
{
throw;
}
catch (Exception ex)
{
throw new WechatWorkException("Failed to deserialize event data. Please see the inner exception for more details.", ex);
}
}
}
}

View File

@ -24,15 +24,15 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.AgentId == null)
if (request.AgentId is null)
request.AgentId = client.Credentials.AgentId;
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "agent", "get")
.CreateFlurlRequest(request, HttpMethod.Get, "cgi-bin", "agent", "get")
.SetQueryParam("access_token", request.AccessToken)
.SetQueryParam("agentid", request.AgentId);
return await client.SendRequestWithJsonAsync<Models.CgibinAgentGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -51,10 +51,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "agent", "list")
.CreateFlurlRequest(request, HttpMethod.Get, "cgi-bin", "agent", "list")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAgentListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -70,14 +70,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.AgentId == null)
if (request.AgentId is null)
request.AgentId = client.Credentials.AgentId;
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "agent", "set")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "agent", "set")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAgentSetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentSetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -94,14 +94,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.AgentId == null)
if (request.AgentId is null)
request.AgentId = client.Credentials.AgentId;
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "agent", "set_scope")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "agent", "set_scope")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAgentSetScopeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentSetScopeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -118,10 +118,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "agent", "migrate_to_customized_app")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "agent", "migrate_to_customized_app")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAgentMigrateToCustomizedAppResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentMigrateToCustomizedAppResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -138,10 +138,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "agent", "get_permissions")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "agent", "get_permissions")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAgentGetPermissionsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentGetPermissionsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#region Workbench
@ -159,14 +159,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.AgentId == null)
if (request.AgentId is null)
request.AgentId = client.Credentials.AgentId;
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "agent", "set_workbench_template")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "agent", "set_workbench_template")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAgentSetWorkbenchTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentSetWorkbenchTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -183,14 +183,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.AgentId == null)
if (request.AgentId is null)
request.AgentId = client.Credentials.AgentId;
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "agent", "get_workbench_template")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "agent", "get_workbench_template")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAgentGetWorkbenchTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentGetWorkbenchTemplateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -207,14 +207,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.AgentId == null)
if (request.AgentId is null)
request.AgentId = client.Credentials.AgentId;
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "agent", "set_workbench_data")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "agent", "set_workbench_data")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAgentSetWorkbenchDataResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAgentSetWorkbenchDataResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
}

View File

@ -23,10 +23,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "appchat", "create")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "appchat", "create")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAppChatCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAppChatCreateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -43,10 +43,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "appchat", "update")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "appchat", "update")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAppChatUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAppChatUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -63,11 +63,11 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "appchat", "get")
.CreateFlurlRequest(request, HttpMethod.Get, "cgi-bin", "appchat", "get")
.SetQueryParam("access_token", request.AccessToken)
.SetQueryParam("chatid", request.ChatId);
return await client.SendRequestWithJsonAsync<Models.CgibinAppChatGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAppChatGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -84,10 +84,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "appchat", "send")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "appchat", "send")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAppChatSendResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAppChatSendResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
}
}

View File

@ -24,11 +24,11 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "auth", "getuserinfo")
.CreateFlurlRequest(request, HttpMethod.Get, "cgi-bin", "auth", "getuserinfo")
.SetQueryParam("access_token", request.AccessToken)
.SetQueryParam("code", request.Code);
return await client.SendRequestWithJsonAsync<Models.CgibinAuthGetUserInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAuthGetUserInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
@ -45,10 +45,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "auth", "getuserdetail")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "auth", "getuserdetail")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAuthGetUserDetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAuthGetUserDetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#region TAF
@ -66,10 +66,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "auth", "get_tfa_info")
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "auth", "get_tfa_info")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinAuthGetTAFInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinAuthGetTAFInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
}

Some files were not shown because too many files have changed in this diff Show More