Skip to content

Commit 4e20bc9

Browse files
committed
feat(wxapi): 新增微信小店带货助手相关接口
1 parent 9fbfcdc commit 4e20bc9

21 files changed

Lines changed: 756 additions & 5 deletions

src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public static class WechatApiClientExecuteCgibinExtensions
1818
/// <![CDATA[ https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/access-token/auth.getAccessToken.html ]]> <br/>
1919
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/basics/getaccesstoken.html ]]> <br/>
2020
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/windowproduct/getaccesstoken.html ]]> <br/>
21-
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/basics/getaccesstoken.html ]]>
21+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/basics/getaccesstoken.html ]]> <br/>
22+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/talent/openapi/basics/getaccesstoken.html ]]> <br/>
2223
/// <![CDATA[ https://dev.weixin.qq.com/docs/framework/dev/openapi/getaccesstoken.html ]]>
2324
/// </para>
2425
/// </summary>
@@ -47,7 +48,7 @@ public static class WechatApiClientExecuteCgibinExtensions
4748
/// <![CDATA[ https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/getStableAccessToken.html ]]> <br/>
4849
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getStableAccessToken.html ]]> <br/>
4950
/// <![CDATA[ https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/access-token/auth.getStableAccessToken.html ]]> <br/>
50-
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/basics/getStableAccessToken.html ]]>
51+
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/basics/getStableAccessToken.html ]]> <br/>
5152
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/basics/getStableAccessToken.html ]]>
5253
/// </para>
5354
/// </summary>

src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinOpenApiExtensions.cs

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public static class WechatApiClientExecuteCgibinOpenApiExtensions
1717
/// <![CDATA[ https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/openapi/clearQuota.html ]]> <br/>
1818
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/openApi-mgnt/clearQuota.html ]]> <br/>
1919
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/apimgnt/clearQuota.html ]]> <br/>
20-
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/apimgnt/clearQuota.html ]]>
20+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/apimgnt/clearQuota.html ]]> <br/>
21+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/talent/openapi/apimgnt/clearQuota.html ]]>
2122
/// </para>
2223
/// </summary>
2324
/// <param name="client"></param>
@@ -45,7 +46,8 @@ public static class WechatApiClientExecuteCgibinOpenApiExtensions
4546
/// REF: <br/>
4647
/// <![CDATA[ https://developers.weixin.qq.com/doc/offiaccount/openApi/clearQuotaByAppSecret.html ]]> <br/>
4748
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/apimgnt/clearQuotaByAppSecret.html ]]> <br/>
48-
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/apimgnt/clearQuotaByAppSecret.html ]]>
49+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/apimgnt/clearQuotaByAppSecret.html ]]> <br/>
50+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/talent/openapi/apimgnt/clearQuotaByAppSecret.html ]]>
4951
/// </para>
5052
/// </summary>
5153
/// <param name="client"></param>
@@ -79,7 +81,8 @@ public static class WechatApiClientExecuteCgibinOpenApiExtensions
7981
/// <![CDATA[ https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/openapi/getApiQuota.html ]]> <br/>
8082
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/openApi-mgnt/getApiQuota.html ]]>
8183
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/apimgnt/getApiQuota.html ]]> <br/>
82-
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/apimgnt/getApiQuota.html ]]>
84+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/apimgnt/getApiQuota.html ]]> <br/>
85+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/talent/openapi/apimgnt/getApiQuota.html ]]>
8386
/// </para>
8487
/// </summary>
8588
/// <param name="client"></param>
@@ -98,6 +101,32 @@ public static class WechatApiClientExecuteCgibinOpenApiExtensions
98101
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinOpenApiQuotaGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
99102
}
100103

104+
105+
/// <summary>
106+
/// <para>异步调用 [POST] /cgi-bin/openapi/quota/clear 接口。</para>
107+
/// <para>
108+
/// REF: <br/>
109+
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/apimgnt/clearApiQuota.html ]]> <br/>
110+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/apimgnt/clearApiQuota.html ]]> <br/>
111+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/talent/openapi/apimgnt/clearApiQuota.html ]]>
112+
/// </para>
113+
/// </summary>
114+
/// <param name="client"></param>
115+
/// <param name="request"></param>
116+
/// <param name="cancellationToken"></param>
117+
/// <returns></returns>
118+
public static async Task<Models.CgibinOpenApiQuotaClearResponse> ExecuteCgibinOpenApiQuotaClearAsync(this WechatApiClient client, Models.CgibinOpenApiQuotaClearRequest request, CancellationToken cancellationToken = default)
119+
{
120+
if (client is null) throw new ArgumentNullException(nameof(client));
121+
if (request is null) throw new ArgumentNullException(nameof(request));
122+
123+
IFlurlRequest flurlReq = client
124+
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "openapi", "quota", "clear")
125+
.SetQueryParam("access_token", request.AccessToken);
126+
127+
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinOpenApiQuotaClearResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
128+
}
129+
101130
/// <summary>
102131
/// <para>异步调用 [POST] /cgi-bin/openapi/rid/get 接口。</para>
103132
/// <para>

src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5856,6 +5856,104 @@ public static class WechatApiClientExecuteChannelsExtensions
58565856
#endregion
58575857
#endregion
58585858

5859+
#region ECTalent
5860+
#region ECTalent/Order
5861+
/// <summary>
5862+
/// <para>异步调用 [POST] /channels/ec/talent/get_order_list 接口。</para>
5863+
/// <para>
5864+
/// REF: <br/>
5865+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/talent/openapi/order/get_order_list.html ]]>
5866+
/// </para>
5867+
/// </summary>
5868+
/// <param name="client"></param>
5869+
/// <param name="request"></param>
5870+
/// <param name="cancellationToken"></param>
5871+
/// <returns></returns>
5872+
public static async Task<Models.ChannelsECTalentGetOrderListResponse> ExecuteChannelsECTalentGetOrderListAsync(this WechatApiClient client, Models.ChannelsECTalentGetOrderListRequest request, CancellationToken cancellationToken = default)
5873+
{
5874+
if (client is null) throw new ArgumentNullException(nameof(client));
5875+
if (request is null) throw new ArgumentNullException(nameof(request));
5876+
5877+
IFlurlRequest flurlReq = client
5878+
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "talent", "get_order_list")
5879+
.SetQueryParam("access_token", request.AccessToken);
5880+
5881+
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECTalentGetOrderListResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
5882+
}
5883+
5884+
/// <summary>
5885+
/// <para>异步调用 [POST] /channels/ec/talent/get_order_detail 接口。</para>
5886+
/// <para>
5887+
/// REF: <br/>
5888+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/talent/openapi/order/get_order_detail.html ]]>
5889+
/// </para>
5890+
/// </summary>
5891+
/// <param name="client"></param>
5892+
/// <param name="request"></param>
5893+
/// <param name="cancellationToken"></param>
5894+
/// <returns></returns>
5895+
public static async Task<Models.ChannelsECTalentGetOrderDetailResponse> ExecuteChannelsECTalentGetOrderDetailAsync(this WechatApiClient client, Models.ChannelsECTalentGetOrderDetailRequest request, CancellationToken cancellationToken = default)
5896+
{
5897+
if (client is null) throw new ArgumentNullException(nameof(client));
5898+
if (request is null) throw new ArgumentNullException(nameof(request));
5899+
5900+
IFlurlRequest flurlReq = client
5901+
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "talent", "get_order_detail")
5902+
.SetQueryParam("access_token", request.AccessToken);
5903+
5904+
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECTalentGetOrderDetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
5905+
}
5906+
#endregion
5907+
5908+
#region ECTalent/Window
5909+
/// <summary>
5910+
/// <para>异步调用 [POST] /channels/ec/talent/window/product/list/get 接口。</para>
5911+
/// <para>
5912+
/// REF: <br/>
5913+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/talent/openapi/window/get_product_list.html ]]>
5914+
/// </para>
5915+
/// </summary>
5916+
/// <param name="client"></param>
5917+
/// <param name="request"></param>
5918+
/// <param name="cancellationToken"></param>
5919+
/// <returns></returns>
5920+
public static async Task<Models.ChannelsECTalentWindowProductListGetResponse> ExecuteChannelsECTalentWindowProductListGetAsync(this WechatApiClient client, Models.ChannelsECTalentWindowProductListGetRequest request, CancellationToken cancellationToken = default)
5921+
{
5922+
if (client is null) throw new ArgumentNullException(nameof(client));
5923+
if (request is null) throw new ArgumentNullException(nameof(request));
5924+
5925+
IFlurlRequest flurlReq = client
5926+
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "talent", "window", "product", "list", "get")
5927+
.SetQueryParam("access_token", request.AccessToken);
5928+
5929+
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECTalentWindowProductListGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
5930+
}
5931+
5932+
/// <summary>
5933+
/// <para>异步调用 [POST] /channels/ec/talent/window/product/get 接口。</para>
5934+
/// <para>
5935+
/// REF: <br/>
5936+
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/talent/openapi/window/get_product_detail.html ]]>
5937+
/// </para>
5938+
/// </summary>
5939+
/// <param name="client"></param>
5940+
/// <param name="request"></param>
5941+
/// <param name="cancellationToken"></param>
5942+
/// <returns></returns>
5943+
public static async Task<Models.ChannelsECTalentWindowProductGetResponse> ExecuteChannelsECTalentWindowProductGetAsync(this WechatApiClient client, Models.ChannelsECTalentWindowProductGetRequest request, CancellationToken cancellationToken = default)
5944+
{
5945+
if (client is null) throw new ArgumentNullException(nameof(client));
5946+
if (request is null) throw new ArgumentNullException(nameof(request));
5947+
5948+
IFlurlRequest flurlReq = client
5949+
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "talent", "window", "product", "get")
5950+
.SetQueryParam("access_token", request.AccessToken);
5951+
5952+
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECTalentWindowProductGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
5953+
}
5954+
#endregion
5955+
#endregion
5956+
58595957
#region ECVoucher
58605958
#region ECVoucher/Bill
58615959
/// <summary>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /cgi-bin/openapi/quota/clear 接口的请求。</para>
5+
/// </summary>
6+
public class CgibinOpenApiQuotaClearRequest : WechatApiRequest, IInferable<CgibinOpenApiQuotaClearRequest, CgibinOpenApiQuotaClearResponse>
7+
{
8+
/// <summary>
9+
/// 获取或设置 API 请求地址。
10+
/// </summary>
11+
[Newtonsoft.Json.JsonProperty("cgi_path")]
12+
[System.Text.Json.Serialization.JsonPropertyName("cgi_path")]
13+
public string CgiPath { get; set; } = string.Empty;
14+
}
15+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /cgi-bin/openapi/quota/clear 接口的响应。</para>
5+
/// </summary>
6+
public class CgibinOpenApiQuotaClearResponse : WechatApiResponse
7+
{
8+
}
9+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /channels/ec/talent/get_order_detail 接口的请求。</para>
5+
/// </summary>
6+
public class ChannelsECTalentGetOrderDetailRequest : WechatApiRequest, IInferable<ChannelsECTalentGetOrderDetailRequest, ChannelsECTalentGetOrderDetailResponse>
7+
{
8+
/// <summary>
9+
/// 获取或设置订单 ID。
10+
/// </summary>
11+
[Newtonsoft.Json.JsonProperty("order_id")]
12+
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
13+
public string OrderId { get; set; } = string.Empty;
14+
15+
/// <summary>
16+
/// 获取或设置 SKU ID。
17+
/// </summary>
18+
[Newtonsoft.Json.JsonProperty("sku_id")]
19+
[System.Text.Json.Serialization.JsonPropertyName("sku_id")]
20+
public long SKUId { get; set; }
21+
}
22+
}

0 commit comments

Comments
 (0)