From dcfea90d8ce590f942a71ff6b0ed5f7031ebded1 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 29 Sep 2025 21:35:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=B0=8F=E5=BA=97=E7=94=9F=E6=88=90=E6=9F=90=E4=B8=AA?= =?UTF-8?q?=E8=BE=BE=E4=BA=BA=E5=B9=B3=E5=8F=B0=E7=9A=84=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=A2=84=E7=BA=A6=E7=9A=84=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...echatApiClientExecuteChannelsExtensions.cs | 25 ++++++++++++- ...erGetLiveNoticePromoterShareLinkRequest.cs | 36 +++++++++++++++++++ ...rGetLiveNoticePromoterShareLinkResponse.cs | 15 ++++++++ ...oterGetLiveNoticeReservationInfoRequest.cs | 2 +- ...GetLiveNoticePromoterShareLinkRequest.json | 6 ++++ ...etLiveNoticePromoterShareLinkResponse.json | 5 +++ 6 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkResponse.json diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index 3e09857e..9655b941 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -6005,6 +6005,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + /// + /// 异步调用 [POST] /channels/ec/promoter/get_live_notice_promoter_share_link 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECPromoterGetLiveNoticePromoterShareLinkAsync(this WechatApiClient client, Models.ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest 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_live_notice_promoter_share_link") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + /// /// 异步调用 [POST] /channels/ec/promoter/get_shop_live_record_list 接口。 /// @@ -6124,7 +6147,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api /// 异步调用 [POST] /channels/ec/promoter/get_shop_live_notice_promoter_share_link 接口。 /// /// REF:
- /// + /// ///
///
/// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest.cs new file mode 100644 index 00000000..df127732 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest.cs @@ -0,0 +1,36 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/promoter/get_live_notice_promoter_share_link 接口的请求。 + /// + public class ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置达人平台 AppId。 + /// + [Newtonsoft.Json.JsonProperty("talent_appid")] + [System.Text.Json.Serialization.JsonPropertyName("talent_appid")] + public string TalentAppId { get; set; } = string.Empty; + + /// + /// 获取或设置推客 AppId。 + /// + [Newtonsoft.Json.JsonProperty("sharer_appid")] + [System.Text.Json.Serialization.JsonPropertyName("sharer_appid")] + public string? SharerAppId { get; set; } + + /// + /// 获取或设置小程序 AppId。 + /// + [Newtonsoft.Json.JsonProperty("mini_program_appid")] + [System.Text.Json.Serialization.JsonPropertyName("mini_program_appid")] + public string MiniProgramAppId { get; set; } = string.Empty; + + /// + /// 获取或设置预约 ID。 + /// + [Newtonsoft.Json.JsonProperty("notice_id")] + [System.Text.Json.Serialization.JsonPropertyName("notice_id")] + public string NoticeId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkResponse.cs new file mode 100644 index 00000000..e8e73ad3 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkResponse.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/promoter/get_live_notice_promoter_share_link 接口的响应。 + /// + public class ChannelsECPromoterGetLiveNoticePromoterShareLinkResponse : 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/Live/ChannelsECPromoterGetLiveNoticeReservationInfoRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticeReservationInfoRequest.cs index ce462ccc..ee276ba7 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticeReservationInfoRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticeReservationInfoRequest.cs @@ -10,7 +10,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("sharer_appid")] [System.Text.Json.Serialization.JsonPropertyName("sharer_appid")] - public string SharerAppId { get; set; } = string.Empty; + public string? SharerAppId { get; set; } /// /// 获取或设置预约 ID。 diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest.json new file mode 100644 index 00000000..2b6137af --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkRequest.json @@ -0,0 +1,6 @@ +{ + "notice_id": "", + "mini_program_appid": "123", + "talent_appid": "123", + "sharer_appid": "123" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkResponse.json new file mode 100644 index 00000000..28101c7b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECPromoter/Live/ChannelsECPromoterGetLiveNoticePromoterShareLinkResponse.json @@ -0,0 +1,5 @@ +{ + "errcode": "0", + "errmsg": "ok", + "promoter_share_link": "xxx" +}