feat(wxapi): 新增自定义交易组件设置小程序分享模式接口

This commit is contained in:
fudiwei
2022-12-01 22:42:32 +08:00
parent 8a31a5937e
commit 488324b283
5 changed files with 102 additions and 1 deletions

View File

@@ -0,0 +1,63 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Events
{
/// <summary>
/// <para>表示 EVENT.miniprogram_sharer_action 事件的数据。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/sharer/share_attribute.html </para>
/// </summary>
public class MiniProgramSharerActionsEvent : WechatApiEvent, WechatApiEvent.Serialization.IJsonSerializable, WechatApiEvent.Serialization.IXmlSerializable
{
public static class Types
{
public class Promoter
{
/// <summary>
/// 获取或设置推广员昵称。
/// </summary>
[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; }
/// <summary>
/// 获取或设置推广员 ID。
/// </summary>
[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; }
/// <summary>
/// 获取或设置推广员 OpenId。
/// </summary>
[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; }
}
}
/// <summary>
/// 获取或设置操作类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
[System.Xml.Serialization.XmlElement("type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置分享员 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
[System.Xml.Serialization.XmlElement("openid")]
public string SharerOpenId { get; set; } = default!;
/// <summary>
/// 获取或设置分享者的 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("promoter")]
[System.Text.Json.Serialization.JsonPropertyName("promoter")]
[System.Xml.Serialization.XmlElement("promoter")]
public Types.Promoter Promoter { get; set; } = default!;
}
}

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/sharer/set_share_mode 接口的请求。</para>
/// </summary>
public class ShopSharerSetShareModeRequest : WechatApiRequest, IInferable<ShopSharerSetShareModeRequest, ShopSharerSetShareModeResponse>
{
/// <summary>
/// 获取或设置分享模式。
/// </summary>
[Newtonsoft.Json.JsonProperty("share_mode")]
[System.Text.Json.Serialization.JsonPropertyName("share_mode")]
public int ShareMode { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/sharer/set_share_mode 接口的响应。</para>
/// </summary>
public class ShopSharerSetShareModeResponse : WechatApiResponse
{
}
}

View File

@@ -0,0 +1,14 @@
<xml>
<ToUserName>gh_abcdefg</ToUserName>
<FromUserName>1asdaf2141noejgeroig_0</FromUserName>
<CreateTime>12344555555</CreateTime>
<MsgType>event</MsgType>
<Event>miniprogram_sharer_action</Event>
<type>1</type>
<openid>ogewrgsragasrg</openid>
<promoter>
<finder_nickname>XXXXXXXXXXXXXX</finder_nickname>
<promoter_id>a-**************po</promoter_id>
<promoter_openid>osagsadfasdfas</promoter_openid>
</promoter>
</xml>