diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index f7566814..30dc4c40 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -2883,52 +2883,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } - /// - /// 异步调用 [POST] /channels/ec/product/stock/update 接口。 - /// - /// REF:
- /// - ///
- ///
- /// - /// - /// - /// - public static async Task ExecuteChannelsECProductStockUpdateAsync(this WechatApiClient client, Models.ChannelsECProductStockUpdateRequest 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", "product", "stock", "update") - .SetQueryParam("access_token", request.AccessToken); - - return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); - } - - /// - /// 异步调用 [POST] /channels/ec/product/stock/get 接口。 - /// - /// REF:
- /// - ///
- ///
- /// - /// - /// - /// - public static async Task ExecuteChannelsECProductStockGetAsync(this WechatApiClient client, Models.ChannelsECProductStockGetRequest 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", "product", "stock", "get") - .SetQueryParam("access_token", request.AccessToken); - - return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); - } - #region ECProduct/LimitedDiscountTask /// /// 异步调用 [POST] /channels/ec/product/limiteddiscounttask/add 接口。 @@ -3022,6 +2976,100 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #endregion + + #region ECProduct/Stock + /// + /// 异步调用 [POST] /channels/ec/product/stock/update 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECProductStockUpdateAsync(this WechatApiClient client, Models.ChannelsECProductStockUpdateRequest 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", "product", "stock", "update") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /channels/ec/product/stock/get 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECProductStockGetAsync(this WechatApiClient client, Models.ChannelsECProductStockGetRequest 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", "product", "stock", "get") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /channels/ec/product/stock/batchget 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECProductStockBatchGetAsync(this WechatApiClient client, Models.ChannelsECProductStockBatchGetRequest 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", "product", "stock", "batchget") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /channels/ec/product/stock/getflow 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECProductStockGetFlowAsync(this WechatApiClient client, Models.ChannelsECProductStockGetFlowRequest 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", "product", "stock", "getflow") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #endregion #endregion #region ECQIC diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetRequest.cs new file mode 100644 index 00000000..b20f07ad --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetRequest.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/product/stock/batchget 接口的请求。 + /// + public class ChannelsECProductStockBatchGetRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置商品 ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + public IList ProductIdList { get; set; } = new List(); + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetResponse.cs new file mode 100644 index 00000000..c5e661cd --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetResponse.cs @@ -0,0 +1,70 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/product/stock/batchget 接口的响应。 + /// + public class ChannelsECProductStockBatchGetResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class ProductStock + { + public static class Types + { + public class SKUStock : ChannelsECProductStockGetResponse.Types.Data + { + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("sku_id")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long SKUId { get; set; } + + /// + /// 获取或设置达人专属计划营销库存。 + /// + [Newtonsoft.Json.JsonProperty("finder_total_num")] + [System.Text.Json.Serialization.JsonPropertyName("finder_total_num")] + public int? FinderTotalStock { get; set; } + } + } + + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long ProductId { get; set; } + + /// + /// 获取或设置 SKU 库存列表。 + /// + [Newtonsoft.Json.JsonProperty("sku_stock")] + [System.Text.Json.Serialization.JsonPropertyName("sku_stock")] + public Types.SKUStock[] SKUStockList { get; set; } = default!; + } + } + + /// + /// 获取或设置商品库存列表。 + /// + [Newtonsoft.Json.JsonProperty("spu_stock_list")] + [System.Text.Json.Serialization.JsonPropertyName("spu_stock_list")] + public Types.ProductStock[] StockList { get; set; } = default!; + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowRequest.cs new file mode 100644 index 00000000..1e35545f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowRequest.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/product/stock/getflow 接口的请求。 + /// + public class ChannelsECProductStockGetFlowRequest : WechatApiRequest, IInferable + { + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + public long ProductId { get; set; } + + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("sku_id")] + public long SKUId { get; set; } + + /// + /// 获取或设置库存类型。 + /// + [Newtonsoft.Json.JsonProperty("stock_type")] + [System.Text.Json.Serialization.JsonPropertyName("stock_type")] + public int StockType { get; set; } + + /// + /// 获取或设置达人的视频号。 + /// + [Newtonsoft.Json.JsonProperty("finder_id")] + [System.Text.Json.Serialization.JsonPropertyName("finder_id")] + public string? FinderId { get; set; } + + /// + /// 获取或设置时间范围开始时间戳。 + /// + [Newtonsoft.Json.JsonProperty("begin_time")] + [System.Text.Json.Serialization.JsonPropertyName("begin_time")] + public long BeginTimestamp { get; set; } + + /// + /// 获取或设置时间范围结束时间戳。 + /// + [Newtonsoft.Json.JsonProperty("end_time")] + [System.Text.Json.Serialization.JsonPropertyName("end_time")] + public long EndTimestamp { get; set; } + + /// + /// 获取或设置库存事件类型。 + /// + [Newtonsoft.Json.JsonProperty("op_type_list")] + [System.Text.Json.Serialization.JsonPropertyName("op_type_list")] + public IList? OperateTypeList { get; set; } + + /// + /// 获取或设置分页每页数量。 + /// 默认值:10 + /// + [Newtonsoft.Json.JsonProperty("page_size")] + [System.Text.Json.Serialization.JsonPropertyName("page_size")] + public int PageSize { get; set; } = 10; + + /// + /// 获取或设置分页游标。 + /// + [Newtonsoft.Json.JsonProperty("next_key")] + [System.Text.Json.Serialization.JsonPropertyName("next_key")] + public string? PageCursor { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowResponse.cs new file mode 100644 index 00000000..dc6f9003 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowResponse.cs @@ -0,0 +1,146 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/product/stock/getflow 接口的响应。 + /// + public class ChannelsECProductStockGetFlowResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class StockFlow + { + public static class Types + { + public class ExtraInfo + { + /// + /// 获取或设置归还的源库存子类型。 + /// + [Newtonsoft.Json.JsonProperty("unmove_from_stock_sub_type")] + [System.Text.Json.Serialization.JsonPropertyName("unmove_from_stock_sub_type")] + public int? UnmoveFromStockSubType { get; set; } + + /// + /// 获取或设置分配的目标库存子类型。 + /// + [Newtonsoft.Json.JsonProperty("move_to_stock_sub_type")] + [System.Text.Json.Serialization.JsonPropertyName("move_to_stock_sub_type")] + public int? MoveToStockSubType { get; set; } + + /// + /// 获取或设置操作来源。 + /// + [Newtonsoft.Json.JsonProperty("upload_source")] + [System.Text.Json.Serialization.JsonPropertyName("upload_source")] + public int? UploadSource { get; set; } + + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public string? OrderId { get; set; } + + /// + /// 获取或设置区域仓库 ID。 + /// + [Newtonsoft.Json.JsonProperty("out_warehouse_id")] + [System.Text.Json.Serialization.JsonPropertyName("out_warehouse_id")] + public string? OutWarehouseId { get; set; } + + /// + /// 获取或设置限时抢购任务 ID。 + /// + [Newtonsoft.Json.JsonProperty("limited_discount_id")] + [System.Text.Json.Serialization.JsonPropertyName("limited_discount_id")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public long? LimitedDiscountTaskId { get; set; } + + /// + /// 获取或设置达人的视频号。 + /// + [Newtonsoft.Json.JsonProperty("finder_id")] + [System.Text.Json.Serialization.JsonPropertyName("finder_id")] + public string? FinderId { get; set; } + } + } + + /// + /// 获取或设置操作数量。 + /// + [Newtonsoft.Json.JsonProperty("amount")] + [System.Text.Json.Serialization.JsonPropertyName("amount")] + public int Amount { get; set; } + + /// + /// 获取或设置开始数量。 + /// + [Newtonsoft.Json.JsonProperty("beginning_amount")] + [System.Text.Json.Serialization.JsonPropertyName("beginning_amount")] + public int BeginningAmount { get; set; } + + /// + /// 获取或设置结束数量。 + /// + [Newtonsoft.Json.JsonProperty("ending_amount")] + [System.Text.Json.Serialization.JsonPropertyName("ending_amount")] + public int EndingAmount { get; set; } + + /// + /// 获取或设置库存子类型。 + /// + [Newtonsoft.Json.JsonProperty("stock_sub_type")] + [System.Text.Json.Serialization.JsonPropertyName("stock_sub_type")] + public int StockSubType { get; set; } + + /// + /// 获取或设置库存事件类型。 + /// + [Newtonsoft.Json.JsonProperty("op_type")] + [System.Text.Json.Serialization.JsonPropertyName("op_type")] + public int OperateType { get; set; } + + /// + /// 获取或设置流水发生时间戳。 + /// + [Newtonsoft.Json.JsonProperty("update_time")] + [System.Text.Json.Serialization.JsonPropertyName("update_time")] + public long UpdateTimestamp { get; set; } + + /// + /// 获取或设置额外信息。 + /// + [Newtonsoft.Json.JsonProperty("ext_info")] + [System.Text.Json.Serialization.JsonPropertyName("ext_info")] + public Types.ExtraInfo? ExtraInfo { get; set; } + } + } + + /// + /// 获取或设置库存流水列表。 + /// + [Newtonsoft.Json.JsonProperty("stock_flow_info_list")] + [System.Text.Json.Serialization.JsonPropertyName("stock_flow_info_list")] + public Types.StockFlow[] StockFlowList { get; set; } = default!; + + /// + /// 获取或设置下一页分页游标。 + /// + [Newtonsoft.Json.JsonProperty("next_key")] + [System.Text.Json.Serialization.JsonPropertyName("next_key")] + public string? NextCursor { get; set; } + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductStockGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetRequest.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductStockGetRequest.cs rename to src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetRequest.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductStockGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetResponse.cs similarity index 88% rename from src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductStockGetResponse.cs rename to src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetResponse.cs index 039437ef..727f2a6d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductStockGetResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockGetResponse.cs @@ -26,6 +26,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models [Newtonsoft.Json.JsonProperty("num")] [System.Text.Json.Serialization.JsonPropertyName("num")] public int Stock { get; set; } + + /// + /// 获取或设置锁定库存数量。 + /// + [Newtonsoft.Json.JsonProperty("lock_stock")] + [System.Text.Json.Serialization.JsonPropertyName("lock_stock")] + public int? LockStock { get; set; } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductStockUpdateRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockUpdateRequest.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductStockUpdateRequest.cs rename to src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockUpdateRequest.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductStockUpdateResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockUpdateResponse.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/ChannelsECProductStockUpdateResponse.cs rename to src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/Stock/ChannelsECProductStockUpdateResponse.cs diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetRequest.json new file mode 100644 index 00000000..9972b17f --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetRequest.json @@ -0,0 +1,3 @@ +{ + "product_id": [ "10000017524246" ] +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetResponse.json new file mode 100644 index 00000000..e0f3a6a7 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockBatchGetResponse.json @@ -0,0 +1,42 @@ +{ + "errcode": 0, + "errmsg": "ok", + "data": { + "spu_stock_list": [ + { + "product_id": "10000017524246", + "sku_stock": [ + { + "sku_id": "764787449", + "normal_stock_num": 990, + "limited_discount_stock_num": 0, + "warehouse_stocks": [ + { + "out_warehouse_id": "test4", + "num": 44, + "lock_stock": 0 + }, + { + "out_warehouse_id": "test2", + "num": 44, + "lock_stock": 0 + }, + { + "out_warehouse_id": "test3", + "num": 8, + "lock_stock": 0 + }, + { + "out_warehouse_id": "test1", + "num": 80, + "lock_stock": 0 + } + ], + "finder_total_num": 300, + "total_stock_num": 1166 + } + ] + } + ] + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowRequest.json new file mode 100644 index 00000000..7cab13d1 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowRequest.json @@ -0,0 +1,8 @@ +{ + "product_id": "10000032267694", + "sku_id": "1064839936", + "stock_type": 0, + "begin_time": 1689218360, + "end_time": 1689736760, + "page_size": 10 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowResponse.json new file mode 100644 index 00000000..65f88533 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetFlowResponse.json @@ -0,0 +1,39 @@ +{ + "errcode": 0, + "errmsg": "ok", + "data": { + "stock_flow_info_list": [ + { + "amount": 300, + "beginning_amount": 842, + "ending_amount": 542, + "stock_sub_type": 1, + "op_type": 6, + "update_time": 1689735682, + "ext_info": { + "move_to_stock_sub_type": 4, + "upload_source": 0, + "order_id": "0", + "out_warehouse_id": "", + "limited_discount_id": "0", + "finder_id": "sphn9rhffKDiLAf" + } + }, + { + "amount": 1, + "beginning_amount": 843, + "ending_amount": 842, + "stock_sub_type": 1, + "op_type": 4, + "update_time": 1689520907, + "ext_info": { + "upload_source": 0, + "order_id": "3712984209868589056", + "out_warehouse_id": "", + "limited_discount_id": "0" + } + } + ], + "next_key": "" + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetRequest.json new file mode 100644 index 00000000..a0f972c1 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetRequest.json @@ -0,0 +1,4 @@ +{ + "product_id": "10000000088178", + "sku_id": "462966239" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetResponse.json new file mode 100644 index 00000000..7f9fedc6 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockGetResponse.json @@ -0,0 +1,27 @@ +{ + "errcode": 0, + "errmsg": "ok", + "data": { + "normal_stock_num": 998, + "limited_discount_stock_num": 0, + "warehouse_stocks": [ + { + "out_warehouse_id": "test1", + "num": 10 + }, + { + "out_warehouse_id": "test2", + "num": 22 + }, + { + "out_warehouse_id": "test3", + "num": 33 + }, + { + "out_warehouse_id": "test4", + "num": 44 + } + ], + "total_stock_num": 1107 + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/ChannelsECProductStockUpdateRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockUpdateRequest.json similarity index 100% rename from test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/ChannelsECProductStockUpdateRequest.json rename to test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/Stock/ChannelsECProductStockUpdateRequest.json