feat(wxapi): 随官方更新微信小店推客带货相关接口模型

This commit is contained in:
Fu Diwei 2025-07-11 12:19:36 +08:00
parent 50af239021
commit b61cb273cd
13 changed files with 79 additions and 24 deletions

View File

@ -5710,6 +5710,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECPromoterGetCouponQrcodeResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /channels/ec/promoter/get_coupon_promoter_share_link 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/leagueheadsupplier/API/promotion/content/coupon/getcouponpromotersharelink.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECPromoterGetCouponPromoterShareLinkResponse> ExecuteChannelsECPromoterGetCouponPromoterShareLinkAsync(this WechatApiClient client, Models.ChannelsECPromoterGetCouponPromoterShareLinkRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "promoter", "get_coupon_promoter_share_link")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECPromoterGetCouponPromoterShareLinkResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#region ECPromoter/Feed

View File

@ -13,10 +13,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
public long PlanId { get; set; }
/// <summary>
/// 获取或设置相对于服务费的达人佣金率范围090
/// 获取或设置达人佣金率范围090
/// </summary>
[Newtonsoft.Json.JsonProperty("ratio_to_service_rate")]
[System.Text.Json.Serialization.JsonPropertyName("ratio_to_service_rate")]
public int RatioToServiceRate { get; set; }
[Newtonsoft.Json.JsonProperty("ratio")]
[System.Text.Json.Serialization.JsonPropertyName("ratio")]
public int Ratio { get; set; }
}
}

View File

@ -12,13 +12,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
public long ProductId { get; set; }
/// <summary>
/// 获取或设置小店 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置视频号 ID。
/// </summary>

View File

@ -0,0 +1,24 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/promoter/get_coupon_promoter_share_link 接口的请求。</para>
/// </summary>
public class ChannelsECPromoterGetCouponPromoterShareLinkRequest : WechatApiRequest, IInferable<ChannelsECPromoterGetCouponPromoterShareLinkRequest, ChannelsECPromoterGetCouponPromoterShareLinkResponse>
{
/// <summary>
/// 获取或设置推客的微信电商平台注册的身份标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("sharer_appid")]
[System.Text.Json.Serialization.JsonPropertyName("sharer_appid")]
public string? SharerAppId { get; set; }
/// <summary>
/// 获取或设置券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon_id")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))]
[System.Text.Json.Serialization.JsonPropertyName("coupon_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)]
public long CouponId { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/promoter/get_coupon_promoter_share_link 接口的响应。</para>
/// </summary>
public class ChannelsECPromoterGetCouponPromoterShareLinkResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置内嵌微信小店优惠券的推广参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("promoter_share_link")]
[System.Text.Json.Serialization.JsonPropertyName("promoter_share_link")]
public string PromoterShareLink { get; set; } = default!;
}
}

View File

@ -8,8 +8,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// <summary>
/// 获取或设置优惠券推广二维码 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("qr_code")]
[System.Text.Json.Serialization.JsonPropertyName("qr_code")]
[Newtonsoft.Json.JsonProperty("qrcode_url")]
[System.Text.Json.Serialization.JsonPropertyName("qrcode_url")]
public string QrcodeUrl { get; set; } = default!;
}
}

View File

@ -12,13 +12,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[System.Text.Json.Serialization.JsonPropertyName("sharer_appid")]
public string? SharerAppId { get; set; }
/// <summary>
/// 获取或设置推客的 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("sharer_openid")]
[System.Text.Json.Serialization.JsonPropertyName("sharer_openid")]
public string? SharerOpenId { get; set; }
/// <summary>
/// 获取或设置券 ID。
/// </summary>

View File

@ -1,5 +1,4 @@
{
"appid": "app1234",
"finder_id": "sph1234",
"openfinderid": "xxxxx",
"product_id": 1234

View File

@ -0,0 +1,4 @@
{
"coupon_id": "111111",
"sharer_appid": "推客的appid"
}

View File

@ -0,0 +1,5 @@
{
"errcode": "0",
"errmsg": "ok",
"promoter_share_link": "SHORTLINK"
}

View File

@ -1,5 +1,5 @@
{
"errcode": "0",
"errmsg": "ok",
"qr_code": "QRCODEURL"
"qrcode_url": "QRCODEURL"
}

View File

@ -1,5 +1,4 @@
{
"coupon_id": "1111111",
"sharer_openid": "推客的当前小程序openid",
"sharer_appid": "推客的appid"
}