diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/MiniProgramSharerActionsEvent.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/MiniProgramSharerActionsEvent.cs new file mode 100644 index 00000000..965c5c67 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Events/OpenProduct/MiniProgramSharerActionsEvent.cs @@ -0,0 +1,63 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Events +{ + /// + /// 表示 EVENT.miniprogram_sharer_action 事件的数据。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/sharer/share_attribute.html + /// + public class MiniProgramSharerActionsEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable + { + public static class Types + { + public class Promoter + { + /// + /// 获取或设置推广员昵称。 + /// + [Newtonsoft.Json.JsonProperty("finder_nickname")] + [System.Text.Json.Serialization.JsonPropertyName("finder_nickname")] + [System.Xml.Serialization.XmlElement("finder_nickname", IsNullable = true)] + public string? FinderNickname { get; set; } + + /// + /// 获取或设置推广员 ID。 + /// + [Newtonsoft.Json.JsonProperty("promoter_id")] + [System.Text.Json.Serialization.JsonPropertyName("promoter_id")] + [System.Xml.Serialization.XmlElement("promoter_id", IsNullable = true)] + public string? PromoterId { get; set; } + + /// + /// 获取或设置推广员 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("promoter_openid")] + [System.Text.Json.Serialization.JsonPropertyName("promoter_openid")] + [System.Xml.Serialization.XmlElement("promoter_openid", IsNullable = true)] + public string? PromoterOpenId { get; set; } + } + } + + /// + /// 获取或设置操作类型。 + /// + [Newtonsoft.Json.JsonProperty("type")] + [System.Text.Json.Serialization.JsonPropertyName("type")] + [System.Xml.Serialization.XmlElement("type")] + public int Type { get; set; } + + /// + /// 获取或设置分享员 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("openid")] + [System.Text.Json.Serialization.JsonPropertyName("openid")] + [System.Xml.Serialization.XmlElement("openid")] + public string SharerOpenId { get; set; } = default!; + + /// + /// 获取或设置分享者的 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("promoter")] + [System.Text.Json.Serialization.JsonPropertyName("promoter")] + [System.Xml.Serialization.XmlElement("promoter")] + public Types.Promoter Promoter { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/SPU/ShopSPUAddRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/SPU/ShopSPUAddRequest.cs index aa4c9c90..c30cb954 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/SPU/ShopSPUAddRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/SPU/ShopSPUAddRequest.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace SKIT.FlurlHttpClient.Wechat.Api.Models { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Sharer/ShopSharerSetShareModeRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Sharer/ShopSharerSetShareModeRequest.cs new file mode 100644 index 00000000..ecaad34b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Sharer/ShopSharerSetShareModeRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /shop/sharer/set_share_mode 接口的请求。 + /// + public class ShopSharerSetShareModeRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置分享模式。 + /// + [Newtonsoft.Json.JsonProperty("share_mode")] + [System.Text.Json.Serialization.JsonPropertyName("share_mode")] + public int ShareMode { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Sharer/ShopSharerSetShareModeResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Sharer/ShopSharerSetShareModeResponse.cs new file mode 100644 index 00000000..d4c957b4 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Sharer/ShopSharerSetShareModeResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /shop/sharer/set_share_mode 接口的响应。 + /// + public class ShopSharerSetShareModeResponse : WechatApiResponse + { + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/MiniProgramSharerActionsEvent.xml b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/MiniProgramSharerActionsEvent.xml new file mode 100644 index 00000000..48e4bab3 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/EventSamples/OpenProduct/MiniProgramSharerActionsEvent.xml @@ -0,0 +1,14 @@ + + gh_abcdefg + 1asdaf2141noejgeroig_0 + 12344555555 + event + miniprogram_sharer_action + 1 + ogewrgsragasrg + + XXXXXXXXXXXXXX + a-**************po + osagsadfasdfas + +