diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index 11eeda5c..1f9c9d1f 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -4586,6 +4586,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// 异步调用 [POST] /channels/ec/qic/inspect/register_logistics 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECQICInspectRegisterLogisticsAsync(this WechatApiClient client, Models.ChannelsECQICInspectRegisterLogisticsRequest 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", "qic", "inspect", "register_logistics") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } #endregion #region ECSharer diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsRequest.cs new file mode 100644 index 00000000..cad123db --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsRequest.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/qic/inspect/register_logistics 接口的请求。 + /// + public class ChannelsECQICInspectRegisterLogisticsRequest : WechatApiRequest, IInferable + { + public static class Types + { + public class LogisticsInfo + { + /// + /// 获取或设置快递单号。 + /// + [Newtonsoft.Json.JsonProperty("waybill_id")] + [System.Text.Json.Serialization.JsonPropertyName("waybill_id")] + public string WaybillId { get; set; } = string.Empty; + + /// + /// 获取或设置发货方式。 + /// + [Newtonsoft.Json.JsonProperty("delivery_type")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_type")] + public int DeliveryType { get; set; } + + /// + /// 获取或设置快递公司 ID。 + /// + [Newtonsoft.Json.JsonProperty("delivery_id")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_id")] + public string? DeliveryId { get; set; } + + /// + /// 获取或设置快递公司名称。 + /// + [Newtonsoft.Json.JsonProperty("delivery_name")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_name")] + public string? DeliveryName { get; set; } + } + } + + /// + /// 获取或设置快递物流信息。 + /// + [Newtonsoft.Json.JsonProperty("order_id_list")] + [System.Text.Json.Serialization.JsonPropertyName("order_id_list")] + public IList OrderIdList { get; set; } = new List(); + + /// + /// 获取或设置订单 ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("logistics_info")] + [System.Text.Json.Serialization.JsonPropertyName("logistics_info")] + public Types.LogisticsInfo LogisticsInfo { get; set; } = new Types.LogisticsInfo(); + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsResponse.cs new file mode 100644 index 00000000..eb80e8aa --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/qic/inspect/register_logistics 接口的响应。 + /// + public class ChannelsECQICInspectRegisterLogisticsResponse : WechatApiResponse + { + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsRequest.json new file mode 100644 index 00000000..d52cf5fe --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsRequest.json @@ -0,0 +1,12 @@ +{ + "order_id_list": [ + "37423523451235145", + "37423523451235146" + ], + "logistics_info": { + "waybill_id": "SF11111111", + "delivery_id": "SF", + "delivery_name": "顺丰快递", + "delivery_type": 1 + } +}