mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 14:04:32 +08:00
fix(wxapi): 修复部分微信回调通知事件模型的序列化错误
This commit is contained in:
parent
4374199994
commit
9b658efa3d
@ -11,7 +11,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Article
|
||||
public class ArticleItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图文链接。
|
||||
@ -37,6 +37,15 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
[System.Xml.Serialization.XmlElement("Description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class ArticleList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图文列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("item", Type = typeof(ArticleItem))]
|
||||
public ArticleItem[] Items { get; set; } = new ArticleItem[0];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -48,9 +57,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// <summary>
|
||||
/// 获取或设置图文列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("Articles")]
|
||||
[System.Xml.Serialization.XmlArrayItem("item")]
|
||||
public Types.Article[] ArticleList { get; set; } = new Types.Article[0];
|
||||
[System.Xml.Serialization.XmlElement("Articles")]
|
||||
public Types.ArticleList ArticleList { get; set; } = new Types.ArticleList();
|
||||
|
||||
public NewsMessageReply()
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Data
|
||||
public class EventData
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
@ -40,7 +40,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("List")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("List")]
|
||||
[System.Xml.Serialization.XmlArray("List")]
|
||||
[System.Xml.Serialization.XmlElement("List", typeof(Types.EventItem))]
|
||||
public Types.EventItem[] EventList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@ -51,6 +51,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
[Newtonsoft.Json.JsonProperty("SubscribeMsgChangeEvent")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("SubscribeMsgChangeEvent")]
|
||||
[System.Xml.Serialization.XmlElement("SubscribeMsgChangeEvent")]
|
||||
public Types.Data EventData { get; set; } = default!;
|
||||
public Types.EventData EventData { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Data
|
||||
public class EventData
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
@ -48,7 +48,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("List")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("List")]
|
||||
[System.Xml.Serialization.XmlArray("List")]
|
||||
[System.Xml.Serialization.XmlElement("List", typeof(Types.EventItem))]
|
||||
public Types.EventItem[] EventList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@ -59,6 +59,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
[Newtonsoft.Json.JsonProperty("SubscribeMsgPopupEvent")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("SubscribeMsgPopupEvent")]
|
||||
[System.Xml.Serialization.XmlElement("SubscribeMsgPopupEvent")]
|
||||
public Types.Data EventData { get; set; } = default!;
|
||||
public Types.EventData EventData { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class Data
|
||||
public class EventData
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
@ -56,7 +56,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("List")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("List")]
|
||||
[System.Xml.Serialization.XmlArray("List")]
|
||||
[System.Xml.Serialization.XmlElement("List", typeof(Types.EventItem))]
|
||||
public Types.EventItem[] EventList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@ -67,6 +67,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
[Newtonsoft.Json.JsonProperty("SubscribeMsgSentEvent")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("SubscribeMsgSentEvent")]
|
||||
[System.Xml.Serialization.XmlElement("SubscribeMsgSentEvent")]
|
||||
public Types.Data EventData { get; set; } = default!;
|
||||
public Types.EventData EventData { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
@ -34,8 +34,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// <summary>
|
||||
/// 获取或设置错误信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("msg")]
|
||||
[System.Xml.Serialization.XmlElement("msg", IsNullable = true)]
|
||||
public string? ErrorMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权成功后生成的 Ticket。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("ticket", IsNullable = true)]
|
||||
public string? Ticket { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class EventData : BetaAppAuthorizationApplyEvent.Types.EventData
|
||||
public class EventData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置小程序的 AppId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("appid")]
|
||||
public string MiniProgramAppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公众号的 AppId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("mp_appid")]
|
||||
public string MediaPlatformAppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误码。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("status")]
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("msg")]
|
||||
public string? ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class EventData : BetaAppAuthorizationApplyEvent.Types.EventData
|
||||
public class EventData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置小程序的 AppId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("appid")]
|
||||
public string MiniProgramAppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公众号的 AppId。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("mp_appid")]
|
||||
public string MediaPlatformAppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误码。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("status")]
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误信息。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("msg")]
|
||||
public string? ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// <summary>
|
||||
/// 获取或设置审核失败的原因。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlElement("FailTime", IsNullable = true)]
|
||||
[System.Xml.Serialization.XmlElement("Reason", IsNullable = true)]
|
||||
public string? FailReason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -52,7 +52,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// <summary>
|
||||
/// 获取或设置证明材料 MediaId 列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("proof_material_ids")]
|
||||
[System.Xml.Serialization.XmlElement("proof_material_id", Type = typeof(string))]
|
||||
public string[] ProofMediaIdList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@ -90,7 +90,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// <summary>
|
||||
/// 获取或设置申诉材料列表。
|
||||
/// </summary>
|
||||
[System.Xml.Serialization.XmlArray("materials", IsNullable = true)]
|
||||
[System.Xml.Serialization.XmlElement("material", Type = typeof(Types.Material), IsNullable = true)]
|
||||
public Types.Material[]? MaterialList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -11,8 +11,24 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
{
|
||||
public new static class Types
|
||||
{
|
||||
public class EventData : OpenProductCategoryAuditEvent.Types.EventData
|
||||
public class EventData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置审核状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
[System.Xml.Serialization.XmlElement("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审核单 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("audit_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("audit_id")]
|
||||
[System.Xml.Serialization.XmlElement("audit_id")]
|
||||
public string AuditId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置品牌 ID。
|
||||
/// </summary>
|
||||
@ -20,6 +36,22 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
[System.Text.Json.Serialization.JsonPropertyName("brand_id")]
|
||||
[System.Xml.Serialization.XmlElement("brand_id")]
|
||||
public int BrandId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置审核单类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("audit_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("audit_type")]
|
||||
[System.Xml.Serialization.XmlElement("audit_type")]
|
||||
public int AuditType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置拒绝原因。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("reject_reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("reject_reason")]
|
||||
[System.Xml.Serialization.XmlElement("reject_reason")]
|
||||
public string? RejectReason { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("Actions")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("Actions")]
|
||||
[System.Xml.Serialization.XmlArray("Actions")]
|
||||
[System.Xml.Serialization.XmlElement("Actions", Type = typeof(Types.Action))]
|
||||
public Types.Action[] ActionList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("DetailList")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("DetailList")]
|
||||
[System.Xml.Serialization.XmlArray("DetailList", IsNullable = true)]
|
||||
[System.Xml.Serialization.XmlElement("DetailList", Type = typeof(Types.GoodsDetail))]
|
||||
public Types.GoodsDetail[]? GoodsDetailList { get; set; }
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
<xml>
|
||||
<ToUserName><![CDATA[toUser]]></ToUserName>
|
||||
<FromUserName><![CDATA[fromUser]]></FromUserName>
|
||||
<CreateTime>时间戳</CreateTime>
|
||||
<CreateTime>1234567890</CreateTime>
|
||||
<MsgType><![CDATA[event]]></MsgType>
|
||||
<Event><![CDATA[betaapp_verify_event]]></Event>
|
||||
<ApplyAuthorizationInfoNoitfy>
|
||||
<appid>![CDATA[小程序appid]]</appid>
|
||||
<mp_appid>![CDATA[公众号appid]]</mp_appid>
|
||||
<status>![CDATA[0]]</status>
|
||||
<msg>![CDATA[ok]]</msg>
|
||||
<operation_time>![CDATA[操作的时间]]</operation_time>
|
||||
<appid><![CDATA[小程序appid]]></appid>
|
||||
<mp_appid><![CDATA[公众号appid]]></mp_appid>
|
||||
<status><![CDATA[0]]></status>
|
||||
<msg><![CDATA[ok]]></msg>
|
||||
<operation_time><![CDATA[操作的时间]]></operation_time>
|
||||
</ApplyAuthorizationInfoNoitfy>
|
||||
</xml>
|
@ -1,13 +1,13 @@
|
||||
<xml>
|
||||
<ToUserName><![CDATA[toUser]]></ToUserName>
|
||||
<FromUserName><![CDATA[fromUser]]></FromUserName>
|
||||
<CreateTime>时间戳</CreateTime>
|
||||
<CreateTime>1234567890</CreateTime>
|
||||
<MsgType><![CDATA[event]]></MsgType>
|
||||
<Event><![CDATA[betaapp_verify_apply_event]]></Event>
|
||||
<ApplyAuthorizationInfoNoitfy>
|
||||
<appid>![CDATA[小程序appid]]</appid>
|
||||
<mp_appid>![CDATA[公众号appid]]</mp_appid>
|
||||
<status>![CDATA[公众号appid]]</status>
|
||||
<operation_time>![CDATA[操作的时间]]</operation_time>
|
||||
<appid><![CDATA[小程序appid]]></appid>
|
||||
<mp_appid><![CDATA[公众号appid]]></mp_appid>
|
||||
<status><![CDATA[0]]></status>
|
||||
<operation_time><![CDATA[操作的时间]]></operation_time>
|
||||
</ApplyAuthorizationInfoNoitfy>
|
||||
</xml>
|
@ -1,14 +1,14 @@
|
||||
<xml>
|
||||
<ToUserName><![CDATA[toUser]]></ToUserName>
|
||||
<FromUserName><![CDATA[fromUser]]></FromUserName>
|
||||
<CreateTime>时间戳</CreateTime>
|
||||
<CreateTime>1234567890</CreateTime>
|
||||
<MsgType><![CDATA[event]]></MsgType>
|
||||
<Event><![CDATA[betaapp_verify_event]]></Event>
|
||||
<ApplyAuthorizationInfoNoitfy>
|
||||
<appid>![CDATA[小程序appid]]</appid>
|
||||
<mp_appid>![CDATA[公众号appid]]</mp_appid>
|
||||
<status>![CDATA[0]]</status>
|
||||
<msg>![CDATA[ok]]</msg>
|
||||
<operation_time>![CDATA[操作的时间]]</operation_time>
|
||||
<appid><![CDATA[小程序appid]]></appid>
|
||||
<mp_appid><![CDATA[公众号appid]]></mp_appid>
|
||||
<status><![CDATA[0]]></status>
|
||||
<msg><![CDATA[ok]]></msg>
|
||||
<operation_time><![CDATA[操作的时间]]></operation_time>
|
||||
</ApplyAuthorizationInfoNoitfy>
|
||||
</xml>
|
@ -9,8 +9,8 @@
|
||||
<appeal_time>1600055800</appeal_time>
|
||||
<appeal_count>1</appeal_count>
|
||||
<appeal_from>0</appeal_from>
|
||||
<appeal_status>1|2|3|4</appeal_status>
|
||||
<punish_description>内容涉嫌欺诈</punish_description>
|
||||
<appeal_status>1</appeal_status>
|
||||
<punish_description><![CDATA[内容涉嫌欺诈]]></punish_description>
|
||||
<material>
|
||||
<illegal_material>
|
||||
<content>违规内容1</content>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<MsgType><![CDATA[event]]></MsgType>
|
||||
<Event><![CDATA[wxa_category_audit]]></Event>
|
||||
<ret>2</ret>
|
||||
<first>一级类目id</first>
|
||||
<second>二级类目id</second>
|
||||
<reason>驳回原因</reason>
|
||||
<first>1</first>
|
||||
<second>2</second>
|
||||
<reason><![CDATA[驳回原因]]></reason>
|
||||
</xml>
|
@ -221,11 +221,11 @@ namespace SKIT.FlurlHttpClient.Wechat
|
||||
{
|
||||
using StringReader reader = new StringReader(xml);
|
||||
XmlSerializer xmlSerializer = new XmlSerializer(type, new XmlRootAttribute("xml"));
|
||||
xmlSerializer.Deserialize(reader);
|
||||
var obj = xmlSerializer.Deserialize(reader);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
exception = new Exception($"XML 反序列化 `{type.Name}` 遇到问题。", ex);
|
||||
lstError.Add(new Exception($"XML 反序列化 `{type.Name}` 遇到问题。", ex));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user