feat(wxapi): 新增自定义交易组件商品系统下架回调通知的事件模型

This commit is contained in:
Fu Diwei 2021-12-15 16:01:55 +08:00
parent 38bb973d41
commit 6220d9afc2
3 changed files with 73 additions and 2 deletions

View File

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.open_product_spu_status_update 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/callback/spu_status_update.html </para>
/// </summary>
public class OpenProductSPUStatusUpdateEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
{
public static class Types
{
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("out_product_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_product_id")]
[System.Xml.Serialization.XmlElement("out_product_id")]
public string OutProductId { get; set; } = default!;
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_id")]
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
[System.Xml.Serialization.XmlElement("product_id")]
public long ProductId { 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; }
}
}
/// <summary>
/// 获取或设置事件数据。
/// </summary>
[Newtonsoft.Json.JsonProperty("OpenProductSpuAudit")]
[System.Text.Json.Serialization.JsonPropertyName("OpenProductSpuAudit")]
[System.Xml.Serialization.XmlElement("OpenProductSpuAudit")]
public Types.EventData EventData { get; set; } = default!;
}
}

View File

@ -24,8 +24,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <summary> /// <summary>
/// 获取或设置接收消息的用户 OpenId 列表。 /// 获取或设置接收消息的用户 OpenId 列表。
/// </summary> /// </summary>
[Newtonsoft.Json.JsonProperty("to_openid_list")] [Newtonsoft.Json.JsonProperty("touser")]
[System.Text.Json.Serialization.JsonPropertyName("to_openid_list")] [System.Text.Json.Serialization.JsonPropertyName("touser")]
public IList<string> ToUserOpenIdList { get; set; } = new List<string>(); public IList<string> ToUserOpenIdList { get; set; } = new List<string>();
/// <summary> /// <summary>

View File

@ -0,0 +1,13 @@
<xml>
<ToUserName>gh_abcdefg</ToUserName>
<FromUserName>oABCD</FromUserName>
<CreateTime>12344555555</CreateTime>
<MsgType>event</MsgType>
<Event>open_product_spu_status_update</Event>
<OpenProductSpuAudit>
<out_product_id>spu_123</out_product_id>
<product_id>38249023</product_id>
<status>13</status>
<reject_reason>xxx原因</reject_reason>
</OpenProductSpuAudit>
</xml>