mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 23:13:32 +08:00
feat(wxapi): 新增微信小店待发货前更换 SKU 相关接口
This commit is contained in:
parent
f5478bb68c
commit
404df5cd77
@ -3739,6 +3739,77 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderDeliverySendResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ECOrder/PreshipmentChangeSKU
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/order/preshipmentchangesku/approve 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/order/preshipment_change_sku_approve.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECOrderPreshipmentChangeSKUApproveResponse> ExecuteChannelsECOrderPreshipmentChangeSKUApproveAsync(this WechatApiClient client, Models.ChannelsECOrderPreshipmentChangeSKUApproveRequest 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", "order", "preshipmentchangesku", "approve")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderPreshipmentChangeSKUApproveResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/order/preshipmentchangesku/reject 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/order/preshipment_change_sku_reject.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECOrderPreshipmentChangeSKURejectResponse> ExecuteChannelsECOrderPreshipmentChangeSKURejectAsync(this WechatApiClient client, Models.ChannelsECOrderPreshipmentChangeSKURejectRequest 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", "order", "preshipmentchangesku", "reject")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderPreshipmentChangeSKURejectResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/order/preshipmentchangesku/get 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/order/preshipment_change_sku_reject.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECOrderPreshipmentChangeSKUGetResponse> ExecuteChannelsECOrderPreshipmentChangeSKUGetAsync(this WechatApiClient client, Models.ChannelsECOrderPreshipmentChangeSKUGetRequest 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", "order", "preshipmentchangesku", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderPreshipmentChangeSKUGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region ECProduct
|
||||
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/order/preshipmentchangesku/approve 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECOrderPreshipmentChangeSKUApproveRequest : WechatApiRequest, IInferable<ChannelsECOrderPreshipmentChangeSKUApproveRequest, ChannelsECOrderPreshipmentChangeSKUApproveResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置订单 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string OrderId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/order/preshipmentchangesku/approve 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECOrderPreshipmentChangeSKUApproveResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/order/preshipmentchangesku/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECOrderPreshipmentChangeSKUGetRequest : WechatApiRequest, IInferable<ChannelsECOrderPreshipmentChangeSKUGetRequest, ChannelsECOrderPreshipmentChangeSKUGetResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置分页页数。
|
||||
/// <para>默认值:1</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page")]
|
||||
public int Page { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// <para>默认值:10</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("page_size")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("page_size")]
|
||||
public int Limit { get; set; } = 10;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/order/preshipmentchangesku/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECOrderPreshipmentChangeSKUGetResponse : WechatApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置订单 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_ids")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_ids")]
|
||||
public string[] OrderIdList { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/order/preshipmentchangesku/reject 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECOrderPreshipmentChangeSKURejectRequest : WechatApiRequest, IInferable<ChannelsECOrderPreshipmentChangeSKURejectRequest, ChannelsECOrderPreshipmentChangeSKURejectResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置订单 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
|
||||
public string OrderId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/order/preshipmentchangesku/reject 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECOrderPreshipmentChangeSKURejectResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"order_id": "111111111"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"page": "1",
|
||||
"page_size": "100"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"order_ids": [ "123456789" ]
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"order_id": "111111111"
|
||||
}
|
Loading…
Reference in New Issue
Block a user