From 9a4510796f53cdf55ecef0ecfef4cb24e5d30ba1 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Wed, 2 Nov 2022 11:15:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=8F=B7=E5=B0=8F=E5=BA=97=E8=BF=90=E8=B4=B9=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TextualIntegerArrayConverter.cs | 74 ++++ ...echatApiClientExecuteChannelsExtensions.cs | 88 ++++- ...ategoryAvailableSonCategoriesGetRequest.cs | 2 +- ...tegoryAvailableSonCategoriesGetResponse.cs | 6 +- ...nelsECMerchantAddFreightTemplateRequest.cs | 297 ++++++++++++++++ ...elsECMerchantAddFreightTemplateResponse.cs | 16 + ...MerchantGetFreightTemplateDetailRequest.cs | 15 + ...erchantGetFreightTemplateDetailResponse.cs | 317 ++++++++++++++++++ ...ECMerchantGetFreightTemplateListRequest.cs | 23 ++ ...CMerchantGetFreightTemplateListResponse.cs | 16 + ...sECMerchantUpdateFreightTemplateRequest.cs | 28 ++ ...ECMerchantUpdateFreightTemplateResponse.cs | 9 + ...elsECOrderDeliveryCompanyListGetRequest.cs | 0 ...lsECOrderDeliveryCompanyListGetResponse.cs | 0 .../ChannelsECOrderDeliverySendRequest.cs | 0 .../ChannelsECOrderDeliverySendResponse.cs | 0 ...oductDeliveryGetFreightTemplateResponse.cs | 4 +- ...uctDeliveryInsertFreightTemplateRequest.cs | 4 +- ...uctDeliveryUpdateFreightTemplateRequest.cs | 4 +- ...lsECMerchantAddFreightTemplateRequest.json | 20 ++ ...sECMerchantAddFreightTemplateResponse.json | 5 + ...chantGetFreightTemplateDetailResponse.json | 35 ++ ...erchantGetFreightTemplateListResponse.json | 16 + ...ECOrderDeliveryCompanyListGetResponse.json | 0 .../ChannelsECOrderDeliverySendRequest.json | 0 25 files changed, 969 insertions(+), 10 deletions(-) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[Integer]/TextualIntegerArrayConverter.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantUpdateFreightTemplateRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantUpdateFreightTemplateResponse.cs rename src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/{ECOrderDelivery => ECOrder/Delivery}/ChannelsECOrderDeliveryCompanyListGetRequest.cs (100%) rename src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/{ECOrderDelivery => ECOrder/Delivery}/ChannelsECOrderDeliveryCompanyListGetResponse.cs (100%) rename src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/{ECOrderDelivery => ECOrder/Delivery}/ChannelsECOrderDeliverySendRequest.cs (100%) rename src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/{ECOrderDelivery => ECOrder/Delivery}/ChannelsECOrderDeliverySendResponse.cs (100%) create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListResponse.json rename test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/{ECOrderDelivery => ECOrder/Delivery}/ChannelsECOrderDeliveryCompanyListGetResponse.json (100%) rename test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/{ECOrderDelivery => ECOrder/Delivery}/ChannelsECOrderDeliverySendRequest.json (100%) diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[Integer]/TextualIntegerArrayConverter.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[Integer]/TextualIntegerArrayConverter.cs new file mode 100644 index 00000000..6dcd9bde --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[Integer]/TextualIntegerArrayConverter.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using System.Linq; +using System.Text.Json.Serialization; + +namespace System.Text.Json.Converters +{ + internal class TextualIntegerArrayConverter : JsonConverter + { + public override int[]? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) + { + return null; + } + else if (reader.TokenType == JsonTokenType.StartArray) + { + IList list = new List(); + + while (reader.Read()) + { + switch (reader.TokenType) + { + case JsonTokenType.Number: + { + int value = reader.GetInt32(); + list.Add(value); + } + break; + + case JsonTokenType.String: + { + string? value = reader.GetString(); + if (!int.TryParse(value, out int l)) + throw new JsonException($"Could not parse String '{value}' to Integer."); + + list.Add(l); + } + break; + + case JsonTokenType.EndArray: + return list.ToArray(); + + case JsonTokenType.Comment: + break; + + default: + throw new JsonException($"Unexpected JSON token type '{reader.TokenType}' when reading."); + } + } + } + + throw new JsonException($"Unexpected JSON token type '{reader.TokenType}' when reading."); + } + + public override void Write(Utf8JsonWriter writer, int[]? value, JsonSerializerOptions options) + { + if (value != null) + { + writer.WriteStartArray(); + + foreach (int i in value) + { + writer.WriteStringValue(i.ToString()); + } + + writer.WriteEndArray(); + } + else + { + writer.WriteNullValue(); + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index 1f02863d..6fc890d4 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -117,7 +117,92 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } #endregion - #region OrderDelivery + #region Merchant + #region Merchant/FreightTemplate + /// + /// 异步调用 [POST] /channels/ec/merchant/getfreighttemplatelist 接口。 + /// REF: https://developers.weixin.qq.com/doc/channels/API/order/deliverycompanylist_get.html + /// + /// + /// + /// + /// + public static async Task ExecuteChannelsECMerchantGetFreightTemplateListAsync(this WechatApiClient client, Models.ChannelsECMerchantGetFreightTemplateListRequest 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 + .CreateRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "getfreighttemplatelist") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /channels/ec/merchant/getfreighttemplatedetail 接口。 + /// REF: https://developers.weixin.qq.com/doc/channels/API/merchant/getfreighttemplatedetail.html + /// + /// + /// + /// + /// + public static async Task ExecuteChannelsECMerchantGetFreightTemplateDetailAsync(this WechatApiClient client, Models.ChannelsECMerchantGetFreightTemplateDetailRequest 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 + .CreateRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "getfreighttemplatedetail") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /channels/ec/merchant/addfreighttemplate 接口。 + /// REF: https://developers.weixin.qq.com/doc/channels/API/merchant/addfreighttemplate.html + /// + /// + /// + /// + /// + public static async Task ExecuteChannelsECMerchantAddFreightTemplateAsync(this WechatApiClient client, Models.ChannelsECMerchantAddFreightTemplateRequest 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 + .CreateRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "addfreighttemplate") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /channels/ec/merchant/updatefreighttemplate 接口。 + /// REF: https://developers.weixin.qq.com/doc/channels/API/merchant/updatefreighttemplate.html + /// + /// + /// + /// + /// + public static async Task ExecuteChannelsECMerchantUpdateFreightTemplateAsync(this WechatApiClient client, Models.ChannelsECMerchantUpdateFreightTemplateRequest 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 + .CreateRequest(request, HttpMethod.Post, "channels", "ec", "merchant", "updatefreighttemplate") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion + #endregion + + #region Order + #region Order/Delivery /// /// 异步调用 [POST] /channels/ec/order/deliverycompanylist/get 接口。 /// REF: https://developers.weixin.qq.com/doc/channels/API/order/deliverycompanylist_get.html @@ -158,6 +243,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } #endregion + #endregion #region ECWindow /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCategory/ChannelsECCategoryAvailableSonCategoriesGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCategory/ChannelsECCategoryAvailableSonCategoriesGetRequest.cs index 8cb0f3c3..291a0d03 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCategory/ChannelsECCategoryAvailableSonCategoriesGetRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCategory/ChannelsECCategoryAvailableSonCategoriesGetRequest.cs @@ -10,6 +10,6 @@ /// [Newtonsoft.Json.JsonProperty("f_cat_id")] [System.Text.Json.Serialization.JsonPropertyName("f_cat_id")] - public int ParentCategoryId { get; set; } + public long ParentCategoryId { get; set; } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCategory/ChannelsECCategoryAvailableSonCategoriesGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCategory/ChannelsECCategoryAvailableSonCategoriesGetResponse.cs index dc790a9f..46c582f9 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCategory/ChannelsECCategoryAvailableSonCategoriesGetResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCategory/ChannelsECCategoryAvailableSonCategoriesGetResponse.cs @@ -14,7 +14,8 @@ /// [Newtonsoft.Json.JsonProperty("cat_id")] [System.Text.Json.Serialization.JsonPropertyName("cat_id")] - public int CategoryId { get; set; } + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long CategoryId { get; set; } /// /// 获取或设置类目名称。 @@ -28,7 +29,8 @@ /// [Newtonsoft.Json.JsonProperty("f_cat_id")] [System.Text.Json.Serialization.JsonPropertyName("f_cat_id")] - public int ParentCategoryId { get; set; } + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long ParentCategoryId { get; set; } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateRequest.cs new file mode 100644 index 00000000..d7bd8ee0 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateRequest.cs @@ -0,0 +1,297 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/merchant/addfreighttemplate 接口的请求。 + /// + public class ChannelsECMerchantAddFreightTemplateRequest : WechatApiRequest, IInferable + { + public static class Types + { + public class FreightTemplate + { + public static class Types + { + public class Address + { + /// + /// 获取或设置省份。 + /// + [Newtonsoft.Json.JsonProperty("province_name")] + [System.Text.Json.Serialization.JsonPropertyName("province_name")] + public string? Province { get; set; } + + /// + /// 获取或设置城市。 + /// + [Newtonsoft.Json.JsonProperty("city_name")] + [System.Text.Json.Serialization.JsonPropertyName("city_name")] + public string? City { get; set; } + + /// + /// 获取或设置区县。 + /// + [Newtonsoft.Json.JsonProperty("county_name")] + [System.Text.Json.Serialization.JsonPropertyName("county_name")] + public string? District { get; set; } + + /// + /// 获取或设置详细地址。 + /// + [Newtonsoft.Json.JsonProperty("detail_info")] + [System.Text.Json.Serialization.JsonPropertyName("detail_info")] + public string? Detail { get; set; } + + /// + /// 获取或设置收件人姓名。 + /// + [Newtonsoft.Json.JsonProperty("user_name")] + [System.Text.Json.Serialization.JsonPropertyName("user_name")] + public string? Name { get; set; } + + /// + /// 获取或设置收件人电话。 + /// + [Newtonsoft.Json.JsonProperty("tel_number")] + [System.Text.Json.Serialization.JsonPropertyName("tel_number")] + public string? TeleNumber { get; set; } + + /// + /// 获取或设置国家码。 + /// + [Newtonsoft.Json.JsonProperty("national_code")] + [System.Text.Json.Serialization.JsonPropertyName("national_code")] + public string? NationalCode { get; set; } + + /// + /// 获取或设置邮政编码。 + /// + [Newtonsoft.Json.JsonProperty("postal_code")] + [System.Text.Json.Serialization.JsonPropertyName("postal_code")] + public string? PostalCode { get; set; } + } + + public class Area + { + /// + /// 获取或设置地址列表。 + /// + [Newtonsoft.Json.JsonProperty("address_info")] + [System.Text.Json.Serialization.JsonPropertyName("address_info")] + public IList
AddressList { get; set; } = new List
(); + } + + public class ConditionFreeDetailItem + { + /// + /// 获取或设置包邮地址列表。 + /// + [Newtonsoft.Json.JsonProperty("address_infos")] + [System.Text.Json.Serialization.JsonPropertyName("address_infos")] + public IList
AddressList { get; set; } = new List
(); + + /// + /// 获取或设置包邮最低件数。 + /// + [Newtonsoft.Json.JsonProperty("min_piece")] + [System.Text.Json.Serialization.JsonPropertyName("min_piece")] + public int? MinPiece { get; set; } + + /// + /// 获取或设置包邮最低金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("min_amount")] + [System.Text.Json.Serialization.JsonPropertyName("min_amount")] + public int? MinAmount { get; set; } + + /// + /// 获取或设置包邮最低重量(单位:千克)。 + /// + [Newtonsoft.Json.JsonProperty("min_weight")] + [System.Text.Json.Serialization.JsonPropertyName("min_weight")] + public int? MinWeight { get; set; } + + /// + /// 获取或设置计费方式对应选项是否已经设置。 + /// + [Newtonsoft.Json.JsonProperty("valuation_flag")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("valuation_flag")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))] + public bool? HasSetValuation { get; set; } + + /// + /// 获取或设置金额是否设置。 + /// + [Newtonsoft.Json.JsonProperty("amount_flag")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("amount_flag")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))] + public bool? HasSetAmount { get; set; } + } + + public class ConditionFreeDetailList + { + /// + /// 获取或设置条件包邮详情列表。 + /// + [Newtonsoft.Json.JsonProperty("condition_free_detail_list")] + [System.Text.Json.Serialization.JsonPropertyName("condition_free_detail_list")] + public IList Items { get; set; } = new List(); + } + + public class FreightCalculateMethodItem + { + /// + /// 获取或设置指定地址列表。 + /// + [Newtonsoft.Json.JsonProperty("address_info")] + [System.Text.Json.Serialization.JsonPropertyName("address_info")] + public IList
AddressList { get; set; } = new List
(); + + /// + /// 获取或设置是否为默认运费。 + /// + [Newtonsoft.Json.JsonProperty("is_default")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("is_default")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))] + public bool IsDefault { get; set; } + + /// + /// 获取或设置快递公司 ID。 + /// + [Newtonsoft.Json.JsonProperty("delivery_id")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_id")] + public string? DeliveryId { get; set; } + + /// + /// 获取或设置首段运费满足重量(单位:千克)。 + /// + [Newtonsoft.Json.JsonProperty("first_val_amount")] + [System.Text.Json.Serialization.JsonPropertyName("first_val_amount")] + public int FirstValueWeight { get; set; } + + /// + /// 获取或设置首段运费的金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("first_price")] + [System.Text.Json.Serialization.JsonPropertyName("first_price")] + public int FirstValuePrice { get; set; } + + /// + /// 获取或设置增量运费满足重量(单位:千克)。 + /// + [Newtonsoft.Json.JsonProperty("second_val_amount")] + [System.Text.Json.Serialization.JsonPropertyName("second_val_amount")] + public int SecondValueWeight { get; set; } + + /// + /// 获取或设置增量运费的金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("second_price")] + [System.Text.Json.Serialization.JsonPropertyName("second_price")] + public int SecondValuePrice { get; set; } + } + + public class FreightCalculateMethodList + { + /// + /// 获取或设置指定地区具体计费方法列表。 + /// + [Newtonsoft.Json.JsonProperty("freight_calc_method_list")] + [System.Text.Json.Serialization.JsonPropertyName("freight_calc_method_list")] + public IList Items { get; set; } = new List(); + } + } + + /// + /// 获取或设置模板名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; + + /// + /// 获取或设置计费类型。 + /// + [Newtonsoft.Json.JsonProperty("valuation_type")] + [System.Text.Json.Serialization.JsonPropertyName("valuation_type")] + public string ValuationType { get; set; } = string.Empty; + + /// + /// 获取或设置发货时间类型。 + /// + [Newtonsoft.Json.JsonProperty("send_time")] + [System.Text.Json.Serialization.JsonPropertyName("send_time")] + public string SendTimeType { get; set; } = string.Empty; + + /// + /// 获取或设置快递方式。 + /// + [Newtonsoft.Json.JsonProperty("delivery_type")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_type")] + public string DeliveryType { get; set; } = string.Empty; + + /// + /// 获取或设置快递公司 ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("delivery_id")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_id")] + public IList? DeliveryIdList { get; set; } + + /// + /// 获取或设置配送方式。 + /// + [Newtonsoft.Json.JsonProperty("shipping_method")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_method")] + public string ShippingMethod { get; set; } = string.Empty; + + /// + /// 获取或设置发货地址信息。 + /// + [Newtonsoft.Json.JsonProperty("address_info")] + [System.Text.Json.Serialization.JsonPropertyName("address_info")] + public Types.Address? SendAddress { get; set; } + + /// + /// 获取或设置不发货地区信息。 + /// + [Newtonsoft.Json.JsonProperty("not_send_area")] + [System.Text.Json.Serialization.JsonPropertyName("not_send_area")] + public Types.Area? NotSupportedArea { get; set; } + + /// + /// 获取或设置是否为默认模版。 + /// + [Newtonsoft.Json.JsonProperty("is_default")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("is_default")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))] + public bool? IsDefault { get; set; } + + /// + /// 获取或设置条件包邮详情信息。 + /// + [Newtonsoft.Json.JsonProperty("all_condition_free_detail")] + [System.Text.Json.Serialization.JsonPropertyName("all_condition_free_detail")] + public Types.ConditionFreeDetailList? ConditionFreeDetailList { get; set; } + + /// + /// 获取或设置指定地区具体计费方法信息。 + /// + [Newtonsoft.Json.JsonProperty("all_freight_calc_method")] + [System.Text.Json.Serialization.JsonPropertyName("all_freight_calc_method")] + public Types.FreightCalculateMethodList? FreightCalculateMethodList { get; set; } + } + } + + /// + /// 获取或设置运费模板信息。 + /// + [Newtonsoft.Json.JsonProperty("freight_template")] + [System.Text.Json.Serialization.JsonPropertyName("freight_template")] + public Types.FreightTemplate FreightTemplate { get; set; } = new Types.FreightTemplate(); + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateResponse.cs new file mode 100644 index 00000000..4de5420b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateResponse.cs @@ -0,0 +1,16 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/merchant/addfreighttemplate 接口的响应。 + /// + public class ChannelsECMerchantAddFreightTemplateResponse : WechatApiResponse + { + /// + /// 获取或设置运费模板 ID。 + /// + [Newtonsoft.Json.JsonProperty("template_id")] + [System.Text.Json.Serialization.JsonPropertyName("template_id")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long TemplateId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailRequest.cs new file mode 100644 index 00000000..572d4d91 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/merchant/getfreighttemplatedetail 接口的请求。 + /// + public class ChannelsECMerchantGetFreightTemplateDetailRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置运费模板 ID。 + /// + [Newtonsoft.Json.JsonProperty("template_id")] + [System.Text.Json.Serialization.JsonPropertyName("template_id")] + public long TemplateId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailResponse.cs new file mode 100644 index 00000000..434a75ac --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailResponse.cs @@ -0,0 +1,317 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/merchant/getfreighttemplatedetail 接口的响应。 + /// + public class ChannelsECMerchantGetFreightTemplateDetailResponse : WechatApiResponse + { + public static class Types + { + public class FreightTemplate + { + public static class Types + { + public class Address + { + /// + /// 获取或设置省份。 + /// + [Newtonsoft.Json.JsonProperty("province_name")] + [System.Text.Json.Serialization.JsonPropertyName("province_name")] + public string? Province { get; set; } + + /// + /// 获取或设置城市。 + /// + [Newtonsoft.Json.JsonProperty("city_name")] + [System.Text.Json.Serialization.JsonPropertyName("city_name")] + public string? City { get; set; } + + /// + /// 获取或设置区县。 + /// + [Newtonsoft.Json.JsonProperty("county_name")] + [System.Text.Json.Serialization.JsonPropertyName("county_name")] + public string? District { get; set; } + + /// + /// 获取或设置详细地址。 + /// + [Newtonsoft.Json.JsonProperty("detail_info")] + [System.Text.Json.Serialization.JsonPropertyName("detail_info")] + public string? Detail { get; set; } + + /// + /// 获取或设置收件人姓名。 + /// + [Newtonsoft.Json.JsonProperty("user_name")] + [System.Text.Json.Serialization.JsonPropertyName("user_name")] + public string? Name { get; set; } + + /// + /// 获取或设置收件人电话。 + /// + [Newtonsoft.Json.JsonProperty("tel_number")] + [System.Text.Json.Serialization.JsonPropertyName("tel_number")] + public string? TeleNumber { get; set; } + + /// + /// 获取或设置国家码。 + /// + [Newtonsoft.Json.JsonProperty("national_code")] + [System.Text.Json.Serialization.JsonPropertyName("national_code")] + public string? NationalCode { get; set; } + + /// + /// 获取或设置邮政编码。 + /// + [Newtonsoft.Json.JsonProperty("postal_code")] + [System.Text.Json.Serialization.JsonPropertyName("postal_code")] + public string? PostalCode { get; set; } + } + + public class Area + { + /// + /// 获取或设置地址列表。 + /// + [Newtonsoft.Json.JsonProperty("address_info")] + [System.Text.Json.Serialization.JsonPropertyName("address_info")] + public Address[] AddressList { get; set; } = default!; + } + + public class ConditionFreeDetailItem + { + /// + /// 获取或设置包邮地址列表。 + /// + [Newtonsoft.Json.JsonProperty("address_infos")] + [System.Text.Json.Serialization.JsonPropertyName("address_infos")] + public Address[] AddressList { get; set; } = default!; + + /// + /// 获取或设置包邮最低件数。 + /// + [Newtonsoft.Json.JsonProperty("min_piece")] + [System.Text.Json.Serialization.JsonPropertyName("min_piece")] + public int? MinPiece { get; set; } + + /// + /// 获取或设置包邮最低金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("min_amount")] + [System.Text.Json.Serialization.JsonPropertyName("min_amount")] + public int? MinAmount { get; set; } + + /// + /// 获取或设置包邮最低重量(单位:千克)。 + /// + [Newtonsoft.Json.JsonProperty("min_weight")] + [System.Text.Json.Serialization.JsonPropertyName("min_weight")] + public int? MinWeight { get; set; } + + /// + /// 获取或设置计费方式对应选项是否已经设置。 + /// + [Newtonsoft.Json.JsonProperty("valuation_flag")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("valuation_flag")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))] + public bool? HasSetValuation { get; set; } + + /// + /// 获取或设置金额是否设置。 + /// + [Newtonsoft.Json.JsonProperty("amount_flag")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("amount_flag")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))] + public bool? HasSetAmount { get; set; } + } + + public class ConditionFreeDetailList + { + /// + /// 获取或设置条件包邮详情列表。 + /// + [Newtonsoft.Json.JsonProperty("condition_free_detail_list")] + [System.Text.Json.Serialization.JsonPropertyName("condition_free_detail_list")] + public ConditionFreeDetailItem[] Items { get; set; } = default!; + } + + public class FreightCalculateMethodItem + { + /// + /// 获取或设置指定地址列表。 + /// + [Newtonsoft.Json.JsonProperty("address_info")] + [System.Text.Json.Serialization.JsonPropertyName("address_info")] + public Address[] AddressList { get; set; } = default!; + + /// + /// 获取或设置是否为默认运费。 + /// + [Newtonsoft.Json.JsonProperty("is_default")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("is_default")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))] + public bool IsDefault { get; set; } + + /// + /// 获取或设置快递公司 ID。 + /// + [Newtonsoft.Json.JsonProperty("delivery_id")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_id")] + public string? DeliveryId { get; set; } + + /// + /// 获取或设置首段运费满足重量(单位:千克)。 + /// + [Newtonsoft.Json.JsonProperty("first_val_amount")] + [System.Text.Json.Serialization.JsonPropertyName("first_val_amount")] + public int FirstValueWeight { get; set; } + + /// + /// 获取或设置首段运费的金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("first_price")] + [System.Text.Json.Serialization.JsonPropertyName("first_price")] + public int FirstValuePrice { get; set; } + + /// + /// 获取或设置增量运费满足重量(单位:千克)。 + /// + [Newtonsoft.Json.JsonProperty("second_val_amount")] + [System.Text.Json.Serialization.JsonPropertyName("second_val_amount")] + public int SecondValueWeight { get; set; } + + /// + /// 获取或设置增量运费的金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("second_price")] + [System.Text.Json.Serialization.JsonPropertyName("second_price")] + public int SecondValuePrice { get; set; } + } + + public class FreightCalculateMethodList + { + /// + /// 获取或设置指定地区具体计费方法列表。 + /// + [Newtonsoft.Json.JsonProperty("freight_calc_method_list")] + [System.Text.Json.Serialization.JsonPropertyName("freight_calc_method_list")] + public FreightCalculateMethodItem[] Items { get; set; } = default!; + } + } + + /// + /// 获取或设置运费模板 ID。 + /// + [Newtonsoft.Json.JsonProperty("template_id")] + [System.Text.Json.Serialization.JsonPropertyName("template_id")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long TemplateId { get; set; } + + /// + /// 获取或设置模板名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string Name { get; set; } = default!; + + /// + /// 获取或设置计费类型。 + /// + [Newtonsoft.Json.JsonProperty("valuation_type")] + [System.Text.Json.Serialization.JsonPropertyName("valuation_type")] + public string ValuationType { get; set; } = default!; + + /// + /// 获取或设置发货时间类型。 + /// + [Newtonsoft.Json.JsonProperty("send_time")] + [System.Text.Json.Serialization.JsonPropertyName("send_time")] + public string SendTimeType { get; set; } = default!; + + /// + /// 获取或设置快递方式。 + /// + [Newtonsoft.Json.JsonProperty("delivery_type")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_type")] + public string DeliveryType { get; set; } = default!; + + /// + /// 获取或设置快递公司 ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("delivery_id")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_id")] + public string[] DeliveryIdList { get; set; } = default!; + + /// + /// 获取或设置配送方式。 + /// + [Newtonsoft.Json.JsonProperty("shipping_method")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_method")] + public string ShippingMethod { get; set; } = default!; + + /// + /// 获取或设置发货地址信息。 + /// + [Newtonsoft.Json.JsonProperty("address_info")] + [System.Text.Json.Serialization.JsonPropertyName("address_info")] + public Types.Address SendAddress { get; set; } = default!; + + /// + /// 获取或设置不发货地区信息。 + /// + [Newtonsoft.Json.JsonProperty("not_send_area")] + [System.Text.Json.Serialization.JsonPropertyName("not_send_area")] + public Types.Area NotSupportedArea { get; set; } = default!; + + /// + /// 获取或设置是否为默认模版。 + /// + [Newtonsoft.Json.JsonProperty("is_default")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("is_default")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))] + public bool IsDefault { get; set; } + + /// + /// 获取或设置条件包邮详情信息。 + /// + [Newtonsoft.Json.JsonProperty("all_condition_free_detail")] + [System.Text.Json.Serialization.JsonPropertyName("all_condition_free_detail")] + public Types.ConditionFreeDetailList ConditionFreeDetailList { get; set; } = default!; + + /// + /// 获取或设置指定地区具体计费方法信息。 + /// + [Newtonsoft.Json.JsonProperty("all_freight_calc_method")] + [System.Text.Json.Serialization.JsonPropertyName("all_freight_calc_method")] + public Types.FreightCalculateMethodList FreightCalculateMethodList { get; set; } = default!; + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("update_time")] + [System.Text.Json.Serialization.JsonPropertyName("update_time")] + public long UpdateTimestamp { get; set; } + + /// + /// 获取或设置创建时间戳。 + /// + [Newtonsoft.Json.JsonProperty("create_time")] + [System.Text.Json.Serialization.JsonPropertyName("create_time")] + public long CreateTimestamp { get; set; } + } + } + + /// + /// 获取或设置运费模板信息。 + /// + [Newtonsoft.Json.JsonProperty("freight_template")] + [System.Text.Json.Serialization.JsonPropertyName("freight_template")] + public Types.FreightTemplate FreightTemplate { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListRequest.cs new file mode 100644 index 00000000..fec7e8e9 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListRequest.cs @@ -0,0 +1,23 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/merchant/getfreighttemplatelist 接口的请求。 + /// + public class ChannelsECMerchantGetFreightTemplateListRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置分页起始位置。 + /// + [Newtonsoft.Json.JsonProperty("offset")] + [System.Text.Json.Serialization.JsonPropertyName("offset")] + public int Offset { get; set; } + + /// + /// 获取或设置分页每页数量。 + /// 默认值:10 + /// + [Newtonsoft.Json.JsonProperty("limit")] + [System.Text.Json.Serialization.JsonPropertyName("limit")] + public int Limit { get; set; } = 10; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListResponse.cs new file mode 100644 index 00000000..6fb763d7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListResponse.cs @@ -0,0 +1,16 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/merchant/getfreighttemplatelist 接口的响应。 + /// + public class ChannelsECMerchantGetFreightTemplateListResponse : WechatApiResponse + { + /// + /// 获取或设置运费模板 ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("template_id_list")] + [System.Text.Json.Serialization.JsonPropertyName("template_id_list")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualLongArrayConverter))] + public long[] TemplateIdList { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantUpdateFreightTemplateRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantUpdateFreightTemplateRequest.cs new file mode 100644 index 00000000..931bd2c9 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantUpdateFreightTemplateRequest.cs @@ -0,0 +1,28 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/merchant/updatefreighttemplate 接口的请求。 + /// + public class ChannelsECMerchantUpdateFreightTemplateRequest : WechatApiRequest, IInferable + { + public static class Types + { + public class FreightTemplate : ProductDeliveryInsertFreightTemplateRequest.Types.FreightTemplate + { + /// + /// 获取或设置运费模板 ID。 + /// + [Newtonsoft.Json.JsonProperty("template_id")] + [System.Text.Json.Serialization.JsonPropertyName("template_id")] + public long TemplateId { get; set; } + } + } + + /// + /// 获取或设置运费模板信息。 + /// + [Newtonsoft.Json.JsonProperty("freight_template")] + [System.Text.Json.Serialization.JsonPropertyName("freight_template")] + public Types.FreightTemplate FreightTemplate { get; set; } = new Types.FreightTemplate(); + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantUpdateFreightTemplateResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantUpdateFreightTemplateResponse.cs new file mode 100644 index 00000000..b6e9ef47 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantUpdateFreightTemplateResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/merchant/updatefreighttemplate 接口的响应。 + /// + public class ChannelsECMerchantUpdateFreightTemplateResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrderDelivery/ChannelsECOrderDeliveryCompanyListGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/Delivery/ChannelsECOrderDeliveryCompanyListGetRequest.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrderDelivery/ChannelsECOrderDeliveryCompanyListGetRequest.cs rename to src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/Delivery/ChannelsECOrderDeliveryCompanyListGetRequest.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrderDelivery/ChannelsECOrderDeliveryCompanyListGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/Delivery/ChannelsECOrderDeliveryCompanyListGetResponse.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrderDelivery/ChannelsECOrderDeliveryCompanyListGetResponse.cs rename to src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/Delivery/ChannelsECOrderDeliveryCompanyListGetResponse.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrderDelivery/ChannelsECOrderDeliverySendRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/Delivery/ChannelsECOrderDeliverySendRequest.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrderDelivery/ChannelsECOrderDeliverySendRequest.cs rename to src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/Delivery/ChannelsECOrderDeliverySendRequest.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrderDelivery/ChannelsECOrderDeliverySendResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/Delivery/ChannelsECOrderDeliverySendResponse.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrderDelivery/ChannelsECOrderDeliverySendResponse.cs rename to src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECOrder/Delivery/ChannelsECOrderDeliverySendResponse.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryGetFreightTemplateResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryGetFreightTemplateResponse.cs index 126034a7..68ae5fa3 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryGetFreightTemplateResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryGetFreightTemplateResponse.cs @@ -7,7 +7,7 @@ { public static class Types { - public class Template + public class FreightTemplate { public static class Types { @@ -276,6 +276,6 @@ /// [Newtonsoft.Json.JsonProperty("template_list")] [System.Text.Json.Serialization.JsonPropertyName("template_list")] - public Types.Template[] TemplateList { get; set; } = default!; + public Types.FreightTemplate[] FreightTemplateList { get; set; } = default!; } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryInsertFreightTemplateRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryInsertFreightTemplateRequest.cs index e745138a..2e5bb722 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryInsertFreightTemplateRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryInsertFreightTemplateRequest.cs @@ -9,7 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models { public static class Types { - public class Template + public class FreightTemplate { public static class Types { @@ -257,6 +257,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("freight_template")] [System.Text.Json.Serialization.JsonPropertyName("freight_template")] - public Types.Template Template { get; set; } = new Types.Template(); + public Types.FreightTemplate FreightTemplate { get; set; } = new Types.FreightTemplate(); } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryUpdateFreightTemplateRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryUpdateFreightTemplateRequest.cs index 363c5a76..5fb99bcd 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryUpdateFreightTemplateRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Delivery/FreightTemplate/ProductDeliveryUpdateFreightTemplateRequest.cs @@ -7,7 +7,7 @@ { public static class Types { - public class Template : ProductDeliveryInsertFreightTemplateRequest.Types.Template + public class FreightTemplate : ProductDeliveryInsertFreightTemplateRequest.Types.FreightTemplate { /// /// 获取或设置模板 ID。 @@ -23,6 +23,6 @@ /// [Newtonsoft.Json.JsonProperty("freight_template")] [System.Text.Json.Serialization.JsonPropertyName("freight_template")] - public Types.Template Template { get; set; } = new Types.Template(); + public Types.FreightTemplate FreightTemplate { get; set; } = new Types.FreightTemplate(); } } diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateRequest.json new file mode 100644 index 00000000..a08a6a61 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateRequest.json @@ -0,0 +1,20 @@ +{ + "freight_template": { + "name": "测试api", + "valuation_type": "PIECE", + "send_time": "SendTime_FOUR_HOUR", + "address_info": { + "user_name": "", + "postal_code": "12345", + "province_name": "广东省", + "city_name": "广州市", + "county_name": "海珠区", + "detail_info": "新港中路", + "national_code": "23456", + "tel_number": "12345" + }, + "delivery_type": "EXPRESS", + "shipping_method": "FREE", + "is_default": false + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateResponse.json new file mode 100644 index 00000000..dfadc44a --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantAddFreightTemplateResponse.json @@ -0,0 +1,5 @@ +{ + "errcode": 0, + "errmsg": "ok", + "template_id": "123123" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailResponse.json new file mode 100644 index 00000000..c8a22651 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateDetailResponse.json @@ -0,0 +1,35 @@ +{ + "errcode": 0, + "errmsg": "ok", + "freight_template": { + "template_id": "38983386001", + "name": "运费险", + "valuation_type": "PIECE", + "send_time": "SendTime_FOUR_HOUR", + "address_info": { + "user_name": "", + "postal_code": "", + "province_name": "广东省", + "city_name": "广州市", + "county_name": "海珠区", + "detail_info": "", + "national_code": "", + "tel_number": "" + }, + "delivery_type": "EXPRESS", + "delivery_id": [], + "shipping_method": "FREE", + "all_condition_free_detail": { + "condition_free_detail_list": [] + }, + "all_freight_calc_method": { + "freight_calc_method_list": [] + }, + "create_time": 1653892643, + "update_time": 1653892643, + "is_default": 0, + "not_send_area": { + "address_info": [] + } + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListResponse.json new file mode 100644 index 00000000..a4c886f1 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECMerchant/FreightTemplate/ChannelsECMerchantGetFreightTemplateListResponse.json @@ -0,0 +1,16 @@ +{ + "errcode": 0, + "errmsg": "ok", + "template_id_list": [ + "1061", + "2008", + "2047", + "5007", + "5055", + "5148", + "5182", + "5187", + "5188", + "5189" + ] +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECOrderDelivery/ChannelsECOrderDeliveryCompanyListGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECOrder/Delivery/ChannelsECOrderDeliveryCompanyListGetResponse.json similarity index 100% rename from test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECOrderDelivery/ChannelsECOrderDeliveryCompanyListGetResponse.json rename to test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECOrder/Delivery/ChannelsECOrderDeliveryCompanyListGetResponse.json diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECOrderDelivery/ChannelsECOrderDeliverySendRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECOrder/Delivery/ChannelsECOrderDeliverySendRequest.json similarity index 100% rename from test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECOrderDelivery/ChannelsECOrderDeliverySendRequest.json rename to test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECOrder/Delivery/ChannelsECOrderDeliverySendRequest.json