diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenPush/UserInfoModifiedEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenPush/UserInfoModifiedEvent.cs new file mode 100644 index 00000000..760eecab --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenPush/UserInfoModifiedEvent.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.user_info_modified 事件的数据。 + /// REF: https://developers.weixin.qq.com/doc/oplatform/Mobile_App/WeChat_Login/authorization_change.html + /// REF: https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/authorization_change.html + /// + public class UserInfoModifiedEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + /// + /// 获取或设置微信 AppId。 + /// + [Newtonsoft.Json.JsonProperty("appid")] + [System.Text.Json.Serialization.JsonPropertyName("appid")] + [System.Xml.Serialization.XmlElement("appid")] + public string AppId { get; set; } = default!; + + /// + /// 获取或设置用户 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("openid")] + [System.Text.Json.Serialization.JsonPropertyName("openid")] + [System.Xml.Serialization.XmlElement("openid")] + public string OpenId { get; set; } = default!; + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenPush/UserInfoModifiedEvent.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenPush/UserInfoModifiedEvent.json new file mode 100644 index 00000000..0f44be04 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenPush/UserInfoModifiedEvent.json @@ -0,0 +1,9 @@ +{ + "ToUserName": "gh_SDK_870882ca4b1", + "FromUserName": "oaKk346BaWE-eIn4oSRWbaM9vR7s", + "CreateTime": 1627359464, + "MsgType": "event", + "Event": "user_info_modified", + "openid": "oaKk343WOktAaT2ygsX138BGblrg", + "appid" : "wx13974bf780d3dc89" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenPush/UserInfoModifiedEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenPush/UserInfoModifiedEvent.xml new file mode 100644 index 00000000..87263a74 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenPush/UserInfoModifiedEvent.xml @@ -0,0 +1,9 @@ + + + + 1626857200 + + + + +