From 34439beb41b1a07c0db7889d434a801670b674f9 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Thu, 27 Nov 2025 15:36:31 +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=E8=8E=B7=E5=8F=96=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E6=94=B6=E8=97=8F=E7=9A=84=E4=BA=BA=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 +++++++++++ .../ECFavorites/ECFavoritesCountGetRequest.cs | 9 ++++ .../ECFavoritesCountGetResponse.cs | 43 +++++++++++++++++++ .../ECFavoritesCountGetResponse.json | 7 +++ 4 files changed, 84 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECFavorites/ECFavoritesCountGetRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECFavorites/ECFavoritesCountGetResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECFavorites/ECFavoritesCountGetResponse.json diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index b8126f1f..6c2cdfd3 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -2195,6 +2195,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } #endregion + #region ECFavorites + /// + /// 异步调用 [POST] /channels/ec/favorites/count/get 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteECFavoritesCountGetAsync(this WechatApiClient client, Models.ECFavoritesCountGetRequest 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", "favorites", "count", "get") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #endregion + #region ECFinderLive /// /// 异步调用 [POST] /channels/ec/finderlive/getfinderliverecordlist 接口。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECFavorites/ECFavoritesCountGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECFavorites/ECFavoritesCountGetRequest.cs new file mode 100644 index 00000000..8416d3e8 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECFavorites/ECFavoritesCountGetRequest.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/favorites/count/get 接口的请求。 + /// + public class ECFavoritesCountGetRequest : WechatApiRequest, IInferable + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECFavorites/ECFavoritesCountGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECFavorites/ECFavoritesCountGetResponse.cs new file mode 100644 index 00000000..c04bae57 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECFavorites/ECFavoritesCountGetResponse.cs @@ -0,0 +1,43 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/favorites/count/get 接口的响应。 + /// + public class ECFavoritesCountGetResponse : WechatApiResponse + { + /// + /// 获取或设置收藏用户数。 + /// + [Newtonsoft.Json.JsonProperty("favor_uv_acc_all")] + [System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_all")] + public int FavorUV { get; set; } + + /// + /// 获取或设置店铺首页收藏用户数。 + /// + [Newtonsoft.Json.JsonProperty("favor_uv_acc_shop_homepage")] + [System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_shop_homepage")] + public int FavorShopHomepageUV { get; set; } + + /// + /// 获取或设置订单详情页收藏用户数。 + /// + [Newtonsoft.Json.JsonProperty("favor_uv_acc_order_detail")] + [System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_order_detail")] + public int FavorOrderDetailUV { get; set; } + + /// + /// 获取或设置商品详情页收藏用户数。 + /// + [Newtonsoft.Json.JsonProperty("favor_uv_acc_product_detail")] + [System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_product_detail")] + public int FavorProductDetailUV { get; set; } + + /// + /// 获取或设置其他场景收藏用户数。 + /// + [Newtonsoft.Json.JsonProperty("favor_uv_acc_other_scene")] + [System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_other_scene")] + public int FavorOtherSceneUV { get; set; } + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECFavorites/ECFavoritesCountGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECFavorites/ECFavoritesCountGetResponse.json new file mode 100644 index 00000000..0a4a9b26 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECFavorites/ECFavoritesCountGetResponse.json @@ -0,0 +1,7 @@ +{ + "favor_uv_acc_shop_homepage": 0, + "favor_uv_acc_order_detail": 0, + "favor_uv_acc_product_detail": 0, + "favor_uv_acc_other_scene": 0, + "favor_uv_acc_all": 0 +}