2023-03-29 20:01:51 +08:00
|
|
|
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
2021-05-28 19:23:28 +08:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>表示 EVENT.subscribe_msg_sent_event 事件的数据。</para>
|
|
|
|
|
/// <para>REF: https://developers.weixin.qq.com/doc/offiaccount/Subscription_Messages/api.html#%E4%BA%8B%E4%BB%B6%E6%8E%A8%E9%80%81 </para>
|
|
|
|
|
/// </summary>
|
2024-01-29 23:11:56 +08:00
|
|
|
public class SubscribeMessageSentEvent : WechatApiEvent
|
2021-05-28 19:23:28 +08:00
|
|
|
{
|
2021-08-26 11:15:17 +08:00
|
|
|
public static class Types
|
2021-05-28 19:23:28 +08:00
|
|
|
{
|
2021-07-30 21:12:51 +08:00
|
|
|
public class EventData
|
2021-05-28 19:23:28 +08:00
|
|
|
{
|
|
|
|
|
public static class Types
|
|
|
|
|
{
|
|
|
|
|
public class EventItem
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取或设置订阅消息模板 ID。
|
|
|
|
|
/// </summary>
|
2021-06-07 00:34:41 +08:00
|
|
|
[Newtonsoft.Json.JsonProperty("TemplateId")]
|
|
|
|
|
[System.Text.Json.Serialization.JsonPropertyName("TemplateId")]
|
2021-05-28 19:23:28 +08:00
|
|
|
[System.Xml.Serialization.XmlElement("TemplateId")]
|
|
|
|
|
public string TemplateId { get; set; } = default!;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取或设置消息 ID。
|
|
|
|
|
/// </summary>
|
2021-06-07 00:34:41 +08:00
|
|
|
[Newtonsoft.Json.JsonProperty("MsgID")]
|
|
|
|
|
[System.Text.Json.Serialization.JsonPropertyName("MsgID")]
|
2021-05-28 19:23:28 +08:00
|
|
|
[System.Xml.Serialization.XmlElement("MsgID")]
|
|
|
|
|
public long? MessageId { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取或设置推送结果状态码。
|
|
|
|
|
/// </summary>
|
2021-06-07 00:34:41 +08:00
|
|
|
[Newtonsoft.Json.JsonProperty("ErrorCode")]
|
|
|
|
|
[System.Text.Json.Serialization.JsonPropertyName("ErrorCode")]
|
2021-05-28 19:23:28 +08:00
|
|
|
[System.Xml.Serialization.XmlElement("ErrorCode")]
|
|
|
|
|
public int ErrorCode { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取或设置推送结果状态含义。
|
|
|
|
|
/// </summary>
|
2021-06-07 00:34:41 +08:00
|
|
|
[Newtonsoft.Json.JsonProperty("ErrorStatus")]
|
|
|
|
|
[System.Text.Json.Serialization.JsonPropertyName("ErrorStatus")]
|
2021-05-28 19:23:28 +08:00
|
|
|
[System.Xml.Serialization.XmlElement("ErrorStatus")]
|
|
|
|
|
public string ErrorMessage { get; set; } = default!;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取或设置发送订阅通知数据列表。
|
|
|
|
|
/// </summary>
|
2022-10-12 21:19:37 +08:00
|
|
|
[Newtonsoft.Json.JsonIgnore]
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
2021-07-30 21:12:51 +08:00
|
|
|
[System.Xml.Serialization.XmlElement("List", typeof(Types.EventItem))]
|
2021-05-28 19:23:28 +08:00
|
|
|
public Types.EventItem[] EventList { get; set; } = default!;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-12 21:19:37 +08:00
|
|
|
private readonly object _lockObj = new object();
|
|
|
|
|
|
2021-05-28 19:23:28 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 获取或设置事件数据。
|
|
|
|
|
/// </summary>
|
2022-10-12 21:19:37 +08:00
|
|
|
[Newtonsoft.Json.JsonIgnore]
|
|
|
|
|
[System.Text.Json.Serialization.JsonIgnore]
|
2021-05-28 19:23:28 +08:00
|
|
|
[System.Xml.Serialization.XmlElement("SubscribeMsgSentEvent")]
|
2021-07-30 21:12:51 +08:00
|
|
|
public Types.EventData EventData { get; set; } = default!;
|
2022-10-12 21:19:37 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取或设置发送订阅通知数据列表。
|
2023-03-29 20:01:51 +08:00
|
|
|
/// <para>等效于 <see cref="Types.EventData.EventList"/> </para>
|
2022-10-12 21:19:37 +08:00
|
|
|
/// </summary>
|
|
|
|
|
[Newtonsoft.Json.JsonProperty("List")]
|
|
|
|
|
[System.Text.Json.Serialization.JsonPropertyName("List")]
|
|
|
|
|
[System.Xml.Serialization.XmlIgnore]
|
|
|
|
|
public Types.EventData.Types.EventItem[]? EventDataList
|
|
|
|
|
{
|
|
|
|
|
get { return this.EventData?.EventList; }
|
|
|
|
|
set
|
|
|
|
|
{
|
2024-01-29 23:11:56 +08:00
|
|
|
if (this.EventData is null)
|
2022-10-12 21:19:37 +08:00
|
|
|
{
|
|
|
|
|
lock (_lockObj)
|
|
|
|
|
{
|
2024-01-29 23:11:56 +08:00
|
|
|
if (this.EventData is null)
|
2022-10-12 21:19:37 +08:00
|
|
|
{
|
|
|
|
|
this.EventData = new Types.EventData();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.EventData.EventList = value!;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-28 19:23:28 +08:00
|
|
|
}
|
|
|
|
|
}
|