From f89ca8a1fc14ca6b4b98700e1d48c5723ea0902a Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 7 Apr 2025 20:44:16 +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=87=AA=E5=AF=84=E5=BF=AB=E9=80=92?= =?UTF-8?q?=E9=80=81=E6=A3=80=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...echatApiClientExecuteChannelsExtensions.cs | 23 ++++++++ ...elsECQICInspectRegisterLogisticsRequest.cs | 58 +++++++++++++++++++ ...lsECQICInspectRegisterLogisticsResponse.cs | 9 +++ ...sECQICInspectRegisterLogisticsRequest.json | 12 ++++ 4 files changed, 102 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECQIC/ChannelsECQICInspectRegisterLogisticsRequest.json 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 + } +}