diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index 23be464f..94bc3024 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -5710,6 +5710,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// 异步调用 [POST] /channels/ec/promoter/get_coupon_promoter_share_link 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task 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(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } #endregion #region ECPromoter/Feed diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLeague/HeadSupplier/SubItem/ChannelsECLeagueHeadSupplierSubItemAddRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLeague/HeadSupplier/SubItem/ChannelsECLeagueHeadSupplierSubItemAddRequest.cs index 7c6b8cd6..235bf418 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLeague/HeadSupplier/SubItem/ChannelsECLeagueHeadSupplierSubItemAddRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLeague/HeadSupplier/SubItem/ChannelsECLeagueHeadSupplierSubItemAddRequest.cs @@ -13,10 +13,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models public long PlanId { get; set; } /// - /// 获取或设置相对于服务费的达人佣金率(范围:0~90)。 + /// 获取或设置达人佣金率(范围:0~90)。 /// - [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; } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLeague/HeadSupplier/Window/ChannelsECLeagueHeadSupplierWindowAddRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLeague/HeadSupplier/Window/ChannelsECLeagueHeadSupplierWindowAddRequest.cs index 52d20487..a083b883 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLeague/HeadSupplier/Window/ChannelsECLeagueHeadSupplierWindowAddRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLeague/HeadSupplier/Window/ChannelsECLeagueHeadSupplierWindowAddRequest.cs @@ -12,13 +12,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models [System.Text.Json.Serialization.JsonPropertyName("product_id")] public long ProductId { get; set; } - /// - /// 获取或设置小店 AppId。 - /// - [Newtonsoft.Json.JsonProperty("appid")] - [System.Text.Json.Serialization.JsonPropertyName("appid")] - public string AppId { get; set; } = string.Empty; - /// /// 获取或设置视频号 ID。 /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkRequest.cs new file mode 100644 index 00000000..bc5b2f31 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkRequest.cs @@ -0,0 +1,24 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/promoter/get_coupon_promoter_share_link 接口的请求。 + /// + public class ChannelsECPromoterGetCouponPromoterShareLinkRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置推客的微信电商平台注册的身份标识。 + /// + [Newtonsoft.Json.JsonProperty("sharer_appid")] + [System.Text.Json.Serialization.JsonPropertyName("sharer_appid")] + public string? SharerAppId { get; set; } + + /// + /// 获取或设置券 ID。 + /// + [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; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkResponse.cs new file mode 100644 index 00000000..e42f308c --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkResponse.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/promoter/get_coupon_promoter_share_link 接口的响应。 + /// + public class ChannelsECPromoterGetCouponPromoterShareLinkResponse : WechatApiResponse + { + /// + /// 获取或设置内嵌微信小店优惠券的推广参数。 + /// + [Newtonsoft.Json.JsonProperty("promoter_share_link")] + [System.Text.Json.Serialization.JsonPropertyName("promoter_share_link")] + public string PromoterShareLink { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponQrcodeResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponQrcodeResponse.cs index 64bdafa1..b5284055 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponQrcodeResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponQrcodeResponse.cs @@ -8,8 +8,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// /// 获取或设置优惠券推广二维码 URL。 /// - [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!; } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponShortLinkRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponShortLinkRequest.cs index 9083b617..3668c7f8 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponShortLinkRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponShortLinkRequest.cs @@ -12,13 +12,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models [System.Text.Json.Serialization.JsonPropertyName("sharer_appid")] public string? SharerAppId { get; set; } - /// - /// 获取或设置推客的 OpenId。 - /// - [Newtonsoft.Json.JsonProperty("sharer_openid")] - [System.Text.Json.Serialization.JsonPropertyName("sharer_openid")] - public string? SharerOpenId { get; set; } - /// /// 获取或设置券 ID。 /// diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLeague/HeadSupplier/SubItem/ChannelsECLeagueHeadSupplierSubItemAddRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLeague/HeadSupplier/SubItem/ChannelsECLeagueHeadSupplierSubItemAddRequest.json index 3ed61ded..84994ca7 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLeague/HeadSupplier/SubItem/ChannelsECLeagueHeadSupplierSubItemAddRequest.json +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLeague/HeadSupplier/SubItem/ChannelsECLeagueHeadSupplierSubItemAddRequest.json @@ -1,4 +1,4 @@ { "id": 0, - "ratio_to_service_rate": 100 + "ratio": 100 } diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLeague/HeadSupplier/Window/ChannelsECLeagueHeadSupplierWindowAddRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLeague/HeadSupplier/Window/ChannelsECLeagueHeadSupplierWindowAddRequest.json index aabc1d03..c57e3bb0 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLeague/HeadSupplier/Window/ChannelsECLeagueHeadSupplierWindowAddRequest.json +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLeague/HeadSupplier/Window/ChannelsECLeagueHeadSupplierWindowAddRequest.json @@ -1,5 +1,4 @@ { - "appid": "app1234", "finder_id": "sph1234", "openfinderid": "xxxxx", "product_id": 1234 diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkRequest.json new file mode 100644 index 00000000..778bb34f --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkRequest.json @@ -0,0 +1,4 @@ +{ + "coupon_id": "111111", + "sharer_appid": "推客的appid" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkResponse.json new file mode 100644 index 00000000..7a7139eb --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponPromoterShareLinkResponse.json @@ -0,0 +1,5 @@ +{ + "errcode": "0", + "errmsg": "ok", + "promoter_share_link": "SHORTLINK" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponQrcodeResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponQrcodeResponse.json index 03a54917..e9b5765a 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponQrcodeResponse.json +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponQrcodeResponse.json @@ -1,5 +1,5 @@ { "errcode": "0", "errmsg": "ok", - "qr_code": "QRCODEURL" + "qrcode_url": "QRCODEURL" } diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponShortLinkRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponShortLinkRequest.json index 10b0459b..147b3395 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponShortLinkRequest.json +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Coupon/ChannelsECPromoterGetCouponShortLinkRequest.json @@ -1,5 +1,4 @@ { "coupon_id": "1111111", - "sharer_openid": "推客的当前小程序openid", "sharer_appid": "推客的appid" }