diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinExtensions.cs index ea81d475..5a73298c 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinExtensions.cs @@ -18,7 +18,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api ///
///
///
- /// + ///
+ ///
/// /// /// @@ -47,7 +48,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api ///
///
///
- /// + ///
/// /// /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinOpenApiExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinOpenApiExtensions.cs index 985c4d46..56e2e0fb 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinOpenApiExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteCgibinOpenApiExtensions.cs @@ -17,7 +17,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api ///
///
///
- /// + ///
+ /// /// /// /// @@ -45,7 +46,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api /// REF:
///
///
- /// + ///
+ /// /// /// /// @@ -79,7 +81,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api ///
/// ///
- /// + ///
+ /// /// /// /// @@ -98,6 +101,32 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// 异步调用 [POST] /cgi-bin/openapi/quota/clear 接口。 + /// + /// REF:
+ ///
+ ///
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteCgibinOpenApiQuotaClearAsync(this WechatApiClient client, Models.CgibinOpenApiQuotaClearRequest 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, "cgi-bin", "openapi", "quota", "clear") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + /// /// 异步调用 [POST] /cgi-bin/openapi/rid/get 接口。 /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index 062f3e2c..54d5d6b2 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -5856,6 +5856,104 @@ namespace SKIT.FlurlHttpClient.Wechat.Api #endregion #endregion + #region ECTalent + #region ECTalent/Order + /// + /// 异步调用 [POST] /channels/ec/talent/get_order_list 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECTalentGetOrderListAsync(this WechatApiClient client, Models.ChannelsECTalentGetOrderListRequest 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", "talent", "get_order_list") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /channels/ec/talent/get_order_detail 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECTalentGetOrderDetailAsync(this WechatApiClient client, Models.ChannelsECTalentGetOrderDetailRequest 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", "talent", "get_order_detail") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #endregion + + #region ECTalent/Window + /// + /// 异步调用 [POST] /channels/ec/talent/window/product/list/get 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECTalentWindowProductListGetAsync(this WechatApiClient client, Models.ChannelsECTalentWindowProductListGetRequest 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", "talent", "window", "product", "list", "get") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /channels/ec/talent/window/product/get 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECTalentWindowProductGetAsync(this WechatApiClient client, Models.ChannelsECTalentWindowProductGetRequest 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", "talent", "window", "product", "get") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #endregion + #endregion + #region ECVoucher #region ECVoucher/Bill /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinOpenApi/CgibinOpenApiQuotaClearRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinOpenApi/CgibinOpenApiQuotaClearRequest.cs new file mode 100644 index 00000000..d40272db --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinOpenApi/CgibinOpenApiQuotaClearRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /cgi-bin/openapi/quota/clear 接口的请求。 + /// + public class CgibinOpenApiQuotaClearRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置 API 请求地址。 + /// + [Newtonsoft.Json.JsonProperty("cgi_path")] + [System.Text.Json.Serialization.JsonPropertyName("cgi_path")] + public string CgiPath { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinOpenApi/CgibinOpenApiQuotaClearResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinOpenApi/CgibinOpenApiQuotaClearResponse.cs new file mode 100644 index 00000000..e0478dd4 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinOpenApi/CgibinOpenApiQuotaClearResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /cgi-bin/openapi/quota/clear 接口的响应。 + /// + public class CgibinOpenApiQuotaClearResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailRequest.cs new file mode 100644 index 00000000..eb4a0b90 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailRequest.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/talent/get_order_detail 接口的请求。 + /// + public class ChannelsECTalentGetOrderDetailRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public string OrderId { get; set; } = string.Empty; + + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("sku_id")] + public long SKUId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailResponse.cs new file mode 100644 index 00000000..6a6291a9 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailResponse.cs @@ -0,0 +1,182 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/talent/get_order_detail 接口的响应。 + /// + public class ChannelsECTalentGetOrderDetailResponse : WechatApiResponse + { + public static class Types + { + public class BaseInfo + { + public static class Types + { + public class BuyerInfo + { + /// + /// 获取或设置用户 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("open_id")] + [System.Text.Json.Serialization.JsonPropertyName("open_id")] + public string OpenId { get; set; } = default!; + + /// + /// 获取或设置用户 UnionId。 + /// + [Newtonsoft.Json.JsonProperty("union_id")] + [System.Text.Json.Serialization.JsonPropertyName("union_id")] + public string? UnionId { get; set; } + } + } + + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public string OrderId { get; set; } = default!; + + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("spu_id")] + [System.Text.Json.Serialization.JsonPropertyName("spu_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public long ProductId { get; set; } + + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("sku_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public long SKUId { get; set; } + + /// + /// 获取或设置订单状态。 + /// + [Newtonsoft.Json.JsonProperty("order_status")] + [System.Text.Json.Serialization.JsonPropertyName("order_status")] + public int OrderStatus { get; set; } + + /// + /// 获取或设置实际支付金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("actual_payment")] + [System.Text.Json.Serialization.JsonPropertyName("actual_payment")] + public string ActualPayment { get; set; } = default!; + + /// + /// 获取或设置订单创建时间戳。 + /// + [Newtonsoft.Json.JsonProperty("order_create_time")] + [System.Text.Json.Serialization.JsonPropertyName("order_create_time")] + public long OrderCreateTimestamp { get; set; } + + /// + /// 获取或设置订单更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("order_update_time")] + [System.Text.Json.Serialization.JsonPropertyName("order_update_time")] + public long OrderUpdateTimestamp { get; set; } + + /// + /// 获取或设置买家信息。 + /// + [Newtonsoft.Json.JsonProperty("buyer_info")] + [System.Text.Json.Serialization.JsonPropertyName("buyer_info")] + public Types.BuyerInfo BuyerInfo { get; set; } = default!; + } + + public class CommissionInfo + { + /// + /// 获取或设置佣金单状态。 + /// + [Newtonsoft.Json.JsonProperty("state")] + [System.Text.Json.Serialization.JsonPropertyName("state")] + public int State { get; set; } + + /// + /// 获取或设置佣金费率(单位:万分数)。 + /// + [Newtonsoft.Json.JsonProperty("ratio")] + [System.Text.Json.Serialization.JsonPropertyName("ratio")] + public string Ratio { get; set; } = default!; + + /// + /// 获取或设置预计结算时间戳。 + /// + [Newtonsoft.Json.JsonProperty("expect_settle_time")] + [System.Text.Json.Serialization.JsonPropertyName("expect_settle_time")] + public long ExpectedSettleTimestamp { get; set; } + + /// + /// 获取或设置预计结算金额(单位:元)。 + /// + [Newtonsoft.Json.JsonProperty("expect_settlement")] + [System.Text.Json.Serialization.JsonPropertyName("expect_settlement")] + public string ExpectedSettlementString { get; set; } = default!; + + /// + /// 获取或设置实际结算时间戳。 + /// + [Newtonsoft.Json.JsonProperty("actual_settle_time")] + [System.Text.Json.Serialization.JsonPropertyName("actual_settle_time")] + public long? ActualSettleTimestamp { get; set; } + + /// + /// 获取或设置实际结算金额(单位:元)。 + /// + [Newtonsoft.Json.JsonProperty("actual_settlement")] + [System.Text.Json.Serialization.JsonPropertyName("actual_settlement")] + public string? ActualSettlementString { get; set; } + } + + public class ChannelInfo + { + /// + /// 获取或设置渠道类型。 + /// + [Newtonsoft.Json.JsonProperty("channel_type")] + [System.Text.Json.Serialization.JsonPropertyName("channel_type")] + public int ChannelType { get; set; } + + /// + /// 获取或设置渠道 AppId。 + /// + [Newtonsoft.Json.JsonProperty("channel_id")] + [System.Text.Json.Serialization.JsonPropertyName("channel_id")] + public string AppId { get; set; } = default!; + + /// + /// 获取或设置渠道名称。 + /// + [Newtonsoft.Json.JsonProperty("channel_name")] + [System.Text.Json.Serialization.JsonPropertyName("channel_name")] + public string Name { get; set; } = default!; + } + } + + /// + /// 获取或设置基础信息。 + /// + [Newtonsoft.Json.JsonProperty("base_info")] + [System.Text.Json.Serialization.JsonPropertyName("base_info")] + public Types.BaseInfo BaseInfo { get; set; } = default!; + + /// + /// 获取或设置佣金信息。 + /// + [Newtonsoft.Json.JsonProperty("commission_info")] + [System.Text.Json.Serialization.JsonPropertyName("commission_info")] + public Types.CommissionInfo CommissionInfo { get; set; } = default!; + + /// + /// 获取或设置视频号信息。 + /// + [Newtonsoft.Json.JsonProperty("channel_info")] + [System.Text.Json.Serialization.JsonPropertyName("channel_info")] + public Types.ChannelInfo ChannelInfo { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderListRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderListRequest.cs new file mode 100644 index 00000000..a14f326a --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderListRequest.cs @@ -0,0 +1,44 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/talent/get_order_list 接口的请求。 + /// + public class ChannelsECTalentGetOrderListRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置佣金单创建时间范围的开始时间戳。 + /// + [Newtonsoft.Json.JsonProperty("create_time_gt")] + [System.Text.Json.Serialization.JsonPropertyName("create_time_gt")] + public long? StartCreateTimestamp { get; set; } + + /// + /// 获取或设置佣金单创建时间范围的结束时间戳。 + /// + [Newtonsoft.Json.JsonProperty("create_time_lt")] + [System.Text.Json.Serialization.JsonPropertyName("create_time_lt")] + public long? EndCreateTimestamp { get; set; } + + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public string? OrderId { get; set; } + + /// + /// 获取或设置分页每页数量。 + /// 默认值:10 + /// + [Newtonsoft.Json.JsonProperty("page_size")] + [System.Text.Json.Serialization.JsonPropertyName("page_size")] + public int Limit { get; set; } = 10; + + /// + /// 获取或设置翻页标记。 + /// + [Newtonsoft.Json.JsonProperty("next_key")] + [System.Text.Json.Serialization.JsonPropertyName("next_key")] + public string? Cursor { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderListResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderListResponse.cs new file mode 100644 index 00000000..3194b529 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Order/ChannelsECTalentGetOrderListResponse.cs @@ -0,0 +1,51 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/talent/get_order_list 接口的响应。 + /// + public class ChannelsECTalentGetOrderListResponse : WechatApiResponse + { + public static class Types + { + public class Order + { + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string OrderId { get; set; } = default!; + + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("sku_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public long SKUId { get; set; } + } + } + + /// + /// 获取或设置订单列表。 + /// + [Newtonsoft.Json.JsonProperty("order_list")] + [System.Text.Json.Serialization.JsonPropertyName("order_list")] + public Types.Order[] OrderList { get; set; } = default!; + + /// + /// 获取或设置是否还有更多。 + /// + [Newtonsoft.Json.JsonProperty("has_more")] + [System.Text.Json.Serialization.JsonPropertyName("has_more")] + public bool HasMore { get; set; } + + /// + /// 获取或设置翻页标记。 + /// + [Newtonsoft.Json.JsonProperty("next_key")] + [System.Text.Json.Serialization.JsonPropertyName("next_key")] + public string? NextCursor { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetRequest.cs new file mode 100644 index 00000000..1376a270 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/talent/window/product/get 接口的请求。 + /// + public class ChannelsECTalentWindowProductGetRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + public long ProductId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetResponse.cs new file mode 100644 index 00000000..f0345dda --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetResponse.cs @@ -0,0 +1,107 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/talent/window/product/get 接口的响应。 + /// + public class ChannelsECTalentWindowProductGetResponse : WechatApiResponse + { + public static class Types + { + public class Product + { + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public long ProductId { get; set; } + + /// + /// 获取或设置店铺 AppId。 + /// + [Newtonsoft.Json.JsonProperty("appid")] + [System.Text.Json.Serialization.JsonPropertyName("appid")] + public string? AppId { get; set; } + + /// + /// 获取或设置商家自定义商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("out_product_id")] + [System.Text.Json.Serialization.JsonPropertyName("out_product_id")] + public string? OutProductId { get; set; } + + /// + /// 获取或设置商品标题。 + /// + [Newtonsoft.Json.JsonProperty("title")] + [System.Text.Json.Serialization.JsonPropertyName("title")] + public string Title { get; set; } = default!; + + /// + /// 获取或设置商品头图 URL。 + /// + [Newtonsoft.Json.JsonProperty("img_url")] + [System.Text.Json.Serialization.JsonPropertyName("img_url")] + public string ImageUrl { get; set; } = default!; + + /// + /// 获取或设置商品类目 ID。 + /// + [Newtonsoft.Json.JsonProperty("leaf_category_id")] + [System.Text.Json.Serialization.JsonPropertyName("leaf_category_id")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long CategoryId { get; set; } + + /// + /// 获取或设置商品状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public int Status { get; set; } + + /// + /// 获取或设置售价(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("selling_price")] + [System.Text.Json.Serialization.JsonPropertyName("selling_price")] + public int SellingPrice { get; set; } + + /// + /// 获取或设置库存。 + /// + [Newtonsoft.Json.JsonProperty("stock")] + [System.Text.Json.Serialization.JsonPropertyName("stock")] + public int Stock { get; set; } + + /// + /// 获取或设置销量。 + /// + [Newtonsoft.Json.JsonProperty("sales")] + [System.Text.Json.Serialization.JsonPropertyName("sales")] + public int Sales { get; set; } + + /// + /// 获取或设置是否隐藏。 + /// + [Newtonsoft.Json.JsonProperty("is_hide")] + [System.Text.Json.Serialization.JsonPropertyName("is_hide")] + public bool IsHidden { get; set; } + + /// + /// 获取或设置商品小程序跳转小店场景添加商品时传递的跟佣信息。 + /// + [Newtonsoft.Json.JsonProperty("product_promotion_link")] + [System.Text.Json.Serialization.JsonPropertyName("product_promotion_link")] + public string? ProductPromotionLink { get; set; } + } + } + + /// + /// 获取或设置商品信息。 + /// + [Newtonsoft.Json.JsonProperty("product")] + [System.Text.Json.Serialization.JsonPropertyName("product")] + public Types.Product Product { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetRequest.cs new file mode 100644 index 00000000..06409535 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetRequest.cs @@ -0,0 +1,30 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/talent/window/product/list/get 接口的请求。 + /// + public class ChannelsECTalentWindowProductListGetRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置分页页数。与字段 二选一。 + /// + [Newtonsoft.Json.JsonProperty("page_index")] + [System.Text.Json.Serialization.JsonPropertyName("page_index")] + public int? Page { get; set; } + + /// + /// 获取或设置分页每页数量。 + /// 默认值:10 + /// + [Newtonsoft.Json.JsonProperty("page_size")] + [System.Text.Json.Serialization.JsonPropertyName("page_size")] + public int Limit { get; set; } = 10; + + /// + /// 获取或设置翻页标记。与字段 二选一。 + /// + [Newtonsoft.Json.JsonProperty("last_buffer")] + [System.Text.Json.Serialization.JsonPropertyName("last_buffer")] + public string? Cursor { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetResponse.cs new file mode 100644 index 00000000..7f9d4037 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetResponse.cs @@ -0,0 +1,57 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/talent/window/product/list/get 接口的响应。 + /// + public class ChannelsECTalentWindowProductListGetResponse : WechatApiResponse + { + public static class Types + { + public class Product + { + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public long ProductId { get; set; } + + /// + /// 获取或设置商品来源。 + /// + [Newtonsoft.Json.JsonProperty("product_source")] + [System.Text.Json.Serialization.JsonPropertyName("product_source")] + public int ProductSource { get; set; } + + /// + /// 获取或设置店铺 AppId。 + /// + [Newtonsoft.Json.JsonProperty("appid")] + [System.Text.Json.Serialization.JsonPropertyName("appid")] + public string? AppId { get; set; } + + /// + /// 获取或设置商家自定义商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("out_product_id")] + [System.Text.Json.Serialization.JsonPropertyName("out_product_id")] + public string? OutProductId { get; set; } + } + } + + /// + /// 获取或设置商品列表。 + /// + [Newtonsoft.Json.JsonProperty("products")] + [System.Text.Json.Serialization.JsonPropertyName("products")] + public Types.Product[] ProductList { get; set; } = default!; + + /// + /// 获取或设置翻页标记。 + /// + [Newtonsoft.Json.JsonProperty("last_buffer")] + [System.Text.Json.Serialization.JsonPropertyName("last_buffer")] + public string? NextCursor { get; set; } + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailRequest.json new file mode 100644 index 00000000..620d8085 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailRequest.json @@ -0,0 +1,4 @@ +{ + "order_id": "123", + "sku_id": "12345" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailResponse.json new file mode 100644 index 00000000..9078ccb8 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderDetailResponse.json @@ -0,0 +1,30 @@ +{ + "errcode": "0", + "errmsg": "ok", + "base_info": { + "order_id": "202402260001", + "spu_id": "123456", + "sku_id": "987654", + "order_status": 2, + "actual_payment": "99.99", + "order_create_time": 1700000000, + "order_update_time": 1700003600, + "buyer_info": { + "open_id": "o1234567890abcdef", + "union_id": "u1234567890abcdef" + } + }, + "commission_info": { + "state": 1, + "ratio": "0", + "expect_settle_time": 1701000000, + "expect_settlement": "9.99", + "actual_settle_time": 1702000000, + "actual_settlement": "9.99" + }, + "channel_info": { + "channel_type": 2, + "channel_id": "channel_12345", + "channel_name": "某视频号" + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderListRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderListRequest.json new file mode 100644 index 00000000..3cac32f7 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderListRequest.json @@ -0,0 +1,3 @@ +{ + "page_size": 1 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderListResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderListResponse.json new file mode 100644 index 00000000..b02ac4de --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Order/ChannelsECTalentGetOrderListResponse.json @@ -0,0 +1,11 @@ +{ + "errcode": 0, + "errmsg": "ok", + "order_list": [ + { + "order_id": "123", + "sku_id": "1234" + } + ], + "has_more": true +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetRequest.json new file mode 100644 index 00000000..a2a009eb --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetRequest.json @@ -0,0 +1,3 @@ +{ + "product_id": "14000000000000" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetResponse.json new file mode 100644 index 00000000..347ee505 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductGetResponse.json @@ -0,0 +1,18 @@ +{ + "errcode": 0, + "errmsg": "ok", + "product": { + "product_id": "1000000000000", + "appid": "wxee9f94a33abcdefg", + "out_product_id": "", + "title": "api测试商品", + "img_url": "https://mmecimage.cn/p/wx37f38d59298839c3/HJE9eJaEc5bJk-eaArVdILSB7MMaHgdK2-JIn51nMQ", + "leaf_category_id": 6091, + "status": 1, + "selling_price": 999, + "stock": 1, + "sales": 123, + "is_hide": false, + "product_promotion_link": "v1=HAOHK025pGFF8tBx69zbwNpU473uiTNa5MOHrs_Hknqa_-Cjk9IbBHMHeKh5rSnIrQ" + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetRequest.json new file mode 100644 index 00000000..ece629ec --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetRequest.json @@ -0,0 +1,5 @@ +{ + "page_size": 1, + "page_index": 1, + "last_buffer": "abcdefg" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetResponse.json new file mode 100644 index 00000000..b42c2469 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECTalent/Window/ChannelsECTalentWindowProductListGetResponse.json @@ -0,0 +1,17 @@ +{ + "errcode": 0, + "errmsg": "ok", + "products": [ + { + "product_id": "1000000000000", + "appid": "wxee9f94a33abcdefg", + "product_source": 1 + }, + { + "product_id": "14000000000000", + "out_product_id": "100000012356", + "product_source": 2 + } + ], + "last_buffer": "EB4YAg=" +}