This commit is contained in:
CortexCore
2024-07-12 19:32:02 +08:00
commit 170f05af0c
13 changed files with 440 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
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":"手动提交"
// }
// }
// }

60
Models/WeChatUserInfo.cs Normal file
View File

@@ -0,0 +1,60 @@
using Newtonsoft.Json;
namespace WeChatSharp;
[Serializable]
public struct WeChatUserInfo
{
[JsonProperty(propertyName: "subscribe")]
public int Subscribe { get; internal set; }
[JsonProperty(propertyName: "openid")]
public string OpenId { get; internal set; }
[JsonProperty(propertyName: "nickname")]
public string NickName{ get; internal set; }
[JsonProperty(propertyName: "sex")]
public int Sex { get; internal set; }
[JsonProperty(propertyName: "language")]
public string Language{ get; internal set; }
[JsonProperty(propertyName: "city")]
public string City{ get; internal set; }
[JsonProperty(propertyName: "province")]
public string Province{ get; internal set; }
[JsonProperty(propertyName: "country")]
public string Country{ get; internal set; }
[JsonProperty(propertyName: "headimgurl")]
public string HeadImgUrl{ get; internal set; }
[JsonProperty(propertyName: "subscribe_time")]
public int SubscribeTime{ get; internal set; }
[JsonProperty(propertyName: "remark")]
public string Remark{ get; internal set; }
[JsonProperty(propertyName: "groupid")]
public int GroupId{ get; internal set; }
[JsonProperty(propertyName: "tagid_list")]
public string[] TagIdList{ get; internal set; }
[JsonProperty(propertyName: "subscribe_scene")]
public string SubscribeScene{ get; internal set; }
[JsonProperty(propertyName: "qr_scene")]
public int QrScene{ get; internal set; }
[JsonProperty(propertyName: "qr_scene_str")]
public string QrSceneStr{ get; internal set; }
}
/*
{
"subscribe": 1,
"openid": "oY0tZ6_aqq_MEWsej9zJEY6OVspI",
"nickname": "",
"sex": 0,
"language": "zh_CN",
"city": "",
"province": "",
"country": "",
"headimgurl": "",
"subscribe_time": 1687668622,
"remark": "Root",
"groupid": 0,
"tagid_list": [],
"subscribe_scene": "ADD_SCENE_SEARCH",
"qr_scene": 0,
"qr_scene_str": ""
}
*/