diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteShopExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteShopExtensions.cs index 4c9a6412..a6125f5f 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteShopExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteShopExtensions.cs @@ -351,6 +351,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// 异步调用 [POST] /shop/ec/category/getcategoryrule 接口。 + /// + /// REF:
+ ///
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteShopECCategoryGetCategoryRuleAsync(this WechatApiClient client, Models.ShopECCategoryGetCategoryRuleRequest 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, "shop", "ec", "category", "getcategoryrule") + .SetQueryParam("access_token", request.AccessToken) + .SetQueryParam("rule_id", request.RuleId); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } #endregion #region Complaint diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCompass/ChannelsECCompassFinderProductListGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCompass/ChannelsECCompassFinderProductListGetResponse.cs index 202f97b0..99c2f337 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCompass/ChannelsECCompassFinderProductListGetResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECCompass/ChannelsECCompassFinderProductListGetResponse.cs @@ -1,3 +1,5 @@ +using System; + namespace SKIT.FlurlHttpClient.Wechat.Api.Models { /// @@ -144,6 +146,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// /// 获取或设置发货前成交退款率(单位:百分数)。 /// + [Obsolete("相关接口或字段于 2025-11-28 下线。")] [Newtonsoft.Json.JsonProperty("pay_refund_before_send_ratio")] [System.Text.Json.Serialization.JsonPropertyName("pay_refund_before_send_ratio")] [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Category/ShopECCategoryGetCategoryRuleRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Category/ShopECCategoryGetCategoryRuleRequest.cs new file mode 100644 index 00000000..b910c824 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Category/ShopECCategoryGetCategoryRuleRequest.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /shop/ec/category/getcategoryrule 接口的请求。 + /// + public class ShopECCategoryGetCategoryRuleRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置规则 ID。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public int RuleId { get; set; } + + /// + /// 获取或设置类目 ID。 + /// + [Newtonsoft.Json.JsonProperty("category_id")] + [System.Text.Json.Serialization.JsonPropertyName("category_id")] + public long CategoryId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Category/ShopECCategoryGetCategoryRuleResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Category/ShopECCategoryGetCategoryRuleResponse.cs new file mode 100644 index 00000000..76b5edc6 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Category/ShopECCategoryGetCategoryRuleResponse.cs @@ -0,0 +1,42 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /shop/ec/category/getcategoryrule 接口的响应。 + /// + public class ShopECCategoryGetCategoryRuleResponse : WechatApiResponse + { + public static class Types + { + public class Deliver + { + /// + /// 获取或设置发货方式。 + /// + [Newtonsoft.Json.JsonProperty("deliver_type")] + [System.Text.Json.Serialization.JsonPropertyName("deliver_type")] + public int DeliverType { get; set; } + + /// + /// 获取或设置支持的账号类型列表。 + /// + [Newtonsoft.Json.JsonProperty("acct_type")] + [System.Text.Json.Serialization.JsonPropertyName("acct_type")] + public int[] AccountTypeList { get; set; } = default!; + } + } + + /// + /// 获取或设置保证金(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("deposit")] + [System.Text.Json.Serialization.JsonPropertyName("deposit")] + public int? Deposit { get; set; } + + /// + /// 获取或设置发货方式列表。 + /// + [Newtonsoft.Json.JsonProperty("list")] + [System.Text.Json.Serialization.JsonPropertyName("list")] + public Types.Deliver[]? DeliverList { get; set; } + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Category/ShopECCategoryGetCategoryRuleRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Category/ShopECCategoryGetCategoryRuleRequest.json new file mode 100644 index 00000000..da63885d --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Category/ShopECCategoryGetCategoryRuleRequest.json @@ -0,0 +1,3 @@ +{ + "category_id": 10001 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Category/ShopECCategoryGetCategoryRuleResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Category/ShopECCategoryGetCategoryRuleResponse.json new file mode 100644 index 00000000..0f5c6530 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Category/ShopECCategoryGetCategoryRuleResponse.json @@ -0,0 +1,13 @@ +{ + "list": [ + { + "deliver_type": 0, + "acct_type": [ + 0 + ] + } + ], + "deposit": 1000000, + "errcode": 0, + "errmsg": "" +}