feat(wxapi): 新增授权用户资料变更的回调通知事件模型

This commit is contained in:
fudiwei 2021-09-11 17:52:26 +08:00
parent bbd2d48087
commit ae0325d638
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.user_info_modified 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Mobile_App/WeChat_Login/authorization_change.html </para>
/// <para>REF: https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/authorization_change.html </para>
/// </summary>
public class UserInfoModifiedEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
{
/// <summary>
/// 获取或设置微信 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
[System.Xml.Serialization.XmlElement("appid")]
public string AppId { get; set; } = default!;
/// <summary>
/// 获取或设置用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
[System.Xml.Serialization.XmlElement("openid")]
public string OpenId { get; set; } = default!;
}
}

View File

@ -0,0 +1,9 @@
{
"ToUserName": "gh_SDK_870882ca4b1",
"FromUserName": "oaKk346BaWE-eIn4oSRWbaM9vR7s",
"CreateTime": 1627359464,
"MsgType": "event",
"Event": "user_info_modified",
"openid": "oaKk343WOktAaT2ygsX138BGblrg",
"appid" : "wx13974bf780d3dc89"
}

View File

@ -0,0 +1,9 @@
<xml>
<ToUserName><![CDATA[gh_SDK_870882ca4b1]]></ToUserName>
<FromUserName><![CDATA[owAqB1v0ahK_Xlc7GshIDdf2yf7E]]></FromUserName>
<CreateTime>1626857200</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[user_info_modified]]></Event>
<openid><![CDATA[owAqB1nqaOYYWl0Ng484G2z5NIwU]]></openid>
<appid><![CDATA[wx13974bf780d3dc89]]></appid>
</xml>