feat(wxapi): 新增微信小店获取店铺收藏的人数接口

This commit is contained in:
Fu Diwei
2025-11-27 15:36:31 +08:00
parent 4320c26e53
commit 34439beb41
4 changed files with 84 additions and 0 deletions

View File

@@ -2195,6 +2195,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
} }
#endregion #endregion
#region ECFavorites
/// <summary>
/// <para>异步调用 [POST] /channels/ec/favorites/count/get 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/favorite/shopfavorite/api_getfavoritescount.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ECFavoritesCountGetResponse> 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<Models.ECFavoritesCountGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#region ECFinderLive #region ECFinderLive
/// <summary> /// <summary>
/// <para>异步调用 [POST] /channels/ec/finderlive/getfinderliverecordlist 接口。</para> /// <para>异步调用 [POST] /channels/ec/finderlive/getfinderliverecordlist 接口。</para>

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/favorites/count/get 接口的请求。</para>
/// </summary>
public class ECFavoritesCountGetRequest : WechatApiRequest, IInferable<ECFavoritesCountGetRequest, ECFavoritesCountGetResponse>
{
}
}

View File

@@ -0,0 +1,43 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/favorites/count/get 接口的响应。</para>
/// </summary>
public class ECFavoritesCountGetResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置收藏用户数。
/// </summary>
[Newtonsoft.Json.JsonProperty("favor_uv_acc_all")]
[System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_all")]
public int FavorUV { get; set; }
/// <summary>
/// 获取或设置店铺首页收藏用户数。
/// </summary>
[Newtonsoft.Json.JsonProperty("favor_uv_acc_shop_homepage")]
[System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_shop_homepage")]
public int FavorShopHomepageUV { get; set; }
/// <summary>
/// 获取或设置订单详情页收藏用户数。
/// </summary>
[Newtonsoft.Json.JsonProperty("favor_uv_acc_order_detail")]
[System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_order_detail")]
public int FavorOrderDetailUV { get; set; }
/// <summary>
/// 获取或设置商品详情页收藏用户数。
/// </summary>
[Newtonsoft.Json.JsonProperty("favor_uv_acc_product_detail")]
[System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_product_detail")]
public int FavorProductDetailUV { get; set; }
/// <summary>
/// 获取或设置其他场景收藏用户数。
/// </summary>
[Newtonsoft.Json.JsonProperty("favor_uv_acc_other_scene")]
[System.Text.Json.Serialization.JsonPropertyName("favor_uv_acc_other_scene")]
public int FavorOtherSceneUV { get; set; }
}
}

View File

@@ -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
}