WechatSharp/Models/WeChatTemplateMessage.cs

52 lines
1.1 KiB
C#

using System.Text.Json.Serialization;
using Newtonsoft.Json;
using WeChatSharp.Interfaces;
namespace WeChatSharp;
public struct WeChatTemplateMessageData
{
public WeChatTemplateMessageData(string value)
{
this.value = value;
}
/// <summary>
/// 值
/// </summary>
public string value { get; set; }
}
public struct WeChatTemplateMessage: IWeChatTemplateMessage
{
[JsonProperty("touser")]
public string ToUser { get; set; }
[JsonProperty("template_id")]
public string TemplateId { get; set; }
[JsonProperty("url")]
public string Url { get; set; }
[JsonProperty("client_msg_id")]
public string ClientMsgId { get; set; }
[JsonProperty("data")]
public IDictionary<string, WeChatTemplateMessageData> Data { get; set; }
}
// {
// "touser":"oY0tZ6_aqq_MEWsej9zJEY6OVspI",
// "template_id":"TA6ogf8kMiB31M0oQ8WCxteITUauajrtuGL1LtptNg0",
// "url":"http://weixin.qq.com/download",
// "client_msg_id":"MSG_000002",
// "data":{
//
// "character_string5":{
// "value":"202307251515"
// },
// "thing4": {
// "value":"已创建"
// },
// "thing9": {
// "value":"CAICT"
// },
// "phrase13":{
// "value":"手动提交"
// }
// }
// }