From 85c6ebe7c4da6590d6b29d17940d71c2b454d0a5 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 10:50:18 +0800 Subject: [PATCH 01/12] =?UTF-8?q?feat(tiktokshop):=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TextualDecimalReadOnlyConverter.cs | 20 -- ...TextualNullableDecimalReadOnlyConverter.cs | 40 ---- .../TikTokShopRequestSignatureException.cs | 24 --- .../TikTokShopRequestTimeoutException.cs | 24 --- .../TikTokShopClientExecuteAuthExtensions.cs | 24 ++- ...ikTokShopClientExecuteFinanceExtensions.cs | 27 ++- ...kShopClientExecuteFulfillmentExtensions.cs | 146 +++++++++----- ...hopClientExecuteGlobalProductExtensions.cs | 90 ++++++--- ...TokShopClientExecuteLogisticsExtensions.cs | 56 ++++-- .../TikTokShopClientExecuteOrderExtensions.cs | 22 ++- ...ikTokShopClientExecuteProductExtensions.cs | 179 ++++++++++++------ ...TokShopClientExecutePromotionExtensions.cs | 63 ++++-- ...ikTokShopClientExecuteReverseExtensions.cs | 51 +++-- ...TikTokShopClientExecuteSellerExtensions.cs | 18 +- .../TikTokShopClientExecuteShopExtensions.cs | 9 +- ...kShopClientExecuteSupplyChainExtensions.cs | 9 +- ...=> TikTokShopRequestSigningInterceptor.cs} | 25 +-- .../FinanceSearchSettlementsResponse.cs | 56 +++--- .../FinanceSearchTransactionsResponse.cs | 2 +- .../FulfillmentGetPackageDetailResponse.cs | 6 +- .../FulfillmentSearchPackagesResponse.cs | 2 +- .../FulfillmentShipPackageResponse.cs | 2 +- ...mentUpdatePackageDeliveryStatusResponse.cs | 2 +- .../FulfillmentConfirmOrderSplitResponse.cs | 8 +- .../FulfillmentRemovePackageOrdersResponse.cs | 4 +- .../FulfillmentVerifyOrderSplitResponse.cs | 4 +- ...illmentConfirmPreCombinePackageResponse.cs | 4 +- ...illmentSearchPreCombinePackagesResponse.cs | 2 +- .../GlobalProductGetCategoryListResponse.cs | 4 +- .../GlobalProductCreateProductResponse.cs | 4 +- .../GlobalProductGetProductDetailResponse.cs | 20 +- .../GlobalProductPublishProductResponse.cs | 12 +- .../GlobalProductSearchProductsResponse.cs | 4 +- ...GlobalProductUpdateProductPriceResponse.cs | 4 +- .../GlobalProductUpdateProductResponse.cs | 10 +- ...ogisticsGetShippingProviderListResponse.cs | 2 +- ...icsGetSubscribedDeliveryOptionsResponse.cs | 2 +- .../Order/OrderGetOrderDetailResponse.cs | 52 ++--- .../Models/Order/OrderSearchOrdersResponse.cs | 2 +- .../Category/ProductCreateBrandResponse.cs | 2 +- .../ProductGetAttributeListResponse.cs | 4 +- .../Category/ProductGetBrandListResponse.cs | 2 +- .../ProductGetCategoryListResponse.cs | 4 +- .../ProductGetCategoryRulesResponse.cs | 2 +- .../ProductRecommendCategoryResponse.cs | 4 +- .../ProductActivateProductsResponse.cs | 2 +- .../Product/ProductCreateProductResponse.cs | 8 +- .../ProductGetProductDetailResponse.cs | 18 +- .../Product/ProductSearchProductsResponse.cs | 10 +- .../ProductUpdateProductStockResponse.cs | 2 +- ...romotionAddOrUpdateActivityItemsRequest.cs | 8 +- ...omotionAddOrUpdateActivityItemsResponse.cs | 2 +- .../PromotionRemoveActivityItemsResponse.cs | 2 +- .../PromotionCreateActivityResponse.cs | 2 +- .../PromotionDeactivateActivityResponse.cs | 2 +- .../PromotionGetActivityDetailResponse.cs | 18 +- .../PromotionSearchActivitiesResponse.cs | 4 +- .../PromotionUpdateActivityResponse.cs | 2 +- .../ReverseSearchReverseOrdersRequest.cs | 4 +- .../ReverseSearchReverseOrdersResponse.cs | 10 +- .../SellerGetGlobalActiveShopListResponse.cs | 2 +- .../Shop/ShopGetAuthorizedShopListResponse.cs | 2 +- ...ChainSyncPackageFulfillmentDataResponse.cs | 2 +- ...tpClient.ByteDance.TikTokGlobalShop.csproj | 6 +- .../Settings/Credentials.cs | 2 +- .../TikTokShopClient.cs | 105 ++++------ .../TikTokShopException.cs | 4 +- .../TikTokShopRequest.cs | 9 +- .../TikTokShopResponse.cs | 59 +----- .../Utilities/HMACUtility.cs | 47 +++-- .../IMPORTANT_CodeAnalyzeTests.cs | 55 ++++++ ...yteDance.TikTokGlobalShop.UnitTests.csproj | 16 +- .../TestCase_CodeReview.cs | 28 --- .../TestConfigs.cs | 8 +- .../appsettings.json | 6 +- 75 files changed, 777 insertions(+), 721 deletions(-) delete mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Converters/Internal/System.Text.Json/Decimal/TextualDecimalReadOnlyConverter.cs delete mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Converters/Internal/System.Text.Json/Decimal/TextualNullableDecimalReadOnlyConverter.cs delete mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Exceptions/TikTokShopRequestSignatureException.cs delete mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Exceptions/TikTokShopRequestTimeoutException.cs rename src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Interceptors/{TikTokShopRequestSignatureInterceptor.cs => TikTokShopRequestSigningInterceptor.cs} (62%) create mode 100644 test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/IMPORTANT_CodeAnalyzeTests.cs delete mode 100644 test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/TestCase_CodeReview.cs diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Converters/Internal/System.Text.Json/Decimal/TextualDecimalReadOnlyConverter.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Converters/Internal/System.Text.Json/Decimal/TextualDecimalReadOnlyConverter.cs deleted file mode 100644 index c584243f..00000000 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Converters/Internal/System.Text.Json/Decimal/TextualDecimalReadOnlyConverter.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text.Json.Serialization; - -namespace System.Text.Json.Converters -{ - internal class TextualDecimalReadOnlyConverter : JsonConverter - { - private readonly JsonConverter _converter = new TextualNullableDecimalReadOnlyConverter(); - - public override decimal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - decimal? result = _converter.Read(ref reader, typeToConvert, options); - return result.GetValueOrDefault(); - } - - public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerOptions options) - { - _converter.Write(writer, value, options); - } - } -} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Converters/Internal/System.Text.Json/Decimal/TextualNullableDecimalReadOnlyConverter.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Converters/Internal/System.Text.Json/Decimal/TextualNullableDecimalReadOnlyConverter.cs deleted file mode 100644 index 1325ee1c..00000000 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Converters/Internal/System.Text.Json/Decimal/TextualNullableDecimalReadOnlyConverter.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Text.Json.Serialization; - -namespace System.Text.Json.Converters -{ - internal class TextualNullableDecimalReadOnlyConverter : JsonConverter - { - public override decimal? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType == JsonTokenType.Null) - { - return default; - } - else if (reader.TokenType == JsonTokenType.String) - { - string? str = reader.GetString(); - if (string.IsNullOrEmpty(str)) - return default; - - if (decimal.TryParse(str, out decimal value)) - return value; - - throw new JsonException($"Could not parse String '{str}' to Decimal."); - } - else if (reader.TokenType == JsonTokenType.Number) - { - return reader.GetDecimal(); - } - - throw new JsonException(); - } - - public override void Write(Utf8JsonWriter writer, decimal? value, JsonSerializerOptions options) - { - if (value != null) - writer.WriteNumberValue(value.Value); - else - writer.WriteNullValue(); - } - } -} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Exceptions/TikTokShopRequestSignatureException.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Exceptions/TikTokShopRequestSignatureException.cs deleted file mode 100644 index 3f19734c..00000000 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Exceptions/TikTokShopRequestSignatureException.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Exceptions -{ - public class TikTokShopRequestSignatureException : TikTokShopException - { - /// - internal TikTokShopRequestSignatureException() - { - } - - /// - internal TikTokShopRequestSignatureException(string message) - : base(message) - { - } - - /// - internal TikTokShopRequestSignatureException(string message, Exception innerException) - : base(message, innerException) - { - } - } -} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Exceptions/TikTokShopRequestTimeoutException.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Exceptions/TikTokShopRequestTimeoutException.cs deleted file mode 100644 index a4ebfc5d..00000000 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Exceptions/TikTokShopRequestTimeoutException.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Exceptions -{ - public class TikTokShopRequestTimeoutException : TikTokShopException - { - /// - internal TikTokShopRequestTimeoutException() - { - } - - /// - internal TikTokShopRequestTimeoutException(string message) - : base(message) - { - } - - /// - internal TikTokShopRequestTimeoutException(string message, Exception innerException) - : base(message, innerException) - { - } - } -} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs index 4d57ad52..daf57992 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs @@ -11,7 +11,10 @@ public static class TikTokShopClientExecuteAuthExtensions { /// /// 异步调用 [GET] /token/get 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/261250 + /// + /// REF:
+ /// + ///
///
/// /// @@ -23,21 +26,24 @@ public static class TikTokShopClientExecuteAuthExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "token", "get") - .WithUrl($"{client.EndpointForAuthAPI}/token/get") + .CreateFlurlRequest(request, HttpMethod.Get, "token", "get") + .WithUrl($"{client.EndpointForAuth}/token/get") .RemoveQueryParams("app_key", "access_token", "timestamp", "shop_id", "version") .SetQueryParam("app_key", client.Credentials.AppKey) .SetQueryParam("app_secret", client.Credentials.AppSecret) .SetQueryParam("grant_type", request.GrantType) .SetQueryParam("auth_code", request.AuthorizedCode); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /token/refresh 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/261250 - /// REF: https://partner.tiktokshop.com/doc/page/262967 + /// + /// REF:
+ ///
+ /// + ///
///
/// /// @@ -49,15 +55,15 @@ public static class TikTokShopClientExecuteAuthExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "token", "refresh") - .WithUrl($"{client.EndpointForAuthAPI}/token/refresh") + .CreateFlurlRequest(request, HttpMethod.Get, "token", "refresh") + .WithUrl($"{client.EndpointForAuth}/token/refresh") .RemoveQueryParams("app_key", "access_token", "timestamp", "shop_id", "version") .SetQueryParam("app_key", client.Credentials.AppKey) .SetQueryParam("app_secret", client.Credentials.AppSecret) .SetQueryParam("grant_type", request.GrantType) .SetQueryParam("refresh_token", request.RefreshToken); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFinanceExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFinanceExtensions.cs index eb4b5de5..b8ffce40 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFinanceExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFinanceExtensions.cs @@ -11,7 +11,10 @@ public static class TikTokShopClientExecuteFinanceExtensions { /// /// 异步调用 [POST] /finance/transactions/search 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262881 + /// + /// REF:
+ /// + ///
///
/// /// @@ -23,14 +26,17 @@ public static class TikTokShopClientExecuteFinanceExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "finance", "transactions", "search"); + .CreateFlurlRequest(request, HttpMethod.Post, "finance", "transactions", "search"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /finance/settlements/search 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262880 + /// + /// REF:
+ /// + ///
///
/// /// @@ -42,14 +48,17 @@ public static class TikTokShopClientExecuteFinanceExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "finance", "settlements", "search"); + .CreateFlurlRequest(request, HttpMethod.Post, "finance", "settlements", "search"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /finance/order/settlements 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262880 + /// + /// REF:
+ /// + ///
///
/// /// @@ -61,10 +70,10 @@ public static class TikTokShopClientExecuteFinanceExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "finance", "order", "settlements") + .CreateFlurlRequest(request, HttpMethod.Get, "finance", "order", "settlements") .SetQueryParam("order_id", request.OrderId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFulfillmentExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFulfillmentExtensions.cs index 22a43f55..3919b5e6 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFulfillmentExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFulfillmentExtensions.cs @@ -11,7 +11,10 @@ public static class TikTokShopClientExecuteFulfillmentExtensions { /// /// 异步调用 [POST] /fulfillment/search 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262835 + /// + /// REF:
+ /// + ///
///
/// /// @@ -23,14 +26,17 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "search"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "search"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /fulfillment/detail 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262840 + /// + /// REF:
+ /// + ///
///
/// /// @@ -42,15 +48,18 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "fulfillment", "detail") + .CreateFlurlRequest(request, HttpMethod.Get, "fulfillment", "detail") .SetQueryParam("package_id", request.PackageId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /fulfillment/shipping_info 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262834 + /// + /// REF:
+ /// + ///
///
/// /// @@ -62,15 +71,18 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "fulfillment", "shipping_info") + .CreateFlurlRequest(request, HttpMethod.Get, "fulfillment", "shipping_info") .SetQueryParam("package_id", request.PackageId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /fulfillment/shipping_document 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262832 + /// + /// REF:
+ /// + ///
///
/// /// @@ -82,19 +94,22 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "fulfillment", "shipping_document") + .CreateFlurlRequest(request, HttpMethod.Get, "fulfillment", "shipping_document") .SetQueryParam("package_id", request.PackageId) .SetQueryParam("document_type", request.DocumentType); - if (request.DocumentSize != null) + if (request.DocumentSize is not null) flurlReq.SetQueryParam("document_size", request.DocumentSize); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /fulfillment/rts 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262835 + /// + /// REF:
+ /// + ///
///
/// /// @@ -106,14 +121,17 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "rts"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "rts"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /fulfillment/batch_rts 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262844 + /// + /// REF:
+ /// + ///
///
/// /// @@ -125,14 +143,17 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "batch_rts"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "batch_rts"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /fulfillment/package_pickup_config/list 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262835 + /// + /// REF:
+ /// + ///
///
/// /// @@ -144,15 +165,18 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "fulfillment", "package_pickup_config", "list") + .CreateFlurlRequest(request, HttpMethod.Get, "fulfillment", "package_pickup_config", "list") .SetQueryParam("package_id", request.PackageId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /fulfillment/shipping_info/update 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262833 + /// + /// REF:
+ /// + ///
///
/// /// @@ -164,14 +188,17 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "shipping_info", "update"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "shipping_info", "update"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /fulfillment/delivery 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262842 + /// + /// REF:
+ /// + ///
///
/// /// @@ -183,15 +210,18 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "delivery"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "delivery"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #region Order /// /// 异步调用 [POST] /fulfillment/order_split/verify 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262829 + /// + /// REF:
+ /// + ///
///
/// /// @@ -203,14 +233,17 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "order_split", "verify"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "order_split", "verify"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /fulfillment/order_split/confirm 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262830 + /// + /// REF:
+ /// + ///
///
/// /// @@ -222,14 +255,17 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "order_split", "confirm"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "order_split", "confirm"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /fulfillment/package/remove 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262838 + /// + /// REF:
+ /// + ///
///
/// /// @@ -241,16 +277,19 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "package", "remove"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "package", "remove"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #endregion #region PreCombinePackage /// /// 异步调用 [GET] /fulfillment/pre_combine_pkg/list 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262831 + /// + /// REF:
+ /// + ///
///
/// /// @@ -262,16 +301,19 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "fulfillment", "pre_combine_pkg", "list") + .CreateFlurlRequest(request, HttpMethod.Get, "fulfillment", "pre_combine_pkg", "list") .SetQueryParam("cursor", request.PageCursor) .SetQueryParam("page_size", request.PageSize); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /fulfillment/pre_combine_pkg/confirm 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262839 + /// + /// REF:
+ /// + ///
///
/// /// @@ -283,16 +325,19 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "pre_combine_pkg", "confirm"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "pre_combine_pkg", "confirm"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #endregion #region Upload /// /// 异步调用 [POST] /fulfillment/uploadimage 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262835 + /// + /// REF:
+ /// + ///
///
/// /// @@ -304,14 +349,17 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "uploadimage"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "uploadimage"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /fulfillment/uploadfile 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262835 + /// + /// REF:
+ /// + ///
///
/// /// @@ -323,9 +371,9 @@ public static class TikTokShopClientExecuteFulfillmentExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "fulfillment", "uploadfile"); + .CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", "uploadfile"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #endregion } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteGlobalProductExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteGlobalProductExtensions.cs index 1f525546..977970f6 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteGlobalProductExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteGlobalProductExtensions.cs @@ -11,7 +11,10 @@ public static class TikTokShopClientExecuteGlobalProductExtensions { /// /// 异步调用 [POST] /product/global_products/search 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262905 + /// + /// REF:
+ /// + ///
///
/// /// @@ -23,14 +26,17 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "product", "global_products", "search"); + .CreateFlurlRequest(request, HttpMethod.Post, "product", "global_products", "search"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /product/global_products 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262906 + /// + /// REF:
+ /// + ///
///
/// /// @@ -42,15 +48,18 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "product", "global_products") + .CreateFlurlRequest(request, HttpMethod.Get, "product", "global_products") .SetQueryParam("product_id", request.GlobalProductId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /product/global_products 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262904 + /// + /// REF:
+ /// + ///
///
/// /// @@ -62,14 +71,17 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "product", "global_products"); + .CreateFlurlRequest(request, HttpMethod.Post, "product", "global_products"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [PUT] /product/global_products 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262910 + /// + /// REF:
+ /// + ///
///
/// /// @@ -81,14 +93,17 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Put, "product", "global_products"); + .CreateFlurlRequest(request, HttpMethod.Put, "product", "global_products"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [PUT] /product/global_products/prices 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262908 + /// + /// REF:
+ /// + ///
///
/// /// @@ -100,14 +115,17 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Put, "product", "global_products", "prices"); + .CreateFlurlRequest(request, HttpMethod.Put, "product", "global_products", "prices"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /product/global_products/publish 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262907 + /// + /// REF:
+ /// + ///
///
/// /// @@ -119,14 +137,17 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "product", "global_products", "publish"); + .CreateFlurlRequest(request, HttpMethod.Post, "product", "global_products", "publish"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [DELETE] /product/global_products 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262913 + /// + /// REF:
+ /// + ///
///
/// /// @@ -138,15 +159,18 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Delete, "product", "global_products"); + .CreateFlurlRequest(request, HttpMethod.Delete, "product", "global_products"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #region Category /// /// 异步调用 [GET] /product/global_products/categories 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262909 + /// + /// REF:
+ /// + ///
///
/// /// @@ -158,14 +182,17 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "product", "global_products", "categories"); + .CreateFlurlRequest(request, HttpMethod.Get, "product", "global_products", "categories"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /product/global_products/attributes 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262911 + /// + /// REF:
+ /// + ///
///
/// /// @@ -177,15 +204,18 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "product", "global_products", "attributes") + .CreateFlurlRequest(request, HttpMethod.Get, "product", "global_products", "attributes") .SetQueryParam("category_id", request.CategoryId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /product/global_products/categories/rules 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262797 + /// + /// REF:
+ /// + ///
///
/// /// @@ -197,10 +227,10 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "product", "global_products", "categories", "rules") + .CreateFlurlRequest(request, HttpMethod.Get, "product", "global_products", "categories", "rules") .SetQueryParam("category_id", request.CategoryId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #endregion } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteLogisticsExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteLogisticsExtensions.cs index eb021edc..5f8ae48a 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteLogisticsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteLogisticsExtensions.cs @@ -11,7 +11,10 @@ public static class TikTokShopClientExecuteLogisticsExtensions { /// /// 异步调用 [GET] /logistics/get_warehouse_list 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262859 + /// + /// REF:
+ /// + ///
///
/// /// @@ -23,14 +26,17 @@ public static class TikTokShopClientExecuteLogisticsExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "logistics", "get_warehouse_list"); + .CreateFlurlRequest(request, HttpMethod.Get, "logistics", "get_warehouse_list"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /logistics/get_subscribed_deliveryoptions 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262854 + /// + /// REF:
+ /// + ///
///
/// /// @@ -42,14 +48,17 @@ public static class TikTokShopClientExecuteLogisticsExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "logistics", "get_subscribed_deliveryoptions"); + .CreateFlurlRequest(request, HttpMethod.Post, "logistics", "get_subscribed_deliveryoptions"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /logistics/shipping_providers 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262857 + /// + /// REF:
+ /// + ///
///
/// /// @@ -61,14 +70,17 @@ public static class TikTokShopClientExecuteLogisticsExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "logistics", "shipping_providers"); + .CreateFlurlRequest(request, HttpMethod.Get, "logistics", "shipping_providers"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /logistics/shipping_document 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262856 + /// + /// REF:
+ /// + ///
///
/// /// @@ -80,19 +92,22 @@ public static class TikTokShopClientExecuteLogisticsExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "logistics", "shipping_document") + .CreateFlurlRequest(request, HttpMethod.Get, "logistics", "shipping_document") .SetQueryParam("order_id", request.OrderId) .SetQueryParam("document_type", request.DocumentType); - if (request.DocumentSize != null) + if (request.DocumentSize is not null) flurlReq.SetQueryParam("document_size", request.DocumentSize); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /logistics/ship/get 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262858 + /// + /// REF:
+ /// + ///
///
/// /// @@ -104,15 +119,18 @@ public static class TikTokShopClientExecuteLogisticsExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "logistics", "ship", "get") + .CreateFlurlRequest(request, HttpMethod.Get, "logistics", "ship", "get") .SetQueryParam("order_id", request.OrderId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /logistics/tracking 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262855 + /// + /// REF:
+ /// + ///
///
/// /// @@ -124,10 +142,10 @@ public static class TikTokShopClientExecuteLogisticsExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "logistics", "tracking") + .CreateFlurlRequest(request, HttpMethod.Post, "logistics", "tracking") .SetQueryParam("order_id", request.OrderId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteOrderExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteOrderExtensions.cs index 7742bd98..e1edd089 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteOrderExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteOrderExtensions.cs @@ -10,7 +10,10 @@ public static class TikTokShopClientExecuteOrderExtensions { /// /// 异步调用 [POST] /orders/search 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262815 + /// + /// REF:
+ /// + ///
///
/// /// @@ -22,14 +25,17 @@ public static class TikTokShopClientExecuteOrderExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "orders", "search"); + .CreateFlurlRequest(request, HttpMethod.Post, "orders", "search"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /orders/detail/query 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262814 + /// + /// REF:
+ /// + ///
///
/// /// @@ -41,9 +47,9 @@ public static class TikTokShopClientExecuteOrderExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "orders", "detail", "query"); + .CreateFlurlRequest(request, HttpMethod.Post, "orders", "detail", "query"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// @@ -59,9 +65,9 @@ public static class TikTokShopClientExecuteOrderExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "orders", "rts"); + .CreateFlurlRequest(request, HttpMethod.Post, "orders", "rts"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs index 0ff39ccc..edc5c943 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs @@ -11,7 +11,10 @@ public static class TikTokShopClientExecuteProductExtensions { /// /// 异步调用 [POST] /products/search 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262788 + /// + /// REF:
+ /// + ///
///
/// /// @@ -23,14 +26,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "products", "search"); + .CreateFlurlRequest(request, HttpMethod.Post, "products", "search"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /products/details 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262789 + /// + /// REF:
+ /// + ///
///
/// /// @@ -42,18 +48,21 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "products", "details") + .CreateFlurlRequest(request, HttpMethod.Get, "products", "details") .SetQueryParam("product_id", request.ProductId); - if (request.RequireAuditVersion != null) + if (request.RequireAuditVersion is not null) flurlReq.SetQueryParam("need_audit_version", request.RequireAuditVersion.Value ? "true" : "false"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /products 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262784 + /// + /// REF:
+ /// + ///
///
/// /// @@ -65,14 +74,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "products"); + .CreateFlurlRequest(request, HttpMethod.Post, "products"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [PUT] /products 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262784 + /// + /// REF:
+ /// + ///
///
/// /// @@ -84,14 +96,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Put, "products"); + .CreateFlurlRequest(request, HttpMethod.Put, "products"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [PUT] /products/stocks 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262787 + /// + /// REF:
+ /// + ///
///
/// /// @@ -103,14 +118,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Put, "products", "stocks"); + .CreateFlurlRequest(request, HttpMethod.Put, "products", "stocks"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [PUT] /products/prices 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262793 + /// + /// REF:
+ /// + ///
///
/// /// @@ -122,14 +140,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Put, "products", "prices"); + .CreateFlurlRequest(request, HttpMethod.Put, "products", "prices"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [DELETE] /products 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262785 + /// + /// REF:
+ /// + ///
///
/// /// @@ -141,14 +162,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Delete, "products"); + .CreateFlurlRequest(request, HttpMethod.Delete, "products"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /products/recover 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262792 + /// + /// REF:
+ /// + ///
///
/// /// @@ -160,14 +184,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "products", "recover"); + .CreateFlurlRequest(request, HttpMethod.Post, "products", "recover"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /products/activate 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262791 + /// + /// REF:
+ /// + ///
///
/// /// @@ -179,14 +206,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "products", "activate"); + .CreateFlurlRequest(request, HttpMethod.Post, "products", "activate"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /products/inactivated_products 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262790 + /// + /// REF:
+ /// + ///
///
/// /// @@ -198,14 +228,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "products", "inactivated_products"); + .CreateFlurlRequest(request, HttpMethod.Post, "products", "inactivated_products"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /products/save_draft 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262808 + /// + /// REF:
+ /// + ///
///
/// /// @@ -217,15 +250,18 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "products", "save_draft"); + .CreateFlurlRequest(request, HttpMethod.Post, "products", "save_draft"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #region Upload /// /// 异步调用 [POST] /products/upload_files 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262782 + /// + /// REF:
+ /// + ///
///
/// /// @@ -237,14 +273,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "products", "upload_files"); + .CreateFlurlRequest(request, HttpMethod.Post, "products", "upload_files"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /products/upload_imgs 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262783 + /// + /// REF:
+ /// + ///
///
/// /// @@ -256,16 +295,19 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "products", "upload_imgs"); + .CreateFlurlRequest(request, HttpMethod.Post, "products", "upload_imgs"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #endregion #region Category /// /// 异步调用 [GET] /products/categories 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262794 + /// + /// REF:
+ /// + ///
///
/// /// @@ -277,14 +319,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "products", "categories"); + .CreateFlurlRequest(request, HttpMethod.Get, "products", "categories"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /products/brands 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262795 + /// + /// REF:
+ /// + ///
///
/// /// @@ -296,25 +341,28 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "products", "brands") + .CreateFlurlRequest(request, HttpMethod.Get, "products", "brands") .SetQueryParam("page_number", request.PageNumber) .SetQueryParam("page_size", request.PageSize); - if (request.CategoryId != null) + if (request.CategoryId is not null) flurlReq.SetQueryParam("category_id", request.CategoryId); - if (request.IsOnlyAuthorized != null) + if (request.IsOnlyAuthorized is not null) flurlReq.SetQueryParam("only_authorized", request.IsOnlyAuthorized.Value ? "true" : "false"); - if (request.BrandSuggest != null) + if (request.BrandSuggest is not null) flurlReq.SetQueryParam("brand_suggest", request.BrandSuggest); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /products/brand 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/275824 + /// + /// REF:
+ /// + ///
///
/// /// @@ -326,14 +374,17 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "products", "brand"); + .CreateFlurlRequest(request, HttpMethod.Post, "products", "brand"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /products/attributes 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262796 + /// + /// REF:
+ /// + ///
///
/// /// @@ -345,15 +396,18 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "products", "attributes") + .CreateFlurlRequest(request, HttpMethod.Get, "products", "attributes") .SetQueryParam("category_id", request.CategoryId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /products/categories/rules 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262797 + /// + /// REF:
+ /// + ///
///
/// /// @@ -365,15 +419,18 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "products", "categories", "rules") + .CreateFlurlRequest(request, HttpMethod.Get, "products", "categories", "rules") .SetQueryParam("category_id", request.CategoryId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /product/category_recommend 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262806 + /// + /// REF:
+ /// + ///
///
/// /// @@ -385,9 +442,9 @@ public static class TikTokShopClientExecuteProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "product", "category_recommend"); + .CreateFlurlRequest(request, HttpMethod.Post, "product", "category_recommend"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #endregion } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecutePromotionExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecutePromotionExtensions.cs index f801571e..bdfee44a 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecutePromotionExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecutePromotionExtensions.cs @@ -11,7 +11,10 @@ public static class TikTokShopClientExecutePromotionExtensions { /// /// 异步调用 [POST] /promotion/activity/list 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262939 + /// + /// REF:
+ /// + ///
///
/// /// @@ -23,14 +26,17 @@ public static class TikTokShopClientExecutePromotionExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "promotion", "activity", "list"); + .CreateFlurlRequest(request, HttpMethod.Post, "promotion", "activity", "list"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /promotion/activity/get 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262942 + /// + /// REF:
+ /// + ///
///
/// /// @@ -42,15 +48,18 @@ public static class TikTokShopClientExecutePromotionExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "promotion", "activity", "get") + .CreateFlurlRequest(request, HttpMethod.Get, "promotion", "activity", "get") .SetQueryParam("promotion_id", request.PromotionId); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /promotion/activity/create 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262944 + /// + /// REF:
+ /// + ///
///
/// /// @@ -62,14 +71,17 @@ public static class TikTokShopClientExecutePromotionExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "promotion", "activity", "create"); + .CreateFlurlRequest(request, HttpMethod.Post, "promotion", "activity", "create"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /promotion/activity/update 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262881 + /// + /// REF:
+ /// + ///
///
/// /// @@ -81,14 +93,17 @@ public static class TikTokShopClientExecutePromotionExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "promotion", "activity", "update"); + .CreateFlurlRequest(request, HttpMethod.Post, "promotion", "activity", "update"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /promotion/activity/deactivate 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262940 + /// + /// REF:
+ /// + ///
///
/// /// @@ -100,15 +115,18 @@ public static class TikTokShopClientExecutePromotionExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "promotion", "activity", "deactivate"); + .CreateFlurlRequest(request, HttpMethod.Post, "promotion", "activity", "deactivate"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #region Items /// /// 异步调用 [POST] /promotion/activity/items/addorupdate 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262941 + /// + /// REF:
+ /// + ///
///
/// /// @@ -120,14 +138,17 @@ public static class TikTokShopClientExecutePromotionExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "promotion", "activity", "items", "addorupdate"); + .CreateFlurlRequest(request, HttpMethod.Post, "promotion", "activity", "items", "addorupdate"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /promotion/activity/items/remove 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262941 + /// + /// REF:
+ /// + ///
///
/// /// @@ -139,9 +160,9 @@ public static class TikTokShopClientExecutePromotionExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "promotion", "activity", "items", "remove"); + .CreateFlurlRequest(request, HttpMethod.Post, "promotion", "activity", "items", "remove"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } #endregion } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteReverseExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteReverseExtensions.cs index de9b4663..5bb33067 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteReverseExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteReverseExtensions.cs @@ -11,7 +11,10 @@ public static class TikTokShopClientExecuteReverseExtensions { /// /// 异步调用 [POST] /reverse/reverse_order/list 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262870 + /// + /// REF:
+ /// + ///
///
/// /// @@ -23,14 +26,17 @@ public static class TikTokShopClientExecuteReverseExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "reverse", "reverse_order", "list"); + .CreateFlurlRequest(request, HttpMethod.Post, "reverse", "reverse_order", "list"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /reverse/reverse_request/confirm 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262871 + /// + /// REF:
+ /// + ///
///
/// /// @@ -42,14 +48,17 @@ public static class TikTokShopClientExecuteReverseExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "reverse", "reverse_request", "confirm"); + .CreateFlurlRequest(request, HttpMethod.Post, "reverse", "reverse_request", "confirm"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /reverse/reverse_request/reject 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262869 + /// + /// REF:
+ /// + ///
///
/// /// @@ -61,14 +70,17 @@ public static class TikTokShopClientExecuteReverseExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "reverse", "reverse_request", "reject"); + .CreateFlurlRequest(request, HttpMethod.Post, "reverse", "reverse_request", "reject"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [POST] /reverse/order/cancel 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262872 + /// + /// REF:
+ /// + ///
///
/// /// @@ -80,14 +92,17 @@ public static class TikTokShopClientExecuteReverseExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "reverse", "order", "cancel"); + .CreateFlurlRequest(request, HttpMethod.Post, "reverse", "order", "cancel"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /reverse/reverse_reason/list 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262873 + /// + /// REF:
+ /// + ///
///
/// /// @@ -99,18 +114,18 @@ public static class TikTokShopClientExecuteReverseExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "reverse", "reverse_reason", "list"); + .CreateFlurlRequest(request, HttpMethod.Get, "reverse", "reverse_reason", "list"); - if (request.ActionType != null) + if (request.ActionType is not null) flurlReq.SetQueryParam("reverse_action_type", request.ActionType.Value); - if (request.ReasonType != null) + if (request.ReasonType is not null) flurlReq.SetQueryParam("reason_type", request.ReasonType.Value); - if (request.FulfillmentStatus != null) + if (request.FulfillmentStatus is not null) flurlReq.SetQueryParam("fulfillment_status", request.FulfillmentStatus.Value); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteSellerExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteSellerExtensions.cs index 1c3f5347..0f0869ee 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteSellerExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteSellerExtensions.cs @@ -10,7 +10,10 @@ public static class TikTokShopClientExecuteSellerExtensions { /// /// 异步调用 [GET] /seller/global/active_shops 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262743 + /// + /// REF:
+ /// + ///
///
/// /// @@ -22,14 +25,17 @@ public static class TikTokShopClientExecuteSellerExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "seller", "global", "active_shops"); + .CreateFlurlRequest(request, HttpMethod.Get, "seller", "global", "active_shops"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } /// /// 异步调用 [GET] /seller/manage_global_product/check 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262744 + /// + /// REF:
+ /// + ///
///
/// /// @@ -41,9 +47,9 @@ public static class TikTokShopClientExecuteSellerExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "seller", "manage_global_product", "check"); + .CreateFlurlRequest(request, HttpMethod.Get, "seller", "manage_global_product", "check"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteShopExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteShopExtensions.cs index 38779314..9b108658 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteShopExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteShopExtensions.cs @@ -10,7 +10,10 @@ public static class TikTokShopClientExecuteShopExtensions { /// /// 异步调用 [GET] /shop/get_authorized_shop 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/262739 + /// + /// REF:
+ /// + ///
///
/// /// @@ -22,9 +25,9 @@ public static class TikTokShopClientExecuteShopExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Get, "shop", "get_authorized_shop"); + .CreateFlurlRequest(request, HttpMethod.Get, "shop", "get_authorized_shop"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteSupplyChainExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteSupplyChainExtensions.cs index 9603e2a3..d5313250 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteSupplyChainExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteSupplyChainExtensions.cs @@ -10,7 +10,10 @@ public static class TikTokShopClientExecuteSupplyChainExtensions { /// /// 异步调用 [POST] /supply_chain/package_shipment_confirmation 接口。 - /// REF: https://partner.tiktokshop.com/doc/page/273914 + /// + /// REF:
+ /// + ///
///
/// /// @@ -22,9 +25,9 @@ public static class TikTokShopClientExecuteSupplyChainExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateRequest(request, HttpMethod.Post, "supply_chain", "package_shipment_confirmation"); + .CreateFlurlRequest(request, HttpMethod.Post, "supply_chain", "package_shipment_confirmation"); - return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Interceptors/TikTokShopRequestSignatureInterceptor.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Interceptors/TikTokShopRequestSigningInterceptor.cs similarity index 62% rename from src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Interceptors/TikTokShopRequestSignatureInterceptor.cs rename to src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Interceptors/TikTokShopRequestSigningInterceptor.cs index ddab9020..d7f00120 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Interceptors/TikTokShopRequestSignatureInterceptor.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Interceptors/TikTokShopRequestSigningInterceptor.cs @@ -1,29 +1,30 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Threading.Tasks; using Flurl; using Flurl.Http; namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Interceptors { - internal class TikTokShopRequestSignatureInterceptor : FlurlHttpCallInterceptor + internal class TikTokShopRequestSigningInterceptor : HttpInterceptor { private readonly string _baseUrl; private readonly string _appSecret; - public TikTokShopRequestSignatureInterceptor(string baseUrl, string appSecret) + public TikTokShopRequestSigningInterceptor(string baseUrl, string appSecret) { _baseUrl = baseUrl; _appSecret = appSecret; } - public override Task BeforeCallAsync(FlurlCall flurlCall) + public override Task BeforeCallAsync(HttpInterceptorContext context, CancellationToken cancellationToken = default) { - if (flurlCall == null) throw new ArgumentNullException(nameof(flurlCall)); - if (flurlCall.Completed) throw new Exceptions.TikTokShopRequestSignatureException("This interceptor must be called before request completed."); + if (context is null) throw new ArgumentNullException(nameof(context)); + if (context.FlurlCall.Completed) throw new TikTokShopException("Failed to sign request. This interceptor must be called before request completed."); - string requestUrl = flurlCall.HttpRequestMessage.RequestUri?.ToString() ?? string.Empty; + string requestUrl = context.FlurlCall.HttpRequestMessage.RequestUri?.ToString() ?? string.Empty; if (!requestUrl.StartsWith(_baseUrl, StringComparison.OrdinalIgnoreCase)) { // 非基地址的请求跳过签名(如 Auth API) @@ -35,14 +36,14 @@ public override Task BeforeCallAsync(FlurlCall flurlCall) try { - var queryParams = new QueryParamCollection(flurlCall.HttpRequestMessage.RequestUri!.Query); + var queryParams = new QueryParamCollection(context.FlurlCall.HttpRequestMessage.RequestUri!.Query); queryParams.Remove("access_token"); queryParams.Remove("sign"); string msgText = string.Format( "{0}{1}{2}", arg0: _appSecret, - arg1: flurlCall.HttpRequestMessage.RequestUri.AbsolutePath, + arg1: context.FlurlCall.HttpRequestMessage.RequestUri.AbsolutePath, arg2: string.Join(string.Empty, queryParams .ToDictionary(k => k.Name, v => v.Value.ToString()) .OrderBy(k => k.Key, StringComparer.Ordinal) @@ -60,15 +61,15 @@ public override Task BeforeCallAsync(FlurlCall flurlCall) .Select(e => $"{e.Key}{e.Value}") ) ); - signText = Utilities.HMACUtility.HashWithSHA256(_appSecret, msgText); + signText = Utilities.HMACUtility.HashWithSHA256(_appSecret, msgText).Value!; } catch (Exception ex) { - throw new Exceptions.TikTokShopRequestSignatureException("Failed to generate signature of request. Please see the inner exception for more details.", ex); + throw new TikTokShopException("Failed to sign request. Please see the inner exception for more details.", ex); } - flurlCall.Request.SetQueryParam("sign", signText); - flurlCall.Request.RemoveQueryParams(ignoreQueryNames); + context.FlurlCall.Request.SetQueryParam("sign", signText); + context.FlurlCall.Request.RemoveQueryParams(ignoreQueryNames); return Task.CompletedTask; } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Finance/FinanceSearchSettlementsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Finance/FinanceSearchSettlementsResponse.cs index d19330cb..d77b27bd 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Finance/FinanceSearchSettlementsResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Finance/FinanceSearchSettlementsResponse.cs @@ -29,7 +29,7 @@ public class SettlementInfo ///
[Newtonsoft.Json.JsonProperty("user_pay")] [System.Text.Json.Serialization.JsonPropertyName("user_pay")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal UserPaidAmount { get; set; } /// @@ -37,7 +37,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("platform_promotion")] [System.Text.Json.Serialization.JsonPropertyName("platform_promotion")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal PlatformPromotionAmount { get; set; } /// @@ -45,7 +45,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("refund")] [System.Text.Json.Serialization.JsonPropertyName("refund")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal RefundAmount { get; set; } /// @@ -53,7 +53,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("payment_fee")] [System.Text.Json.Serialization.JsonPropertyName("payment_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal PaymentFee { get; set; } /// @@ -61,7 +61,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("transaction_fee")] [System.Text.Json.Serialization.JsonPropertyName("transaction_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal TransactionFee { get; set; } /// @@ -69,7 +69,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("flat_fee")] [System.Text.Json.Serialization.JsonPropertyName("flat_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal FlatFee { get; set; } /// @@ -77,7 +77,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("sales_fee")] [System.Text.Json.Serialization.JsonPropertyName("sales_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SalesFee { get; set; } /// @@ -85,7 +85,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("sfp_service_fee")] [System.Text.Json.Serialization.JsonPropertyName("sfp_service_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SFPServiceFee { get; set; } /// @@ -93,7 +93,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("shipping_fee")] [System.Text.Json.Serialization.JsonPropertyName("shipping_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal ShippingFee { get; set; } /// @@ -101,7 +101,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("small_order_fee")] [System.Text.Json.Serialization.JsonPropertyName("small_order_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SmallOrderFee { get; set; } /// @@ -109,7 +109,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("platform_commission")] [System.Text.Json.Serialization.JsonPropertyName("platform_commission")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal PlatformCommission { get; set; } /// @@ -117,7 +117,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("affiliate_commission")] [System.Text.Json.Serialization.JsonPropertyName("affiliate_commission")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal AffiliateCommission { get; set; } /// @@ -125,7 +125,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("affiliate_partner_commission")] [System.Text.Json.Serialization.JsonPropertyName("affiliate_partner_commission")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal AffiliatePartnerCommission { get; set; } /// @@ -133,7 +133,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("vat")] [System.Text.Json.Serialization.JsonPropertyName("vat")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal VAT { get; set; } /// @@ -141,7 +141,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("gst")] [System.Text.Json.Serialization.JsonPropertyName("gst")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal GST { get; set; } /// @@ -149,7 +149,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("shipping_fee_subsidy")] [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_subsidy")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal ShippingFeeSubsidyAmount { get; set; } /// @@ -157,7 +157,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("seller_reason_fund_deduction")] [System.Text.Json.Serialization.JsonPropertyName("seller_reason_fund_deduction")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SellerReasonFundDeductionAmount { get; set; } /// @@ -165,7 +165,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("shipping_fee_adjustment")] [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_adjustment")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal ShippingFeeAdjustmentAmount { get; set; } /// @@ -173,7 +173,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("promotion_adjustment")] [System.Text.Json.Serialization.JsonPropertyName("promotion_adjustment")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal PromotionAdjustmentAmount { get; set; } /// @@ -181,7 +181,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("other_adjustment")] [System.Text.Json.Serialization.JsonPropertyName("other_adjustment")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal OtherAdjustmentAmount { get; set; } /// @@ -189,7 +189,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("charge_back")] [System.Text.Json.Serialization.JsonPropertyName("charge_back")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal ChargeBackAmount { get; set; } /// @@ -197,7 +197,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("customer_service_compensation")] [System.Text.Json.Serialization.JsonPropertyName("customer_service_compensation")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal CustomerServiceCompensationAmount { get; set; } /// @@ -205,7 +205,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("subtotal_after_seller_discounts")] [System.Text.Json.Serialization.JsonPropertyName("subtotal_after_seller_discounts")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SubtotalAfterSellerDiscountAmount { get; set; } /// @@ -213,7 +213,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("refund_subtotal_after_seller_discounts")] [System.Text.Json.Serialization.JsonPropertyName("refund_subtotal_after_seller_discounts")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SubtotalAfterSellerDiscountRefundAmount { get; set; } /// @@ -221,7 +221,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("settlement_amount")] [System.Text.Json.Serialization.JsonPropertyName("settlement_amount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SettlementAmount { get; set; } /// @@ -246,7 +246,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("order_id")] [System.Text.Json.Serialization.JsonPropertyName("order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string OrderId { get; set; } = default!; /// @@ -254,7 +254,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("adjustment_id")] [System.Text.Json.Serialization.JsonPropertyName("adjustment_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string AdjustmentId { get; set; } = default!; /// @@ -262,7 +262,7 @@ public class SettlementInfo /// [Newtonsoft.Json.JsonProperty("related_order_id")] [System.Text.Json.Serialization.JsonPropertyName("related_order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string RelatedOrderId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Finance/FinanceSearchTransactionsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Finance/FinanceSearchTransactionsResponse.cs index 785c091d..adfc983d 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Finance/FinanceSearchTransactionsResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Finance/FinanceSearchTransactionsResponse.cs @@ -39,7 +39,7 @@ public class Transaction /// [Newtonsoft.Json.JsonProperty("transaction_amount")] [System.Text.Json.Serialization.JsonPropertyName("transaction_amount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal Amount { get; set; } /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetPackageDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetPackageDetailResponse.cs index 1d7e7516..77b44cb5 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetPackageDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetPackageDetailResponse.cs @@ -22,7 +22,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("sku_id")] [System.Text.Json.Serialization.JsonPropertyName("sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string SKUId { get; set; } = default!; /// @@ -53,7 +53,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("order_id")] [System.Text.Json.Serialization.JsonPropertyName("order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string OrderId { get; set; } = default!; /// @@ -70,7 +70,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentSearchPackagesResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentSearchPackagesResponse.cs index 56ec0c1c..27485213 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentSearchPackagesResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentSearchPackagesResponse.cs @@ -18,7 +18,7 @@ public class Package /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentShipPackageResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentShipPackageResponse.cs index 3d8567dd..a58e4e21 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentShipPackageResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentShipPackageResponse.cs @@ -18,7 +18,7 @@ public class FailedPackage /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentUpdatePackageDeliveryStatusResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentUpdatePackageDeliveryStatusResponse.cs index 3d76ff14..5704713e 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentUpdatePackageDeliveryStatusResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentUpdatePackageDeliveryStatusResponse.cs @@ -18,7 +18,7 @@ public class FailedPackage /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentConfirmOrderSplitResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentConfirmOrderSplitResponse.cs index 1055cfcb..5d954ac9 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentConfirmOrderSplitResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentConfirmOrderSplitResponse.cs @@ -18,7 +18,7 @@ public class Result /// [Newtonsoft.Json.JsonProperty("pre_split_pkg_id")] [System.Text.Json.Serialization.JsonPropertyName("pre_split_pkg_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PreSplitPackageId { get; set; } = default!; /// @@ -36,7 +36,7 @@ public class SucceededSplitPackage /// [Newtonsoft.Json.JsonProperty("pre_split_pkg_id")] [System.Text.Json.Serialization.JsonPropertyName("pre_split_pkg_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PreSplitPackageId { get; set; } = default!; /// @@ -44,7 +44,7 @@ public class SucceededSplitPackage /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackgeId { get; set; } = default!; } @@ -55,7 +55,7 @@ public class FailedSplitPackage /// [Newtonsoft.Json.JsonProperty("pre_split_pkg_id")] [System.Text.Json.Serialization.JsonPropertyName("pre_split_pkg_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PreSplitPackageId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentRemovePackageOrdersResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentRemovePackageOrdersResponse.cs index 01efe46c..85e3ad4e 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentRemovePackageOrdersResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentRemovePackageOrdersResponse.cs @@ -18,7 +18,7 @@ public class SucceededPackage /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; /// @@ -36,7 +36,7 @@ public class FailedPackage /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentVerifyOrderSplitResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentVerifyOrderSplitResponse.cs index 2ae84b9e..c81d1837 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentVerifyOrderSplitResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/Order/FulfillmentVerifyOrderSplitResponse.cs @@ -18,7 +18,7 @@ public class Result /// [Newtonsoft.Json.JsonProperty("order_id")] [System.Text.Json.Serialization.JsonPropertyName("order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string OrderId { get; set; } = default!; /// @@ -36,7 +36,7 @@ public class FailedOrder /// [Newtonsoft.Json.JsonProperty("order_id")] [System.Text.Json.Serialization.JsonPropertyName("order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string OrderId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/PreCombinePackage/FulfillmentConfirmPreCombinePackageResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/PreCombinePackage/FulfillmentConfirmPreCombinePackageResponse.cs index d3ab11a3..38cb0283 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/PreCombinePackage/FulfillmentConfirmPreCombinePackageResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/PreCombinePackage/FulfillmentConfirmPreCombinePackageResponse.cs @@ -18,7 +18,7 @@ public class SucceededPackage /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; /// @@ -36,7 +36,7 @@ public class FailedPackage /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/PreCombinePackage/FulfillmentSearchPreCombinePackagesResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/PreCombinePackage/FulfillmentSearchPreCombinePackagesResponse.cs index d0613176..f9ee968a 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/PreCombinePackage/FulfillmentSearchPreCombinePackagesResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/PreCombinePackage/FulfillmentSearchPreCombinePackagesResponse.cs @@ -18,7 +18,7 @@ public class PreCombinePackage /// [Newtonsoft.Json.JsonProperty("pre_combine_pkg_id")] [System.Text.Json.Serialization.JsonPropertyName("pre_combine_pkg_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PreCombinePackageId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetCategoryListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetCategoryListResponse.cs index 2ced49e2..4b8bbe27 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetCategoryListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetCategoryListResponse.cs @@ -18,7 +18,7 @@ public class Category /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string CategoryId { get; set; } = default!; /// @@ -26,7 +26,7 @@ public class Category /// [Newtonsoft.Json.JsonProperty("parent_id")] [System.Text.Json.Serialization.JsonPropertyName("parent_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ParentCategoryId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductCreateProductResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductCreateProductResponse.cs index 8595458f..6f6c3b16 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductCreateProductResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductCreateProductResponse.cs @@ -25,7 +25,7 @@ public class SalesAttribute : ProductCreateProductResponse.Types.Data.Types.SKU. /// [Newtonsoft.Json.JsonProperty("global_sku_id")] [System.Text.Json.Serialization.JsonPropertyName("global_sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalSKUId { get; set; } = default!; /// @@ -49,7 +49,7 @@ public class SalesAttribute : ProductCreateProductResponse.Types.Data.Types.SKU. /// [Newtonsoft.Json.JsonProperty("global_product_id")] [System.Text.Json.Serialization.JsonPropertyName("global_product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalProductId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailResponse.cs index 9b19e4d8..afc7a548 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailResponse.cs @@ -25,7 +25,7 @@ public class LocalProduct /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string LocalProductId { get; set; } = default!; } @@ -61,7 +61,7 @@ public class Image : Data.Types.Image /// [Newtonsoft.Json.JsonProperty("attribute_id")] [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string AttributeId { get; set; } = default!; /// @@ -76,7 +76,7 @@ public class Image : Data.Types.Image /// [Newtonsoft.Json.JsonProperty("value_id")] [System.Text.Json.Serialization.JsonPropertyName("value_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ValueId { get; set; } = default!; /// @@ -114,7 +114,7 @@ public class IdentifierCodeInfo : ProductGetProductDetailResponse.Types.Data.Typ /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalSKUId { get; set; } = default!; /// @@ -129,7 +129,7 @@ public class IdentifierCodeInfo : ProductGetProductDetailResponse.Types.Data.Typ /// [Newtonsoft.Json.JsonProperty("original_price")] [System.Text.Json.Serialization.JsonPropertyName("original_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal OriginalPrice { get; set; } /// @@ -192,7 +192,7 @@ public class File /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string CertificationId { get; set; } = default!; /// @@ -221,7 +221,7 @@ public class ProductAttributeValue /// [Newtonsoft.Json.JsonProperty("value_id")] [System.Text.Json.Serialization.JsonPropertyName("value_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ValueId { get; set; } = default!; /// @@ -238,7 +238,7 @@ public class ProductAttributeValue /// [Newtonsoft.Json.JsonProperty("attribute_id")] [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string AttributeId { get; set; } = default!; /// @@ -259,7 +259,7 @@ public class ExemptionOfIdentifierCode : ProductGetProductDetailResponse.Types.D /// [Newtonsoft.Json.JsonProperty("global_product_id")] [System.Text.Json.Serialization.JsonPropertyName("global_product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalProductId { get; set; } = default!; /// @@ -295,7 +295,7 @@ public class ExemptionOfIdentifierCode : ProductGetProductDetailResponse.Types.D /// [Newtonsoft.Json.JsonProperty("category_id")] [System.Text.Json.Serialization.JsonPropertyName("category_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string CategoryId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductPublishProductResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductPublishProductResponse.cs index 8cb3c6f6..4b415cb0 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductPublishProductResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductPublishProductResponse.cs @@ -26,7 +26,7 @@ public class Attribute /// [Newtonsoft.Json.JsonProperty("attribute_id")] [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string AttributeId { get; set; } = default!; /// @@ -34,7 +34,7 @@ public class Attribute /// [Newtonsoft.Json.JsonProperty("value_id")] [System.Text.Json.Serialization.JsonPropertyName("value_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ValueId { get; set; } = default!; } } @@ -44,7 +44,7 @@ public class Attribute /// [Newtonsoft.Json.JsonProperty("global_sku_id")] [System.Text.Json.Serialization.JsonPropertyName("global_sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalSKUId { get; set; } = default!; /// @@ -52,7 +52,7 @@ public class Attribute /// [Newtonsoft.Json.JsonProperty("local_sku_id")] [System.Text.Json.Serialization.JsonPropertyName("local_sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string LocalSKUId { get; set; } = default!; /// @@ -76,7 +76,7 @@ public class Attribute /// [Newtonsoft.Json.JsonProperty("shop_id")] [System.Text.Json.Serialization.JsonPropertyName("shop_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ShopId { get; set; } = default!; /// @@ -98,7 +98,7 @@ public class Attribute /// [Newtonsoft.Json.JsonProperty("local_product_id")] [System.Text.Json.Serialization.JsonPropertyName("local_product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string LocalProductId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductSearchProductsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductSearchProductsResponse.cs index 8c9846e7..40539ae2 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductSearchProductsResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductSearchProductsResponse.cs @@ -22,7 +22,7 @@ public class GlobalSKU /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalSKUId { get; set; } = default!; /// @@ -39,7 +39,7 @@ public class GlobalSKU /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalProductId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductPriceResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductPriceResponse.cs index d0a074a4..d7a9c2de 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductPriceResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductPriceResponse.cs @@ -25,7 +25,7 @@ public class FailedGlobalSKU /// [Newtonsoft.Json.JsonProperty("global_sku_id")] [System.Text.Json.Serialization.JsonPropertyName("global_sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalSKUId { get; set; } = default!; /// @@ -33,7 +33,7 @@ public class FailedGlobalSKU /// [Newtonsoft.Json.JsonProperty("local_sku_id")] [System.Text.Json.Serialization.JsonPropertyName("local_sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string LocalSKUId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductResponse.cs index 88a4b06a..1319b97c 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductResponse.cs @@ -25,7 +25,7 @@ public class LocalProduct /// [Newtonsoft.Json.JsonProperty("local_product_id")] [System.Text.Json.Serialization.JsonPropertyName("local_product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string LocalProductId { get; set; } = default!; /// @@ -47,7 +47,7 @@ public class SalesAttribute /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string AttributeId { get; set; } = default!; /// @@ -62,7 +62,7 @@ public class SalesAttribute /// [Newtonsoft.Json.JsonProperty("value_id")] [System.Text.Json.Serialization.JsonPropertyName("value_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ValueId { get; set; } = default!; /// @@ -79,7 +79,7 @@ public class SalesAttribute /// [Newtonsoft.Json.JsonProperty("global_sku_id")] [System.Text.Json.Serialization.JsonPropertyName("global_sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalSKUId { get; set; } = default!; /// @@ -103,7 +103,7 @@ public class SalesAttribute /// [Newtonsoft.Json.JsonProperty("product_id")] [System.Text.Json.Serialization.JsonPropertyName("product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string GlobalProductId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Logistics/LogisticsGetShippingProviderListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Logistics/LogisticsGetShippingProviderListResponse.cs index 94b05306..6a313b5c 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Logistics/LogisticsGetShippingProviderListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Logistics/LogisticsGetShippingProviderListResponse.cs @@ -79,7 +79,7 @@ public class ShippingProvider /// [Newtonsoft.Json.JsonProperty("delivery_option_id")] [System.Text.Json.Serialization.JsonPropertyName("delivery_option_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string DeliveryOptionId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Logistics/LogisticsGetSubscribedDeliveryOptionsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Logistics/LogisticsGetSubscribedDeliveryOptionsResponse.cs index 4faa09ec..e4659596 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Logistics/LogisticsGetSubscribedDeliveryOptionsResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Logistics/LogisticsGetSubscribedDeliveryOptionsResponse.cs @@ -45,7 +45,7 @@ public class WarehouseDeliveryOption /// [Newtonsoft.Json.JsonProperty("warehouse_id")] [System.Text.Json.Serialization.JsonPropertyName("warehouse_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string WarehouseId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailResponse.cs index dd3d0368..91fcc88b 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailResponse.cs @@ -29,7 +29,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("total_amount")] [System.Text.Json.Serialization.JsonPropertyName("total_amount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal TotalAmount { get; set; } /// @@ -37,7 +37,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("sub_total")] [System.Text.Json.Serialization.JsonPropertyName("sub_total")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SubtotalAmount { get; set; } /// @@ -45,7 +45,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("shipping_fee")] [System.Text.Json.Serialization.JsonPropertyName("shipping_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal ShippingFee { get; set; } /// @@ -53,7 +53,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("seller_discount")] [System.Text.Json.Serialization.JsonPropertyName("seller_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SellerDiscount { get; set; } /// @@ -61,7 +61,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("platform_discount")] [System.Text.Json.Serialization.JsonPropertyName("platform_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal PlatformDiscount { get; set; } /// @@ -69,7 +69,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("original_total_product_price")] [System.Text.Json.Serialization.JsonPropertyName("original_total_product_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal OriginalTotalProductPrice { get; set; } /// @@ -77,7 +77,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("original_shipping_fee")] [System.Text.Json.Serialization.JsonPropertyName("original_shipping_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal OriginalShippingFee { get; set; } /// @@ -85,7 +85,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("shipping_fee_seller_discount")] [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_seller_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal ShippingFeeSellerDiscount { get; set; } /// @@ -93,7 +93,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("shipping_fee_platform_discount")] [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_platform_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal ShippingFeePlatformDiscount { get; set; } /// @@ -101,7 +101,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("taxes")] [System.Text.Json.Serialization.JsonPropertyName("taxes")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal Taxes { get; set; } /// @@ -109,7 +109,7 @@ public class PaymentInfo /// [Newtonsoft.Json.JsonProperty("small_order_fee")] [System.Text.Json.Serialization.JsonPropertyName("small_order_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SmallOrderFee { get; set; } } @@ -207,7 +207,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("product_id")] [System.Text.Json.Serialization.JsonPropertyName("product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ProductId { get; set; } = default!; /// @@ -264,7 +264,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("sku_original_price")] [System.Text.Json.Serialization.JsonPropertyName("sku_original_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal OriginalPrice { get; set; } /// @@ -272,7 +272,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("sku_sale_price")] [System.Text.Json.Serialization.JsonPropertyName("sku_sale_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SalePrice { get; set; } /// @@ -280,7 +280,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("sku_platform_discount")] [System.Text.Json.Serialization.JsonPropertyName("sku_platform_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal PlatformDiscount { get; set; } /// @@ -288,7 +288,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("sku_seller_discount")] [System.Text.Json.Serialization.JsonPropertyName("sku_seller_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SellerDiscount { get; set; } /// @@ -296,7 +296,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("sku_platform_discount_total")] [System.Text.Json.Serialization.JsonPropertyName("sku_platform_discount_total")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal TotalPlatformDiscount { get; set; } /// @@ -304,7 +304,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("sku_small_order_fee")] [System.Text.Json.Serialization.JsonPropertyName("sku_small_order_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SmallOrderFee { get; set; } /// @@ -350,7 +350,7 @@ public class Package /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; } @@ -385,7 +385,7 @@ public class OrderLine /// [Newtonsoft.Json.JsonProperty("product_id")] [System.Text.Json.Serialization.JsonPropertyName("product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ProductId { get; set; } = default!; /// @@ -400,7 +400,7 @@ public class OrderLine /// [Newtonsoft.Json.JsonProperty("sku_id")] [System.Text.Json.Serialization.JsonPropertyName("sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string SKUId { get; set; } = default!; /// @@ -443,7 +443,7 @@ public class OrderLine /// [Newtonsoft.Json.JsonProperty("original_price")] [System.Text.Json.Serialization.JsonPropertyName("original_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal OriginalPrice { get; set; } /// @@ -451,7 +451,7 @@ public class OrderLine /// [Newtonsoft.Json.JsonProperty("sale_price")] [System.Text.Json.Serialization.JsonPropertyName("sale_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SalePrice { get; set; } /// @@ -459,7 +459,7 @@ public class OrderLine /// [Newtonsoft.Json.JsonProperty("platform_discount")] [System.Text.Json.Serialization.JsonPropertyName("platform_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal PlatformDiscount { get; set; } /// @@ -467,7 +467,7 @@ public class OrderLine /// [Newtonsoft.Json.JsonProperty("seller_discount")] [System.Text.Json.Serialization.JsonPropertyName("seller_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SellerDiscount { get; set; } /// @@ -531,7 +531,7 @@ public class OrderLine /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string? PackageId { get; set; } /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderSearchOrdersResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderSearchOrdersResponse.cs index 88f313c1..e7797f76 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderSearchOrdersResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderSearchOrdersResponse.cs @@ -18,7 +18,7 @@ public class Order /// [Newtonsoft.Json.JsonProperty("order_id")] [System.Text.Json.Serialization.JsonPropertyName("order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string OrderId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductCreateBrandResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductCreateBrandResponse.cs index 1898093e..f9327e4e 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductCreateBrandResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductCreateBrandResponse.cs @@ -14,7 +14,7 @@ public class Data /// [Newtonsoft.Json.JsonProperty("brand_id")] [System.Text.Json.Serialization.JsonPropertyName("brand_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string BrandId { get; set; } = default!; } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetAttributeListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetAttributeListResponse.cs index 7d6e0c83..50ce3b9f 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetAttributeListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetAttributeListResponse.cs @@ -46,7 +46,7 @@ public class AttributeValue /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ValueId { get; set; } = default!; /// @@ -63,7 +63,7 @@ public class AttributeValue /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string AttributeId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetBrandListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetBrandListResponse.cs index 51cf661c..725a78f3 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetBrandListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetBrandListResponse.cs @@ -18,7 +18,7 @@ public class Brand /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string BrandId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListResponse.cs index d376afb4..be23383c 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListResponse.cs @@ -18,7 +18,7 @@ public class Category /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string CategoryId { get; set; } = default!; /// @@ -26,7 +26,7 @@ public class Category /// [Newtonsoft.Json.JsonProperty("parent_id")] [System.Text.Json.Serialization.JsonPropertyName("parent_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ParentCategoryId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryRulesResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryRulesResponse.cs index e93cf3fa..e7f73318 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryRulesResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryRulesResponse.cs @@ -22,7 +22,7 @@ public class ProductCertification /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string CertificationId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductRecommendCategoryResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductRecommendCategoryResponse.cs index 27030f2f..43b376a1 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductRecommendCategoryResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductRecommendCategoryResponse.cs @@ -18,7 +18,7 @@ public class Category /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string CategoryId { get; set; } = default!; /// @@ -56,7 +56,7 @@ public class Category /// [Newtonsoft.Json.JsonProperty("leaf_category_id")] [System.Text.Json.Serialization.JsonPropertyName("leaf_category_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string LeafCategoryId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductActivateProductsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductActivateProductsResponse.cs index 609ad606..f360a753 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductActivateProductsResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductActivateProductsResponse.cs @@ -38,7 +38,7 @@ public class Error /// [Newtonsoft.Json.JsonProperty("product_id")] [System.Text.Json.Serialization.JsonPropertyName("product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ProductId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductCreateProductResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductCreateProductResponse.cs index e2df229c..b8e37403 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductCreateProductResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductCreateProductResponse.cs @@ -22,7 +22,7 @@ public class SalesAttribute /// [Newtonsoft.Json.JsonProperty("attribute_id")] [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string AttributeId { get; set; } = default!; /// @@ -30,7 +30,7 @@ public class SalesAttribute /// [Newtonsoft.Json.JsonProperty("value_id")] [System.Text.Json.Serialization.JsonPropertyName("value_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ValueId { get; set; } = default!; } } @@ -47,7 +47,7 @@ public class SalesAttribute /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string SKUId { get; set; } = default!; /// @@ -71,7 +71,7 @@ public class SalesAttribute /// [Newtonsoft.Json.JsonProperty("product_id")] [System.Text.Json.Serialization.JsonPropertyName("product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ProductId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs index c66f01b7..036a21a7 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs @@ -22,7 +22,7 @@ public class Brand /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string BrandId { get; set; } = default!; /// @@ -213,7 +213,7 @@ public class DeliveryService /// [Newtonsoft.Json.JsonProperty("delivery_service_id")] [System.Text.Json.Serialization.JsonPropertyName("delivery_service_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string DeliveryServiceId { get; set; } = default!; /// @@ -253,7 +253,7 @@ public class Image : Data.Types.Image /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string AttributeId { get; set; } = default!; /// @@ -268,7 +268,7 @@ public class Image : Data.Types.Image /// [Newtonsoft.Json.JsonProperty("value_id")] [System.Text.Json.Serialization.JsonPropertyName("value_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ValueId { get; set; } = default!; /// @@ -313,7 +313,7 @@ public class IdentifierCodeInfo /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string SKUId { get; set; } = default!; /// @@ -397,7 +397,7 @@ public class File /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string CertificationId { get; set; } = default!; /// @@ -433,7 +433,7 @@ public class ProductAttributeValue /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ValueId { get; set; } = default!; /// @@ -450,7 +450,7 @@ public class ProductAttributeValue /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string AttributeId { get; set; } = default!; /// @@ -501,7 +501,7 @@ public class QCReason /// [Newtonsoft.Json.JsonProperty("product_id")] [System.Text.Json.Serialization.JsonPropertyName("product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ProductId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSearchProductsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSearchProductsResponse.cs index 794da046..e965a277 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSearchProductsResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSearchProductsResponse.cs @@ -33,7 +33,7 @@ public class PriceInfo /// [Newtonsoft.Json.JsonProperty("original_price")] [System.Text.Json.Serialization.JsonPropertyName("original_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal OriginalPrice { get; set; } /// @@ -41,7 +41,7 @@ public class PriceInfo /// [Newtonsoft.Json.JsonProperty("price_include_vat")] [System.Text.Json.Serialization.JsonPropertyName("price_include_vat")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal PriceIncludeVAT { get; set; } } @@ -52,7 +52,7 @@ public class StockInfo /// [Newtonsoft.Json.JsonProperty("warehouse_id")] [System.Text.Json.Serialization.JsonPropertyName("warehouse_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string WarehouseId { get; set; } = default!; /// @@ -69,7 +69,7 @@ public class StockInfo /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string SKUId { get; set; } = default!; /// @@ -100,7 +100,7 @@ public class StockInfo /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ProductId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductStockResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductStockResponse.cs index 634a4c8d..0bffa3d3 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductStockResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductStockResponse.cs @@ -18,7 +18,7 @@ public class FailedSKU /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string SKUId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionAddOrUpdateActivityItemsRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionAddOrUpdateActivityItemsRequest.cs index fd1c585d..df128b4f 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionAddOrUpdateActivityItemsRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionAddOrUpdateActivityItemsRequest.cs @@ -34,7 +34,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("promotion_price")] [System.Text.Json.Serialization.JsonPropertyName("promotion_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal? PromotionPrice { get; set; } /// @@ -42,7 +42,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("discount")] [System.Text.Json.Serialization.JsonPropertyName("discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal? Discount { get; set; } /// @@ -77,7 +77,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("promotion_price")] [System.Text.Json.Serialization.JsonPropertyName("promotion_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualNullableDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal? PromotionPrice { get; set; } /// @@ -85,7 +85,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("discount")] [System.Text.Json.Serialization.JsonPropertyName("discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualNullableDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal? Discount { get; set; } /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionAddOrUpdateActivityItemsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionAddOrUpdateActivityItemsResponse.cs index fba75a37..82c00e57 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionAddOrUpdateActivityItemsResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionAddOrUpdateActivityItemsResponse.cs @@ -21,7 +21,7 @@ public class Data /// [Newtonsoft.Json.JsonProperty("promotion_id")] [System.Text.Json.Serialization.JsonPropertyName("promotion_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PromotionId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionRemoveActivityItemsResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionRemoveActivityItemsResponse.cs index 77b36d88..cf3f90a1 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionRemoveActivityItemsResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/Items/PromotionRemoveActivityItemsResponse.cs @@ -21,7 +21,7 @@ public class Data /// [Newtonsoft.Json.JsonProperty("promotion_id")] [System.Text.Json.Serialization.JsonPropertyName("promotion_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PromotionId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityResponse.cs index a85cd001..e898f497 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionCreateActivityResponse.cs @@ -21,7 +21,7 @@ public class Data /// [Newtonsoft.Json.JsonProperty("promotion_id")] [System.Text.Json.Serialization.JsonPropertyName("promotion_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PromotionId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityResponse.cs index a5481d62..95901d12 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionDeactivateActivityResponse.cs @@ -21,7 +21,7 @@ public class Data /// [Newtonsoft.Json.JsonProperty("promotion_id")] [System.Text.Json.Serialization.JsonPropertyName("promotion_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PromotionId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailResponse.cs index 40beac3f..09326f08 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionGetActivityDetailResponse.cs @@ -22,7 +22,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("product_id")] [System.Text.Json.Serialization.JsonPropertyName("product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ProductId { get; set; } = default!; /// @@ -30,7 +30,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("sku_id")] [System.Text.Json.Serialization.JsonPropertyName("sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string SKUId { get; set; } = default!; /// @@ -38,7 +38,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("promotion_price")] [System.Text.Json.Serialization.JsonPropertyName("promotion_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal? PromotionPrice { get; set; } /// @@ -46,7 +46,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("discount")] [System.Text.Json.Serialization.JsonPropertyName("discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal? Discount { get; set; } /// @@ -72,7 +72,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("product_id")] [System.Text.Json.Serialization.JsonPropertyName("product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ProductId { get; set; } = default!; /// @@ -80,7 +80,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("promotion_price")] [System.Text.Json.Serialization.JsonPropertyName("promotion_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualNullableDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal? PromotionPrice { get; set; } /// @@ -88,7 +88,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("discount")] [System.Text.Json.Serialization.JsonPropertyName("discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualNullableDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal? Discount { get; set; } /// @@ -121,7 +121,7 @@ public class SKU /// [Newtonsoft.Json.JsonProperty("promotion_id")] [System.Text.Json.Serialization.JsonPropertyName("promotion_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PromotionId { get; set; } = default!; /// @@ -177,7 +177,7 @@ public class SKU /// 获取或设置创建时间戳。 /// [Newtonsoft.Json.JsonProperty("create_time")] - [System.Text.Json.Serialization.JsonPropertyName("updatcreate_timee_time")] + [System.Text.Json.Serialization.JsonPropertyName("create_time")] public long CreateTimestamp { get; set; } /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesResponse.cs index 4af71022..dc5a6e4c 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionSearchActivitiesResponse.cs @@ -18,7 +18,7 @@ public class Promotion /// [Newtonsoft.Json.JsonProperty("promotion_id")] [System.Text.Json.Serialization.JsonPropertyName("promotion_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PromotionId { get; set; } = default!; /// @@ -67,7 +67,7 @@ public class Promotion /// 获取或设置创建时间戳。 /// [Newtonsoft.Json.JsonProperty("create_time")] - [System.Text.Json.Serialization.JsonPropertyName("updatcreate_timee_time")] + [System.Text.Json.Serialization.JsonPropertyName("create_time")] public long CreateTimestamp { get; set; } /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityResponse.cs index dab50938..1f6bd437 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Promotion/PromotionUpdateActivityResponse.cs @@ -21,7 +21,7 @@ public class Data /// [Newtonsoft.Json.JsonProperty("promotion_id")] [System.Text.Json.Serialization.JsonPropertyName("promotion_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PromotionId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersRequest.cs index 3bef094f..57f1acc8 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersRequest.cs @@ -38,7 +38,7 @@ public class ReverseSearchReverseOrdersRequest : TikTokShopRequest /// [Newtonsoft.Json.JsonProperty("order_id")] [System.Text.Json.Serialization.JsonPropertyName("order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string? OrderId { get; set; } /// @@ -46,7 +46,7 @@ public class ReverseSearchReverseOrdersRequest : TikTokShopRequest /// [Newtonsoft.Json.JsonProperty("reverse_order_id")] [System.Text.Json.Serialization.JsonPropertyName("reverse_order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string? ReverseOrderId { get; set; } /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersResponse.cs index af7fadbe..e60ad51f 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersResponse.cs @@ -22,7 +22,7 @@ public class ReturnSKU /// [Newtonsoft.Json.JsonProperty("return_product_id")] [System.Text.Json.Serialization.JsonPropertyName("return_product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ProductId { get; set; } = default!; /// @@ -37,7 +37,7 @@ public class ReturnSKU /// [Newtonsoft.Json.JsonProperty("sku_id")] [System.Text.Json.Serialization.JsonPropertyName("sku_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string SKUId { get; set; } = default!; /// @@ -113,7 +113,7 @@ public class ReverseRecord /// [Newtonsoft.Json.JsonProperty("reverse_order_id")] [System.Text.Json.Serialization.JsonPropertyName("reverse_order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ReverseOrderId { get; set; } = default!; /// @@ -121,7 +121,7 @@ public class ReverseRecord /// [Newtonsoft.Json.JsonProperty("order_id")] [System.Text.Json.Serialization.JsonPropertyName("order_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string OrderId { get; set; } = default!; /// @@ -185,7 +185,7 @@ public class ReverseRecord /// [Newtonsoft.Json.JsonProperty("refund_total")] [System.Text.Json.Serialization.JsonPropertyName("refund_total")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.TextualDecimalReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal RefundAmount { get; set; } /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Seller/SellerGetGlobalActiveShopListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Seller/SellerGetGlobalActiveShopListResponse.cs index 2e08a17e..e7ce6a98 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Seller/SellerGetGlobalActiveShopListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Seller/SellerGetGlobalActiveShopListResponse.cs @@ -18,7 +18,7 @@ public class Shop /// [Newtonsoft.Json.JsonProperty("shop_id")] [System.Text.Json.Serialization.JsonPropertyName("shop_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ShopId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Shop/ShopGetAuthorizedShopListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Shop/ShopGetAuthorizedShopListResponse.cs index 41dfcccb..0c0a741e 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Shop/ShopGetAuthorizedShopListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Shop/ShopGetAuthorizedShopListResponse.cs @@ -18,7 +18,7 @@ public class Shop /// [Newtonsoft.Json.JsonProperty("shop_id")] [System.Text.Json.Serialization.JsonPropertyName("shop_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string ShopId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/SupplyChain/SupplyChainSyncPackageFulfillmentDataResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/SupplyChain/SupplyChainSyncPackageFulfillmentDataResponse.cs index eb6d07b5..d1823165 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/SupplyChain/SupplyChainSyncPackageFulfillmentDataResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/SupplyChain/SupplyChainSyncPackageFulfillmentDataResponse.cs @@ -18,7 +18,7 @@ public class FailedPackage /// [Newtonsoft.Json.JsonProperty("package_id")] [System.Text.Json.Serialization.JsonPropertyName("package_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalStringReadOnlyConverter))] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] public string PackageId { get; set; } = default!; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.csproj b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.csproj index 57129b45..5dc7adef 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.csproj +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.csproj @@ -2,7 +2,7 @@ net461; netstandard2.0; net6.0 - 8.0 + 10.0 enable true @@ -14,7 +14,7 @@ MIT https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.ByteDance Flurl.Http ByteDance TikTok TikTokShop TikTokShopPartner TikTokShopOpenPlatform TikTokShopOpenAPI TTS TTSPartner TTSOpenPlatform TTSOpenAPI 字节 字节跳动 抖音国际版 抖音国际版电商 抖音跨境电商 抖音跨境电商开放平台 - 2.1.0 + 3.0.0-preview.1 基于 Flurl.Http 的 TikTok Shop Open Platform API 客户端。 The TikTok Shop Open Platform API SDK for .NET. (Offical Website: https://partner.tiktokshop.com/) @@ -43,7 +43,7 @@ - + diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Settings/Credentials.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Settings/Credentials.cs index 1a83bc0e..f9d65ef4 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Settings/Credentials.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Settings/Credentials.cs @@ -16,7 +16,7 @@ public class Credentials internal Credentials(TikTokShopClientOptions options) { - if (options == null) throw new ArgumentNullException(nameof(options)); + if (options is null) throw new ArgumentNullException(nameof(options)); AppKey = options.AppKey; AppSecret = options.AppSecret; diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClient.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClient.cs index c56f41bf..975d5cc2 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClient.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClient.cs @@ -19,64 +19,55 @@ public class TikTokShopClient : CommonClientBase, ICommonClient /// /// 获取当前客户端使用的 TikTok Shop API 接入点。 /// - protected internal string Endpoint { get; } + protected internal string EndpointForDefault { get; } /// /// 获取当前客户端使用的 TikTok Shop Auth API 接入点。 /// - protected internal string EndpointForAuthAPI { get; } + protected internal string EndpointForAuth { get; } /// /// 用指定的配置项初始化 类的新实例。 /// /// 配置项。 public TikTokShopClient(TikTokShopClientOptions options) - : base() + : this(options, null) { - if (options == null) throw new ArgumentNullException(nameof(options)); - - Credentials = new Settings.Credentials(options); - Endpoint = options.Endpoint ?? TikTokShopEndpoints.DEFAULT; - EndpointForAuthAPI = options.EndpointForAuthAPI ?? TikTokShopAuthApiEndpoints.DEFAULT; - - FlurlClient.BaseUrl = Endpoint; - FlurlClient.WithTimeout(TimeSpan.FromMilliseconds(options.Timeout)); - - Interceptors.Add(new Interceptors.TikTokShopRequestSignatureInterceptor( - baseUrl: Endpoint, - appSecret: options.AppSecret - )); } /// - /// 用指定的 TikTok Shop AppKey、TikTok Shop AppSecret 初始化 类的新实例。 + /// /// - /// TikTok Shop AppKey。 - /// TikTok Shop AppSecret。 - public TikTokShopClient(string appKey, string appSecret) - : this(new TikTokShopClientOptions() { AppKey = appKey, AppSecret = appSecret }) + /// + /// + /// + internal protected TikTokShopClient(TikTokShopClientOptions options, HttpClient? httpClient, bool disposeClient = true) + : base(httpClient, disposeClient) { - if (appKey == null) throw new ArgumentNullException(nameof(appKey)); - if (appSecret == null) throw new ArgumentNullException(nameof(appSecret)); + if (options is null) throw new ArgumentNullException(nameof(options)); + + Credentials = new Settings.Credentials(options); + EndpointForDefault = options.Endpoint ?? TikTokShopEndpoints.DEFAULT; + EndpointForAuth = options.EndpointForAuthAPI ?? TikTokShopAuthApiEndpoints.DEFAULT; + + FlurlClient.BaseUrl = EndpointForDefault; + FlurlClient.WithTimeout(options.Timeout <= 0 ? Timeout.InfiniteTimeSpan : TimeSpan.FromMilliseconds(options.Timeout)); + + Interceptors.Add(new Interceptors.TikTokShopRequestSigningInterceptor(baseUrl: EndpointForDefault, appSecret: options.AppSecret)); } /// /// 使用当前客户端生成一个新的 对象。 /// /// - /// + /// /// /// - public IFlurlRequest CreateRequest(TikTokShopRequest request, HttpMethod method, params object[] urlSegments) + public IFlurlRequest CreateFlurlRequest(TikTokShopRequest request, HttpMethod httpMethod, params object[] urlSegments) { - IFlurlRequest flurlRequest = FlurlClient.Request(urlSegments).WithVerb(method); - - if (request.Timeout != null) - { - flurlRequest.WithTimeout(TimeSpan.FromMilliseconds(request.Timeout.Value)); - } + IFlurlRequest flurlRequest = base.CreateFlurlRequest(request, httpMethod, urlSegments); - if (request.Timestamp == null) + if (request.Timestamp is null) { request.Timestamp = DateTimeOffset.Now.ToLocalTime().ToUnixTimeSeconds(); } @@ -97,24 +88,13 @@ public IFlurlRequest CreateRequest(TikTokShopRequest request, HttpMethod method, /// /// /// - public async Task SendRequestAsync(IFlurlRequest flurlRequest, HttpContent? httpContent = null, CancellationToken cancellationToken = default) + public async Task SendFlurlRequestAsync(IFlurlRequest flurlRequest, HttpContent? httpContent = null, CancellationToken cancellationToken = default) where T : TikTokShopResponse, new() { - if (flurlRequest == null) throw new ArgumentNullException(nameof(flurlRequest)); + if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest)); - try - { - using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken); - return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); - } - catch (FlurlHttpTimeoutException ex) - { - throw new Exceptions.TikTokShopRequestTimeoutException(ex.Message, ex); - } - catch (FlurlHttpException ex) - { - throw new TikTokShopException(ex.Message, ex); - } + using IFlurlResponse flurlResponse = await base.SendFlurlRequestAsync(flurlRequest, httpContent, cancellationToken).ConfigureAwait(false); + return await WrapFlurlResponseAsJsonAsync(flurlResponse, cancellationToken).ConfigureAwait(false); } /// @@ -125,30 +105,19 @@ public async Task SendRequestAsync(IFlurlRequest flurlRequest, HttpContent /// /// /// - public async Task SendRequestWithJsonAsync(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default) + public async Task SendFlurlRequesAsJsontAsync(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default) where T : TikTokShopResponse, new() { - if (flurlRequest == null) throw new ArgumentNullException(nameof(flurlRequest)); + if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest)); - try - { - bool isSimpleRequest = data == null || - flurlRequest.Verb == HttpMethod.Get || - flurlRequest.Verb == HttpMethod.Head || - flurlRequest.Verb == HttpMethod.Options; - using IFlurlResponse flurlResponse = isSimpleRequest ? - await base.SendRequestAsync(flurlRequest, null, cancellationToken) : - await base.SendRequestWithJsonAsync(flurlRequest, data, cancellationToken); - return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); - } - catch (FlurlHttpTimeoutException ex) - { - throw new Exceptions.TikTokShopRequestTimeoutException(ex.Message, ex); - } - catch (FlurlHttpException ex) - { - throw new TikTokShopException(ex.Message, ex); - } + bool isSimpleRequest = data is null || + flurlRequest.Verb == HttpMethod.Get || + flurlRequest.Verb == HttpMethod.Head || + flurlRequest.Verb == HttpMethod.Options; + using IFlurlResponse flurlResponse = isSimpleRequest ? + await base.SendFlurlRequestAsync(flurlRequest, null, cancellationToken).ConfigureAwait(false) : + await base.SendFlurlRequestAsJsonAsync(flurlRequest, data, cancellationToken).ConfigureAwait(false); + return await WrapFlurlResponseAsJsonAsync(flurlResponse, cancellationToken).ConfigureAwait(false); } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopException.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopException.cs index 1f28832e..818e1cb0 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopException.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopException.cs @@ -3,9 +3,9 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop { /// - /// TikTok Shop API 出错时引发的异常。 + /// 调用 TikTok Shop API 出错时引发的异常。 /// - public class TikTokShopException : CommonExceptionBase + public class TikTokShopException : CommonException { /// public TikTokShopException() diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs index 190ad584..c7df7a41 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs @@ -3,15 +3,8 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop /// /// TikTok Shop API 请求的基类。 /// - public abstract class TikTokShopRequest : ICommonRequest + public abstract class TikTokShopRequest : CommonRequestBase, ICommonRequest { - /// - /// 获取或设置请求超时时间(单位:毫秒)。如果不指定将使用构造 时的 参数,这在需要指定特定耗时请求(比如上传或下载文件)的超时时间时很有用。 - /// - [Newtonsoft.Json.JsonIgnore] - [System.Text.Json.Serialization.JsonIgnore] - public virtual int? Timeout { get; set; } - /// /// 获取或设置接口调用凭证。 /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopResponse.cs index 88adc72d..fefd8298 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopResponse.cs @@ -5,56 +5,8 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop /// /// TikTok Shop API 响应的基类。 /// - public abstract class TikTokShopResponse : ICommonResponse + public abstract class TikTokShopResponse : CommonResponseBase, ICommonResponse { - /// - /// - /// - int ICommonResponse.RawStatus { get; set; } - - /// - /// - /// - IDictionary ICommonResponse.RawHeaders { get; set; } = default!; - - /// - /// - /// - byte[] ICommonResponse.RawBytes { get; set; } = default!; - - /// - /// 获取原始的 HTTP 响应状态码。 - /// - [Newtonsoft.Json.JsonIgnore] - [System.Text.Json.Serialization.JsonIgnore] - public int RawStatus - { - get { return ((ICommonResponse)this).RawStatus; } - internal set { ((ICommonResponse)this).RawStatus = value; } - } - - /// - /// 获取原始的 HTTP 响应表头集合。 - /// - [Newtonsoft.Json.JsonIgnore] - [System.Text.Json.Serialization.JsonIgnore] - public IDictionary RawHeaders - { - get { return ((ICommonResponse)this).RawHeaders; } - internal set { ((ICommonResponse)this).RawHeaders = value; } - } - - /// - /// 获取原始的 HTTP 响应正文。 - /// - [Newtonsoft.Json.JsonIgnore] - [System.Text.Json.Serialization.JsonIgnore] - public byte[] RawBytes - { - get { return ((ICommonResponse)this).RawBytes; } - internal set { ((ICommonResponse)this).RawBytes = value; } - } - /// /// 获取 TikTok Shop API 返回的错误码。 /// @@ -78,12 +30,15 @@ public byte[] RawBytes public virtual string? RequestId { get; set; } /// - /// 获取一个值,该值指示调用 TikTok API 是否成功(即 HTTP 状态码为 200、且 "code" 值为 0)。 + /// 获取一个值,该值指示调用 TikTok API 是否成功。 + /// + /// (即 HTTP 状态码为 200,且 值为 0) + /// /// /// - public virtual bool IsSuccessful() + public override bool IsSuccessful() { - return RawStatus == 200 && ErrorCode == 0; + return GetRawStatus() == 200 && ErrorCode == 0; } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Utilities/HMACUtility.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Utilities/HMACUtility.cs index 90bef9fc..efeaac33 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Utilities/HMACUtility.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Utilities/HMACUtility.cs @@ -1,44 +1,49 @@ using System; using System.Security.Cryptography; -using System.Text; namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Utilities { + using SKIT.FlurlHttpClient.Primitives; + /// /// HMAC 算法工具类。 /// public static class HMACUtility { /// - /// 获取 HMAC-SHA-256 消息认证码。 + /// 计算 HMAC-SHA-256 哈希值。 /// - /// 密钥字节数组。 - /// 信息字节数组。 - /// 消息认证码字节数组。 - public static byte[] HashWithSHA256(byte[] secretBytes, byte[] msgBytes) + /// 密钥字节数组。 + /// 要计算哈希值的信息字节数组。 + /// 哈希值字节数组。 + public static byte[] HashWithSHA256(byte[] keyBytes, byte[] messageBytes) { - if (secretBytes == null) throw new ArgumentNullException(nameof(secretBytes)); - if (msgBytes == null) throw new ArgumentNullException(nameof(msgBytes)); + if (keyBytes is null) throw new ArgumentNullException(nameof(keyBytes)); + if (messageBytes is null) throw new ArgumentNullException(nameof(messageBytes)); - using HMAC hmac = new HMACSHA256(secretBytes); - return hmac.ComputeHash(msgBytes); +#if NET5_0_OR_GREATER + return HMACSHA256.HashData(keyBytes, messageBytes); +#else + using HMAC hmac = new HMACSHA256(keyBytes); + return hmac.ComputeHash(messageBytes); +#endif } /// - /// 获取 HMAC-SHA-256 消息认证码。 + /// 计算 HMAC-SHA-256 哈希值。 /// - /// 密钥。 - /// 文本信息。 - /// 消息认证码。 - public static string HashWithSHA256(string secret, string message) + /// 密钥。 + /// 要计算哈希值的信息。 + /// 经过十六进制编码的哈希值。 + public static EncodedString HashWithSHA256(string key, string messageData) { - if (secret == null) throw new ArgumentNullException(nameof(secret)); - if (message == null) throw new ArgumentNullException(nameof(message)); + if (key is null) throw new ArgumentNullException(nameof(key)); + if (messageData is null) throw new ArgumentNullException(nameof(messageData)); - byte[] secretBytes = Encoding.UTF8.GetBytes(secret); - byte[] msgBytes = Encoding.UTF8.GetBytes(message); - byte[] hashBytes = HashWithSHA256(secretBytes, msgBytes); - return BitConverter.ToString(hashBytes).Replace("-", string.Empty); + byte[] keyBytes = EncodedString.FromLiteralString(key); + byte[] messageBytes = EncodedString.FromLiteralString(messageData); + byte[] hashBytes = HashWithSHA256(keyBytes, messageBytes); + return EncodedString.ToHexString(hashBytes); } } } diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/IMPORTANT_CodeAnalyzeTests.cs b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/IMPORTANT_CodeAnalyzeTests.cs new file mode 100644 index 00000000..5dc8b5f7 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/IMPORTANT_CodeAnalyzeTests.cs @@ -0,0 +1,55 @@ +using System; +using System.IO; +using System.Reflection; +using SKIT.FlurlHttpClient.Tools.CodeAnalyzer; +using Xunit; + +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests +{ + public class CodeAnalyzeTests + { + // NOTICE: + // 如果 Visual Studio 遇到 “缺少 SKIT.FlurlHttpClient.Tools.CodeAnalyzer 包” 的错误, + // 请参考此 Issue:https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/issues/8 + + [Fact(DisplayName = "代码质量分析")] + public void CodeAnalyze() + { + Assert.Null(Record.Exception(() => + { + var options = new TypeDeclarationAnalyzerOptions() + { + SdkAssembly = Assembly.GetAssembly(typeof(TikTokShopClient))!, + SdkRequestModelDeclarationNamespace = "SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models", + SdkResponseModelDeclarationNamespace = "SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models", + SdkExecutingExtensionDeclarationNamespace = "SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop", + ThrowOnNotFoundRequestModelTypes = true, + ThrowOnNotFoundResponseModelTypes = true, + ThrowOnNotFoundExecutingExtensionTypes = true + }; + new TypeDeclarationAnalyzer(options).AssertNoIssues(); + })); + + Assert.Null(Record.Exception(() => + { + string workdir = Environment.CurrentDirectory; + string projdir = Path.Combine(workdir, "../../../../../"); + + var options = new SourceFileAnalyzerOptions() + { + SdkAssembly = Assembly.GetAssembly(typeof(TikTokShopClient))!, + SdkRequestModelDeclarationNamespace = "SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models", + SdkResponseModelDeclarationNamespace = "SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models", + ProjectSourceRootDirectory = Path.Combine(projdir, "./src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/"), + ProjectTestRootDirectory = Path.Combine(projdir, "./test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/"), + ThrowOnNotFoundRequestModelClassCodeFiles = true, + ThrowOnNotFoundResponseModelClassCodeFiles = true, + ThrowOnNotFoundExecutingExtensionClassCodeFiles = true, + ThrowOnNotFoundRequestModelSerializationSampleFiles = true, + ThrowOnNotFoundResponseModelSerializationSampleFiles = true + }; + new SourceFileAnalyzer(options).AssertNoIssues(); + })); + } + } +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests.csproj b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests.csproj index 214aeb62..92d86e84 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests.csproj +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests.csproj @@ -11,21 +11,21 @@ - Never - Never - - PreserveNewest PreserveNewest + + Always + Always + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/TestCase_CodeReview.cs b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/TestCase_CodeReview.cs deleted file mode 100644 index 65796fac..00000000 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/TestCase_CodeReview.cs +++ /dev/null @@ -1,28 +0,0 @@ -using SKIT.FlurlHttpClient.Tools.CodeAnalyzer; -using Xunit; - -namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests -{ - public class TestCase_CodeReview - { - [Fact(DisplayName = "测试用例:代码质量分析")] - public void TestCodeAnalyzer() - { - Assert.Null(Record.Exception(() => - { - CodeAnalyzerOptions options = new CodeAnalyzerOptions() - { - AssemblyName = "SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop", - WorkDirectoryForSourceCode = TestConfigs.WorkDirectoryForSdk, - WorkDirectoryForTestSample = TestConfigs.WorkDirectoryForTest, - AllowNotFoundEventTypes = true, - AllowNotFoundEventSamples = true - }; - CodeAnalyzer analyzer = new CodeAnalyzer(options); - analyzer.Start(); - analyzer.Assert(); - analyzer.Flush(); - })); - } - } -} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/TestConfigs.cs b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/TestConfigs.cs index dc19df42..27c51821 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/TestConfigs.cs +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/TestConfigs.cs @@ -17,13 +17,10 @@ static TestConfigs() using var stream = File.OpenRead("appsettings.local.json"); using var json = JsonDocument.Parse(stream); - var config = json.RootElement.GetProperty("TestConfig"); + var config = json.RootElement.GetProperty("TestConfigs"); TikTokShopAppKey = config.GetProperty("AppKey").GetString()!; TikTokShopAppSecret = config.GetProperty("AppSecret").GetString()!; TikTokShopAccessToken = config.GetProperty("AccessToken").GetString()!; - - WorkDirectoryForSdk = json.RootElement.GetProperty("WorkDirectoryForSdk").GetString()!; - WorkDirectoryForTest = json.RootElement.GetProperty("WorkDirectoryForTest").GetString()!; } catch (Exception ex) { @@ -34,8 +31,5 @@ static TestConfigs() public static readonly string TikTokShopAppKey; public static readonly string TikTokShopAppSecret; public static readonly string TikTokShopAccessToken; - - public static readonly string WorkDirectoryForSdk; - public static readonly string WorkDirectoryForTest; } } diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/appsettings.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/appsettings.json index 0914abaa..9034e254 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/appsettings.json +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/appsettings.json @@ -1,9 +1,7 @@ { - "TestConfig": { + "TestConfigs": { "AppKey": "请在此填写用于测试的 TikTok Shop AppKey", "AppSecret": "请在此填写用于测试的 TikTok Shop AppSecret", "AccessToken": "请在此填写用于测试的 TikTok Shop AccessToken" - }, - "WorkDirectoryForSdk": "请输入当前 SDK 项目所在的目录完整路径,如 C:\\Project\\src\\SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop\\", - "WorkDirectoryForTest": "请输入当前测试项目所在的目录完整路径,如 C:\\Project\\test\\SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests\\" + } } From da203278f33026aca7852c403e27cfedd850db38 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 14:46:38 +0800 Subject: [PATCH 02/12] =?UTF-8?q?feat(tiktokshop):=20=E6=9E=84=E9=80=A0?= =?UTF-8?q?=E5=99=A8=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TikTokShopClientBuilder.cs | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClientBuilder.cs diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClientBuilder.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClientBuilder.cs new file mode 100644 index 00000000..7ecf890f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClientBuilder.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; + +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop +{ + /// + /// 用于构造 实例的构造器。 + /// + public partial class TikTokShopClientBuilder : ICommonClientBuilder + { + private readonly TikTokShopClientOptions _options; + private readonly IList> _configures; + private readonly IList _interceptors; + private HttpClient? _httpClient; + private bool? _disposeClient; + + private TikTokShopClientBuilder(TikTokShopClientOptions options) + { + _options = options; + _configures = new List>(); + _interceptors = new List(); + } + + ICommonClientBuilder ICommonClientBuilder.ConfigureSettings(Action configure) + { + return ConfigureSettings(configure); + } + + ICommonClientBuilder ICommonClientBuilder.UseInterceptor(HttpInterceptor interceptor) + { + return UseInterceptor(interceptor); + } + + ICommonClientBuilder ICommonClientBuilder.UseHttpClient(HttpClient httpClient, bool disposeClient) + { + return UseHttpClient(httpClient, disposeClient); + } + + public TikTokShopClientBuilder ConfigureSettings(Action configure) + { + if (configure is null) throw new ArgumentNullException(nameof(configure)); + + _configures.Add(configure); + return this; + } + + public TikTokShopClientBuilder UseInterceptor(HttpInterceptor interceptor) + { + if (interceptor is null) throw new ArgumentNullException(nameof(interceptor)); + + _interceptors.Add(interceptor); + return this; + } + + public TikTokShopClientBuilder UseHttpClient(HttpClient httpClient, bool disposeClient = true) + { + if (httpClient is null) throw new ArgumentNullException(nameof(httpClient)); + + _httpClient = httpClient; + _disposeClient = disposeClient; + return this; + } + + public TikTokShopClient Build() + { + TikTokShopClient client = _disposeClient.HasValue + ? new TikTokShopClient(_options, _httpClient, _disposeClient.Value) + : new TikTokShopClient(_options, _httpClient); + + foreach (Action configure in _configures) + { + client.Configure(configure); + } + + foreach (HttpInterceptor interceptor in _interceptors) + { + client.Interceptors.Add(interceptor); + } + + return client; + } + } + + partial class TikTokShopClientBuilder + { + public static TikTokShopClientBuilder Create(TikTokShopClientOptions options) + { + if (options is null) throw new ArgumentNullException(nameof(options)); + + return new TikTokShopClientBuilder(options); + } + } +} From 7cdbaded202a06d73087bdfe066f39a52cf06a0c Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 16:20:47 +0800 Subject: [PATCH 03/12] =?UTF-8?q?docs:=20=E5=AE=8C=E5=96=84=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 2 - .../DouyinShop/Advanced_IHttpClientFactory.md | 13 --- docs/DouyinShop/Advanced_Interceptor.md | 19 ----- docs/DouyinShop/Advanced_JsonSerializer.md | 13 --- docs/DouyinShop/Basic_EventDeserialization.md | 15 ---- .../Basic_EventSignatureVerification.md | 17 ---- docs/DouyinShop/Basic_Extensions.md | 57 ------------- docs/DouyinShop/Basic_ModelDefinition.md | 40 --------- docs/DouyinShop/README.md | 85 ------------------- docs/TikTokGlobal/Basic_ModelDefinition.md | 2 +- .../TikTokGlobalShop/Basic_ModelDefinition.md | 2 +- docs/TikTokGlobalShop/README.md | 5 +- .../OceanEngineException.cs | 2 +- 13 files changed, 7 insertions(+), 265 deletions(-) delete mode 100644 docs/DouyinShop/Advanced_IHttpClientFactory.md delete mode 100644 docs/DouyinShop/Advanced_Interceptor.md delete mode 100644 docs/DouyinShop/Advanced_JsonSerializer.md delete mode 100644 docs/DouyinShop/Basic_EventDeserialization.md delete mode 100644 docs/DouyinShop/Basic_EventSignatureVerification.md delete mode 100644 docs/DouyinShop/Basic_Extensions.md delete mode 100644 docs/DouyinShop/Basic_ModelDefinition.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6143e72..c574e8c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,8 +18,6 @@ 如果你的疑问仍不能得到解决,请开启一个新的 Issue。 -社区交流 QQ 群:875580418 - --- ## 如何报告缺陷? diff --git a/docs/DouyinShop/Advanced_IHttpClientFactory.md b/docs/DouyinShop/Advanced_IHttpClientFactory.md deleted file mode 100644 index d73d446a..00000000 --- a/docs/DouyinShop/Advanced_IHttpClientFactory.md +++ /dev/null @@ -1,13 +0,0 @@ -## 如何在 ASP.NET Core 中与 `IHttpClientFactory` 集成? - ---- - -本功能来自于公共组件,请参阅公共组件下的相关文档: - -> [《SKIT.FlurlHttpClient FAQ:如何在 ASP.NET Core 中与 IHttpClientFactory 集成?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/FAQ_IHttpClientFactory.md) - ---- - -### 镜像站点 - -国内用户如访问 GitHub 网络状况不佳,可在打开上述链接后,手动将域名部分的 **github.com** 替换为 **gitee.com**、剩余路径部分保持不变,即可访问。 diff --git a/docs/DouyinShop/Advanced_Interceptor.md b/docs/DouyinShop/Advanced_Interceptor.md deleted file mode 100644 index e969e30d..00000000 --- a/docs/DouyinShop/Advanced_Interceptor.md +++ /dev/null @@ -1,19 +0,0 @@ -## 如何使用拦截器? - ---- - -本功能来自于公共组件,请参阅公共组件下的相关文档: - -> [《SKIT.FlurlHttpClient FAQ:如何使用拦截器?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/FAQ_Interceptor.md) - ---- - -### 镜像站点 - -国内用户如访问 GitHub 网络状况不佳,可在打开上述链接后,手动将域名部分的 **github.com** 替换为 **gitee.com**、剩余路径部分保持不变,即可访问。 - ---- - -### 内置拦截器 - -本库内置了一个用户请求时自动格式化参数、和一个用于请求时自动生成签名的拦截器。 diff --git a/docs/DouyinShop/Advanced_JsonSerializer.md b/docs/DouyinShop/Advanced_JsonSerializer.md deleted file mode 100644 index a9df787e..00000000 --- a/docs/DouyinShop/Advanced_JsonSerializer.md +++ /dev/null @@ -1,13 +0,0 @@ -## 如何指定 JSON 序列化器? - ---- - -本功能来自于公共组件,请参阅公共组件下的相关文档: - -> [《SKIT.FlurlHttpClient FAQ:如何指定 JSON 序列化器?》](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient/blob/main/docs/FAQ_JsonSerializer.md) - ---- - -### 镜像站点 - -国内用户如访问 GitHub 网络状况不佳,可在打开上述链接后,手动将域名部分的 **github.com** 替换为 **gitee.com**、剩余路径部分保持不变,即可访问。 diff --git a/docs/DouyinShop/Basic_EventDeserialization.md b/docs/DouyinShop/Basic_EventDeserialization.md deleted file mode 100644 index 641f13a7..00000000 --- a/docs/DouyinShop/Basic_EventDeserialization.md +++ /dev/null @@ -1,15 +0,0 @@ -## 如何解析回调通知事件? - ---- - -对于抖店开放平台推送过来的回调通知事件,本库封装了直接解析成事件模型的扩展方法,下面给出一个示例: - -```csharp -/* 以 doudian_trade_TradeCreate 事件为例 */ -string callbackJson = "{ ... }"; -var callbackModels = client.DeserializeEvents(callbackJson); -``` - -这里需要注意,抖店开放平台是以列表形式推送事件的。 - -完整的回调通知模型定义可以参考项目目录下的 _src/SKIT.FlurlHttpClient.ByteDance.DouyinShop/Events_ 目录。 diff --git a/docs/DouyinShop/Basic_EventSignatureVerification.md b/docs/DouyinShop/Basic_EventSignatureVerification.md deleted file mode 100644 index 4ba4197e..00000000 --- a/docs/DouyinShop/Basic_EventSignatureVerification.md +++ /dev/null @@ -1,17 +0,0 @@ -## 如何验证回调通知事件签名? - ---- - -> 请先自行阅读: -> -> [《抖店开放平台文档中心 - 消息推送服务接入指南:消息解析》](https://op.jinritemai.com/docs/guide-docs/153/99) - -同样的,你既可以利用本库提供的 `MD5Utility` 工具类自行进行签名验证,也可以通过扩展方法实现: - -```csharp -/* 验证回调通知事件签名 */ -bool ret = client.VerifyEventSignature( - callbackJson: "抖店回调通知中请求正文", - callbackSignature: "抖店回调通知中的 event-sign 字段" -); -``` diff --git a/docs/DouyinShop/Basic_Extensions.md b/docs/DouyinShop/Basic_Extensions.md deleted file mode 100644 index 2c24c97f..00000000 --- a/docs/DouyinShop/Basic_Extensions.md +++ /dev/null @@ -1,57 +0,0 @@ -## 如何自定义额外的 API 接口? - ---- - -如果有某些接口本库尚未支持,你可按照下面的示例自行扩展: - -```csharp -/* 继承 DouyinShopRequest 实现自定义请求类 */ -public class MyFakeRequest : DouyinShopRequest -{ - [Newtonsoft.Json.JsonProperty("my_fake_props")] - [System.Text.Json.Serialization.JsonPropertyName("my_fake_props")] - public string MyFakeProps { get; set; } -} - -/* 继承 DouyinShopResponse 实现自定义响应类 */ -public class MyFakeResponse : DouyinShopResponse -{ - [Newtonsoft.Json.JsonProperty("my_fake_props")] - [System.Text.Json.Serialization.JsonPropertyName("my_fake_props")] - public string MyFakeProps { get; set; } -} - -/* 扩展 DouyinShopClient 方法 */ -public static class MyFakeClientExtensions -{ - public static async Task ExecuteMyFakeAsync(this DouyinShopClient client, MyFakeRequest 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, "my-fake-url") - .SetQueryParam("access_token", request.AccessToken); - - return await client.SendRequestWithJsonAsync(flurlReq, request, cancellationToken); - } -} -``` - -同样的,你也可自行扩展回调通知事件模型: - -```csharp -/* 继承 DouyinShopEvent 实现自定义的回调通知事件 */ -public class MyFakeEvent : DouyinShopEvent -{ - public static class Types - { - public class Data - { - [Newtonsoft.Json.JsonProperty("my_fake_props")] - [System.Text.Json.Serialization.JsonPropertyName("my_fake_props")] - public string MyFakeProps { get; set; } - } - } -} -``` diff --git a/docs/DouyinShop/Basic_ModelDefinition.md b/docs/DouyinShop/Basic_ModelDefinition.md deleted file mode 100644 index d28c8da8..00000000 --- a/docs/DouyinShop/Basic_ModelDefinition.md +++ /dev/null @@ -1,40 +0,0 @@ -## 如何快速找到需要调用的 API 模型类名 / 方法名? - ---- - -本库提供的请求模型、响应模型和接口方法,三者均保持同名。 - -例如,设置商品限购的请求是 `ProductEditBuyerLimitRequest`,响应是 `ProductEditBuyerLimitResponse`,接口是 `ExecuteProductEditBuyerLimitAsync()`。知道其中一个,其余两个就可以快速地推断出了。 - -再有,每个对象的命名与官方文档的接口地址大体保持一致。例如刚刚提到的获取粉丝列表,它的接口地址是 `[POST] /product/editBuyerLimit`,将其中的反斜杠去掉、并以大驼峰命名法的方式调整它,就可以得到前文提到的几个对象了。 - -完整的模型定义可以参考项目目录下的 _src/SKIT.FlurlHttpClient.ByteDance.DouyinShop/Models_ 目录。 - ---- - -### 抖店开放平台 API 支持情况: - -
- -[展开查看] - -| | 抖店 API | 备注 | -| :-: | :-----------: | :--: | -| √ | 店铺 API | | -| √ | 商品 API | | -| √ | 库存 API | | -| √ | 订单 API | | -| √ | 物流发货 API | | -| √ | 售后退款 API | | -| √ | 保险 API | | -| √ | 代发 API | | -| √ | 跨境 API | | -| √ | 卡券 API | | -| √ | BIC 质检 API | | -| √ | BTAS 质检 API | | -| √ | 仓库作业 API | | -| √ | 精选联盟 API | | -| √ | 回收寄卖 API | | -| √ | 素材中心 API | | - -
diff --git a/docs/DouyinShop/README.md b/docs/DouyinShop/README.md index 2942d629..7ffa5faf 100644 --- a/docs/DouyinShop/README.md +++ b/docs/DouyinShop/README.md @@ -9,88 +9,3 @@ 抖店开放平台已于 2022-12-05 提供了官方的 .NET SDK([点此传送](https://op.jinritemai.com/docs/guide-docs/1041/1072)),因此本项目将无限期搁置开发。 如果你有二次开发需要,请 Fork 项目后自行维护。 - ---- - -## 功能 - -- 基于抖店开放平台 API 封装。 -- 支持商家自研、软件服务商两种模式。 -- 请求时自动生成签名,无需开发者手动干预。 -- 提供了抖店开放平台 API 所需的 MD5、HMAC-SHA-256 等算法工具类。 -- 提供了解析回调通知事件等扩展方法。 - ---- - -## 快速入门 - -### 安装: - -提示:如果你使用 Visual Studio NuGet 管理器图形化界面,请在搜索结果中勾选“**包括预发行版**”。 - -```shell -# 通过 NuGet 安装 -> Install-Package SKIT.FlurlHttpClient.ByteDance.DouyinShop - -# 通过 dotnet-tools 安装 -> dotnet add package SKIT.FlurlHttpClient.ByteDance.DouyinShop -``` - -### 初始化: - -```csharp -using SKIT.FlurlHttpClient.ByteDance.DouyinShop; - -var options = new DouyinShopClientOptions() -{ - AppKey = "抖店开放平台应用 Key", - AppSecret = "抖店开放平台应用密钥" -}; -var client = new DouyinShopClient(options); -``` - -### 请求 & 响应: - -```csharp -using SKIT.FlurlHttpClient.ByteDance.DouyinShop; -using SKIT.FlurlHttpClient.ByteDance.DouyinShop.Models; - -/* 以订单详情查询接口为例 */ -var request = new OrderDetailRequest() -{ - ShopOrderId = "店铺订单号" -}; -var response = await client.ExecuteOrderDetailAsync(request); -if (response.IsSuccessful()) -{ - Console.WriteLine("支付金额:" + response.Data.ShopOrder.PayAmount); - Console.WriteLine("支付时间:" + response.Data.ShopOrder.PayTimestamp); -} -else -{ - Console.WriteLine("错误代码:" + response.ErrorNumber); - Console.WriteLine("错误描述:" + response.ErrorMessage); -} -``` - ---- - -## 基础用法 - -- [如何快速找到需要调用的 API 模型类名 / 方法名?](./Basic_ModelDefinition.md) - -- [如何解析回调通知事件?](./Basic_EventDeserialization.md) - -- [如何验证回调通知事件签名?](./Basic_EventSignatureVerification.md) - -- [如何自定义额外的 API 接口?](./Basic_Extensions.md) - ---- - -## 高级技巧 - -- [如何在 ASP.NET Core 中与 `IHttpClientFactory` 集成?](./Advanced_IHttpClientFactory.md) - -- [如何指定 JSON 序列化器?](./Advanced_JsonSerializer.md) - -- [如何使用拦截器?](./Advanced_Interceptor.md) diff --git a/docs/TikTokGlobal/Basic_ModelDefinition.md b/docs/TikTokGlobal/Basic_ModelDefinition.md index f4cfa2e5..90985fa8 100644 --- a/docs/TikTokGlobal/Basic_ModelDefinition.md +++ b/docs/TikTokGlobal/Basic_ModelDefinition.md @@ -8,7 +8,7 @@ Naming Policies: --- -### API Functions +### APIs
diff --git a/docs/TikTokGlobalShop/Basic_ModelDefinition.md b/docs/TikTokGlobalShop/Basic_ModelDefinition.md index a9f7c18a..fbc16203 100644 --- a/docs/TikTokGlobalShop/Basic_ModelDefinition.md +++ b/docs/TikTokGlobalShop/Basic_ModelDefinition.md @@ -8,7 +8,7 @@ Naming Policies: --- -### API Functions +### APIs
diff --git a/docs/TikTokGlobalShop/README.md b/docs/TikTokGlobalShop/README.md index 1cd9c6c9..3cb6cca4 100644 --- a/docs/TikTokGlobalShop/README.md +++ b/docs/TikTokGlobalShop/README.md @@ -14,6 +14,9 @@ A HTTP API SDK for [TikTok Shop Open Platform](https://partner.tiktokshop.com/) ## Get Started +> [!IMPORTANT] +> The documents are applicable to version 3.x of this SDK. If you are using version 2.x, please move to the archived branches on GitHub/Gitee. + ### Installation: ```shell @@ -34,7 +37,7 @@ var options = new TikTokShopClientOptions() AppKey = "${APP_KEY}", AppSecret = "${APP_SECRET}}" }; -var client = new TikTokShopClient(options); +var client = new TikTokShopClientBuilder.Create(options).Build(); ``` ### Requests & Responses: diff --git a/src/SKIT.FlurlHttpClient.ByteDance.OceanEngine/OceanEngineException.cs b/src/SKIT.FlurlHttpClient.ByteDance.OceanEngine/OceanEngineException.cs index 32dd9419..a1058e5b 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.OceanEngine/OceanEngineException.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.OceanEngine/OceanEngineException.cs @@ -3,7 +3,7 @@ namespace SKIT.FlurlHttpClient.ByteDance.OceanEngine { /// - /// 调用巨量引擎开放平台 API 出错时引发的异常。 + /// 当调用巨量引擎开放平台 API 出错时引发的异常。 /// public class OceanEngineException : CommonException { From 2fa1e275d5099620a3be79a2a507b424c6f1ac2a Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 19:27:20 +0800 Subject: [PATCH 04/12] =?UTF-8?q?feat(tiktokshop):=20=E9=9A=8F=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E6=9B=B4=E6=96=B0=E5=95=86=E5=93=81=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GlobalProductGetAttributeListResponse.cs | 30 +++++- .../GlobalProductGetCategoryListResponse.cs | 7 ++ .../GlobalProductCreateProductRequest.cs | 94 +++++++++++++--- .../GlobalProductUpdateProductRequest.cs | 101 +++++++++++++++--- .../ProductGetCategoryListResponse.cs | 7 ++ .../Product/ProductCreateProductRequest.cs | 4 + .../Product/ProductSaveProductDraftRequest.cs | 97 ++++++++++++++--- .../ProductSaveProductDraftResponse.cs | 42 ++++++-- .../Product/ProductUpdateProductRequest.cs | 97 ++++++++++++++--- .../Product/ProductUpdateProductResponse.cs | 42 ++++++-- .../GlobalProductGetCategoryListResponse.json | 5 +- .../GlobalProductCreateProductRequest.json | 22 ++-- .../ProductGetCategoryListResponse.json | 5 +- .../Product/ProductCreateProductRequest.json | 10 +- 14 files changed, 474 insertions(+), 89 deletions(-) diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetAttributeListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetAttributeListResponse.cs index 3ac85860..6a030139 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetAttributeListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetAttributeListResponse.cs @@ -11,9 +11,9 @@ public class Data { public static class Types { - public class Attribute : ProductGetAttributeListResponse.Types.Data.Types.Attribute + public class Attribute { - public static new class Types + public static class Types { public class IntputSettings : ProductGetAttributeListResponse.Types.Data.Types.Attribute.Types.IntputSettings { @@ -30,19 +30,41 @@ public class AttributeValue : ProductGetAttributeListResponse.Types.Data.Types.A } } + /// + /// 获取或设置属性 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string AttributeId { get; set; } = default!; + + /// + /// 获取或设置属性名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string AttributeName { get; set; } = default!; + + /// + /// 获取或设置属性类型。 + /// + [Newtonsoft.Json.JsonProperty("attribute_type")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_type")] + public int AttributeType { get; set; } + /// /// 获取或设置输入配置信息。 /// [Newtonsoft.Json.JsonProperty("input_type")] [System.Text.Json.Serialization.JsonPropertyName("input_type")] - public new Types.IntputSettings IntputSettings { get; set; } = default!; + public Types.IntputSettings IntputSettings { get; set; } = default!; /// /// 获取或设置属性值列表。 /// [Newtonsoft.Json.JsonProperty("values")] [System.Text.Json.Serialization.JsonPropertyName("values")] - public new Types.AttributeValue[] ValueList { get; set; } = default!; + public Types.AttributeValue[] ValueList { get; set; } = default!; } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetCategoryListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetCategoryListResponse.cs index 4b8bbe27..2a15468a 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetCategoryListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/Category/GlobalProductGetCategoryListResponse.cs @@ -42,6 +42,13 @@ public class Category [Newtonsoft.Json.JsonProperty("is_leaf")] [System.Text.Json.Serialization.JsonPropertyName("is_leaf")] public bool IsLeaf { get; set; } + + /// + /// 获取或设置状态列表。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public int[] StatusList { get; set; } = default!; } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductCreateProductRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductCreateProductRequest.cs index a6e667d6..4255d77d 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductCreateProductRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductCreateProductRequest.cs @@ -27,26 +27,73 @@ public class GlobalSKU { public static class Types { - public class SalesAttribute : ProductCreateProductRequest.Types.SKU.Types.SalesAttribute + public class SalesAttribute { - public static new class Types + public static class Types { - public class Image : GlobalProductCreateProductRequest.Types.Image + public class Image : ProductCreateProductRequest.Types.SKU.Types.SalesAttribute.Types.Image { } } + /// + /// 获取或设置属性 ID。 + /// + [Newtonsoft.Json.JsonProperty("attribute_id")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string AttributeId { get; set; } = string.Empty; + + /// + /// 获取或设置属性名称。 + /// + [Newtonsoft.Json.JsonProperty("attribute_name")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_name")] + public string? AttributeName { get; set; } + + /// + /// 获取或设置属性值 ID。 + /// + [Newtonsoft.Json.JsonProperty("value_id")] + [System.Text.Json.Serialization.JsonPropertyName("value_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string? ValueId { get; set; } + + /// + /// 获取或设置自定义属性值。 + /// + [Newtonsoft.Json.JsonProperty("custom_value")] + [System.Text.Json.Serialization.JsonPropertyName("custom_value")] + public string? CustomValue { get; set; } + /// /// 获取或设置图片信息。 /// [Newtonsoft.Json.JsonProperty("sku_img")] [System.Text.Json.Serialization.JsonPropertyName("sku_img")] - public new Types.Image? Image { get; set; } + public Types.Image? Image { get; set; } } public class IdentifierCodeInfo : ProductCreateProductRequest.Types.SKU.Types.IdentifierCodeInfo { } + + public class StockInfo + { + /// + /// 获取或设置仓库 ID。 + /// + [Newtonsoft.Json.JsonProperty("warehouse_id")] + [System.Text.Json.Serialization.JsonPropertyName("warehouse_id")] + public string WarehouseId { get; set; } = string.Empty; + + /// + /// 获取或设置可用库存。 + /// + [Newtonsoft.Json.JsonProperty("available_stock")] + [System.Text.Json.Serialization.JsonPropertyName("available_stock")] + public int AvailableStock { get; set; } + } } /// @@ -77,6 +124,13 @@ public class IdentifierCodeInfo : ProductCreateProductRequest.Types.SKU.Types.Id [System.Text.Json.Serialization.JsonPropertyName("sales_attributes")] public IList? SalesAttributeList { get; set; } + /// + /// 获取或设置库存信息列表。 + /// + [Newtonsoft.Json.JsonProperty("stock_infos")] + [System.Text.Json.Serialization.JsonPropertyName("stock_infos")] + public IList? StockInfoList { get; set; } + /// /// 获取或设置产品标识码信息。 /// @@ -85,28 +139,35 @@ public class IdentifierCodeInfo : ProductCreateProductRequest.Types.SKU.Types.Id public Types.IdentifierCodeInfo? IdentifierCodeInfo { get; set; } } - public class ProductAttribute : ProductCreateProductRequest.Types.ProductAttribute + public class ProductAttribute { - public static new class Types + public static class Types { public class ProductAttributeValue : ProductCreateProductRequest.Types.ProductAttribute.Types.ProductAttributeValue { } } + /// + /// 获取或设置属性 ID。 + /// + [Newtonsoft.Json.JsonProperty("attribute_id")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] + public string AttributeId { get; set; } = string.Empty; + /// /// 获取或设置属性值列表。 /// [Newtonsoft.Json.JsonProperty("attribute_values")] [System.Text.Json.Serialization.JsonPropertyName("attribute_values")] - public new IList ValueList { get; set; } = new List(); + public IList ValueList { get; set; } = new List(); } - public class ProductCertification : ProductCreateProductRequest.Types.ProductCertification + public class ProductCertification { - public static new class Types + public static class Types { - public class Image : GlobalProductCreateProductRequest.Types.Image + public class Image : ProductCreateProductRequest.Types.ProductCertification.Types.Image { } @@ -115,19 +176,27 @@ public class File : ProductCreateProductRequest.Types.ProductCertification.Types } } + /// + /// 获取或设置商品认证 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string CertificationId { get; set; } = string.Empty; + /// /// 获取或设置图片列表。 /// [Newtonsoft.Json.JsonProperty("images")] [System.Text.Json.Serialization.JsonPropertyName("images")] - public new IList? ImageList { get; set; } + public IList? ImageList { get; set; } /// /// 获取或设置文件列表。 /// [Newtonsoft.Json.JsonProperty("files")] [System.Text.Json.Serialization.JsonPropertyName("files")] - public new IList? FileList { get; set; } + public IList? FileList { get; set; } } public class ExemptionOfIdentifierCode @@ -160,6 +229,7 @@ public class ExemptionOfIdentifierCode /// [Newtonsoft.Json.JsonProperty("category_id")] [System.Text.Json.Serialization.JsonPropertyName("category_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] public string CategoryId { get; set; } = string.Empty; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductRequest.cs index 1fe668eb..5adb084a 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductUpdateProductRequest.cs @@ -17,9 +17,9 @@ public class SizeChart : GlobalProductCreateProductRequest.Types.SizeChart { } - public class ProductCertification : GlobalProductCreateProductRequest.Types.ProductCertification + public class ProductCertification { - public static new class Types + public static class Types { public class Image : GlobalProductCreateProductRequest.Types.ProductCertification.Types.Image { @@ -30,45 +30,87 @@ public class File : GlobalProductCreateProductRequest.Types.ProductCertification } } + /// + /// 获取或设置商品认证 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string CertificationId { get; set; } = string.Empty; + /// /// 获取或设置图片列表。 /// [Newtonsoft.Json.JsonProperty("images")] [System.Text.Json.Serialization.JsonPropertyName("images")] - public new IList? ImageList { get; set; } + public IList? ImageList { get; set; } /// /// 获取或设置文件列表。 /// [Newtonsoft.Json.JsonProperty("files")] [System.Text.Json.Serialization.JsonPropertyName("files")] - public new IList? FileList { get; set; } + public IList? FileList { get; set; } } - public class GlobalSKU : GlobalProductCreateProductRequest.Types.GlobalSKU + public class GlobalSKU { - public static new class Types + public static class Types { - public class SalesAttribute : GlobalProductCreateProductRequest.Types.GlobalSKU.Types.SalesAttribute + public class SalesAttribute { - public static new class Types + public static class Types { public class Image : GlobalProductCreateProductRequest.Types.GlobalSKU.Types.SalesAttribute.Types.Image { } } + /// + /// 获取或设置属性 ID。 + /// + [Newtonsoft.Json.JsonProperty("attribute_id")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string AttributeId { get; set; } = string.Empty; + + /// + /// 获取或设置属性名称。 + /// + [Newtonsoft.Json.JsonProperty("attribute_name")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_name")] + public string? AttributeName { get; set; } + + /// + /// 获取或设置属性值 ID。 + /// + [Newtonsoft.Json.JsonProperty("value_id")] + [System.Text.Json.Serialization.JsonPropertyName("value_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string? ValueId { get; set; } + + /// + /// 获取或设置自定义属性值。 + /// + [Newtonsoft.Json.JsonProperty("custom_value")] + [System.Text.Json.Serialization.JsonPropertyName("custom_value")] + public string? CustomValue { get; set; } + /// /// 获取或设置图片信息。 /// [Newtonsoft.Json.JsonProperty("sku_img")] [System.Text.Json.Serialization.JsonPropertyName("sku_img")] - public new Types.Image? Image { get; set; } + public Types.Image? Image { get; set; } } public class IdentifierCodeInfo : GlobalProductCreateProductRequest.Types.GlobalSKU.Types.IdentifierCodeInfo { } + + public class StockInfo : GlobalProductCreateProductRequest.Types.GlobalSKU.Types.StockInfo + { + } } /// @@ -78,43 +120,71 @@ public class IdentifierCodeInfo : GlobalProductCreateProductRequest.Types.Global [System.Text.Json.Serialization.JsonPropertyName("id")] public string? GlobalSKUId { get; set; } + /// + /// 获取或设置卖家 SKU 信息。 + /// + [Newtonsoft.Json.JsonProperty("seller_sku")] + [System.Text.Json.Serialization.JsonPropertyName("seller_sku")] + public string? SellerSKU { get; set; } + /// /// 获取或设置原价。 /// [Newtonsoft.Json.JsonProperty("sku_price")] [System.Text.Json.Serialization.JsonPropertyName("sku_price")] - public new decimal OriginalPrice { get { return base.OriginalPrice; } set { base.OriginalPrice = value; } } + public decimal OriginalPrice { get; set; } + + /// + /// 获取或设置可用库存。 + /// + [Newtonsoft.Json.JsonProperty("available_stock")] + [System.Text.Json.Serialization.JsonPropertyName("available_stock")] + public int AvailableStock { get; set; } /// /// 获取或设置销售属性列表。 /// [Newtonsoft.Json.JsonProperty("sales_attributes")] [System.Text.Json.Serialization.JsonPropertyName("sales_attributes")] - public new IList? SalesAttributeList { get; set; } + public IList? SalesAttributeList { get; set; } + + /// + /// 获取或设置库存信息列表。 + /// + [Newtonsoft.Json.JsonProperty("stock_infos")] + [System.Text.Json.Serialization.JsonPropertyName("stock_infos")] + public IList? StockInfoList { get; set; } /// /// 获取或设置产品标识码信息。 /// [Newtonsoft.Json.JsonProperty("product_identifier_code")] [System.Text.Json.Serialization.JsonPropertyName("product_identifier_code")] - public new Types.IdentifierCodeInfo? IdentifierCodeInfo { get; set; } + public Types.IdentifierCodeInfo? IdentifierCodeInfo { get; set; } } - public class ProductAttribute : GlobalProductCreateProductRequest.Types.ProductAttribute + public class ProductAttribute { - public static new class Types + public static class Types { public class ProductAttributeValue : GlobalProductCreateProductRequest.Types.ProductAttribute.Types.ProductAttributeValue { } } + /// + /// 获取或设置属性 ID。 + /// + [Newtonsoft.Json.JsonProperty("attribute_id")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] + public string AttributeId { get; set; } = string.Empty; + /// /// 获取或设置属性值列表。 /// [Newtonsoft.Json.JsonProperty("attribute_values")] [System.Text.Json.Serialization.JsonPropertyName("attribute_values")] - public new IList ValueList { get; set; } = new List(); + public IList ValueList { get; set; } = new List(); } public class ExemptionOfIdentifierCode : GlobalProductCreateProductRequest.Types.ExemptionOfIdentifierCode @@ -148,6 +218,7 @@ public class ExemptionOfIdentifierCode : GlobalProductCreateProductRequest.Types /// [Newtonsoft.Json.JsonProperty("category_id")] [System.Text.Json.Serialization.JsonPropertyName("category_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] public string CategoryId { get; set; } = string.Empty; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListResponse.cs index be23383c..734f9551 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListResponse.cs @@ -42,6 +42,13 @@ public class Category [Newtonsoft.Json.JsonProperty("is_leaf")] [System.Text.Json.Serialization.JsonPropertyName("is_leaf")] public bool IsLeaf { get; set; } + + /// + /// 获取或设置状态列表。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public int[] StatusList { get; set; } = default!; } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductCreateProductRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductCreateProductRequest.cs index b5c8858a..63139674 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductCreateProductRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductCreateProductRequest.cs @@ -57,6 +57,7 @@ public class Image : ProductCreateProductRequest.Types.Image /// [Newtonsoft.Json.JsonProperty("attribute_id")] [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] public string AttributeId { get; set; } = string.Empty; /// @@ -71,6 +72,7 @@ public class Image : ProductCreateProductRequest.Types.Image /// [Newtonsoft.Json.JsonProperty("value_id")] [System.Text.Json.Serialization.JsonPropertyName("value_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] public string? ValueId { get; set; } /// @@ -204,6 +206,7 @@ public class File /// [Newtonsoft.Json.JsonProperty("id")] [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] public string CertificationId { get; set; } = string.Empty; /// @@ -295,6 +298,7 @@ public class ExemptionOfIdentifierCode /// [Newtonsoft.Json.JsonProperty("category_id")] [System.Text.Json.Serialization.JsonPropertyName("category_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] public string CategoryId { get; set; } = string.Empty; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSaveProductDraftRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSaveProductDraftRequest.cs index 1b7b19f9..8cbd957b 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSaveProductDraftRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSaveProductDraftRequest.cs @@ -21,9 +21,9 @@ public class SizeChart : ProductCreateProductRequest.Types.SizeChart { } - public class ProductCertification : ProductCreateProductRequest.Types.ProductCertification + public class ProductCertification { - public static new class Types + public static class Types { public class Image : ProductCreateProductRequest.Types.ProductCertification.Types.Image { @@ -34,40 +34,78 @@ public class File : ProductCreateProductRequest.Types.ProductCertification.Types } } + /// + /// 获取或设置商品认证 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string CertificationId { get; set; } = string.Empty; + /// /// 获取或设置图片列表。 /// [Newtonsoft.Json.JsonProperty("images")] [System.Text.Json.Serialization.JsonPropertyName("images")] - public new IList? ImageList { get; set; } + public IList? ImageList { get; set; } /// /// 获取或设置文件列表。 /// [Newtonsoft.Json.JsonProperty("files")] [System.Text.Json.Serialization.JsonPropertyName("files")] - public new IList? FileList { get; set; } + public IList? FileList { get; set; } } - public class SKU : ProductCreateProductRequest.Types.SKU + public class SKU { - public static new class Types + public static class Types { - public class SalesAttribute : ProductCreateProductRequest.Types.SKU.Types.SalesAttribute + public class SalesAttribute { - public static new class Types + public static class Types { public class Image : ProductCreateProductRequest.Types.SKU.Types.SalesAttribute.Types.Image { } } + /// + /// 获取或设置属性 ID。 + /// + [Newtonsoft.Json.JsonProperty("attribute_id")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string AttributeId { get; set; } = string.Empty; + + /// + /// 获取或设置属性名称。 + /// + [Newtonsoft.Json.JsonProperty("attribute_name")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_name")] + public string? AttributeName { get; set; } + + /// + /// 获取或设置属性值 ID。 + /// + [Newtonsoft.Json.JsonProperty("value_id")] + [System.Text.Json.Serialization.JsonPropertyName("value_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string? ValueId { get; set; } + + /// + /// 获取或设置自定义属性值。 + /// + [Newtonsoft.Json.JsonProperty("custom_value")] + [System.Text.Json.Serialization.JsonPropertyName("custom_value")] + public string? CustomValue { get; set; } + /// /// 获取或设置图片信息。 /// [Newtonsoft.Json.JsonProperty("sku_img")] [System.Text.Json.Serialization.JsonPropertyName("sku_img")] - public new Types.Image? Image { get; set; } + public Types.Image? Image { get; set; } } public class StockInfo : ProductCreateProductRequest.Types.SKU.Types.StockInfo @@ -86,43 +124,71 @@ public class IdentifierCodeInfo : ProductCreateProductRequest.Types.SKU.Types.Id [System.Text.Json.Serialization.JsonPropertyName("id")] public string? SKUId { get; set; } + /// + /// 获取或设置外部 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("outer_sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("outer_sku_id")] + public string? OuterSKUId { get; set; } + /// /// 获取或设置销售属性列表。 /// [Newtonsoft.Json.JsonProperty("sales_attributes")] [System.Text.Json.Serialization.JsonPropertyName("sales_attributes")] - public new IList? SalesAttributeList { get; set; } + public IList? SalesAttributeList { get; set; } /// /// 获取或设置库存信息列表。 /// [Newtonsoft.Json.JsonProperty("stock_infos")] [System.Text.Json.Serialization.JsonPropertyName("stock_infos")] - public new IList? StockInfoList { get; set; } + public IList? StockInfoList { get; set; } + + /// + /// 获取或设置卖家 SKU 信息。 + /// + [Newtonsoft.Json.JsonProperty("seller_sku")] + [System.Text.Json.Serialization.JsonPropertyName("seller_sku")] + public string? SellerSKU { get; set; } + + /// + /// 获取或设置原价。 + /// + [Newtonsoft.Json.JsonProperty("original_price")] + [System.Text.Json.Serialization.JsonPropertyName("original_price")] + public decimal OriginalPrice { get; set; } /// /// 获取或设置产品标识码信息。 /// [Newtonsoft.Json.JsonProperty("product_identifier_code")] [System.Text.Json.Serialization.JsonPropertyName("product_identifier_code")] - public new Types.IdentifierCodeInfo? IdentifierCodeInfo { get; set; } + public Types.IdentifierCodeInfo? IdentifierCodeInfo { get; set; } } - public class ProductAttribute : ProductCreateProductRequest.Types.ProductAttribute + public class ProductAttribute { - public static new class Types + public static class Types { public class ProductAttributeValue : ProductCreateProductRequest.Types.ProductAttribute.Types.ProductAttributeValue { } } + /// + /// 获取或设置属性 ID。 + /// + [Newtonsoft.Json.JsonProperty("attribute_id")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] + public string AttributeId { get; set; } = string.Empty; + /// /// 获取或设置属性值列表。 /// [Newtonsoft.Json.JsonProperty("attribute_values")] [System.Text.Json.Serialization.JsonPropertyName("attribute_values")] - public new IList ValueList { get; set; } = new List(); + public IList ValueList { get; set; } = new List(); } public class ExemptionOfIdentifierCode : ProductCreateProductRequest.Types.ExemptionOfIdentifierCode @@ -163,6 +229,7 @@ public class ExemptionOfIdentifierCode : ProductCreateProductRequest.Types.Exemp /// [Newtonsoft.Json.JsonProperty("category_id")] [System.Text.Json.Serialization.JsonPropertyName("category_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] public string CategoryId { get; set; } = string.Empty; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSaveProductDraftResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSaveProductDraftResponse.cs index 38cf8145..9a2d8f9b 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSaveProductDraftResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductSaveProductDraftResponse.cs @@ -7,34 +7,64 @@ public class ProductSaveProductDraftResponse : TikTokShopResponse + /// 获取或设置外部 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("outer_sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("outer_sku_id")] + public string? OuterSKUId { get; set; } + + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string SKUId { get; set; } = default!; + + /// + /// 获取或设置卖家 SKU 信息。 + /// + [Newtonsoft.Json.JsonProperty("seller_sku")] + [System.Text.Json.Serialization.JsonPropertyName("seller_sku")] + public string? SellerSKU { get; set; } + /// /// 获取或设置销售属性列表。 /// [Newtonsoft.Json.JsonProperty("sales_attributes")] [System.Text.Json.Serialization.JsonPropertyName("sales_attributes")] - public new Types.SalesAttribute[] SalesAttributeList { get; set; } = default!; + public Types.SalesAttribute[] SalesAttributeList { get; set; } = default!; } } + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string ProductId { get; set; } = default!; + /// /// 获取或设置 SKU 列表。 /// [Newtonsoft.Json.JsonProperty("skus")] [System.Text.Json.Serialization.JsonPropertyName("skus")] - public new Types.SKU[] SKUList { get; set; } = default!; + public Types.SKU[] SKUList { get; set; } = default!; } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductRequest.cs index bcd20e01..5144d68a 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductRequest.cs @@ -21,25 +21,55 @@ public class SizeChart : ProductCreateProductRequest.Types.SizeChart { } - public class SKU : ProductCreateProductRequest.Types.SKU + public class SKU { - public static new class Types + public static class Types { - public class SalesAttribute : ProductCreateProductRequest.Types.SKU.Types.SalesAttribute + public class SalesAttribute { - public static new class Types + public static class Types { public class Image : ProductCreateProductRequest.Types.SKU.Types.SalesAttribute.Types.Image { } } + /// + /// 获取或设置属性 ID。 + /// + [Newtonsoft.Json.JsonProperty("attribute_id")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string AttributeId { get; set; } = string.Empty; + + /// + /// 获取或设置属性名称。 + /// + [Newtonsoft.Json.JsonProperty("attribute_name")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_name")] + public string? AttributeName { get; set; } + + /// + /// 获取或设置属性值 ID。 + /// + [Newtonsoft.Json.JsonProperty("value_id")] + [System.Text.Json.Serialization.JsonPropertyName("value_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string? ValueId { get; set; } + + /// + /// 获取或设置自定义属性值。 + /// + [Newtonsoft.Json.JsonProperty("custom_value")] + [System.Text.Json.Serialization.JsonPropertyName("custom_value")] + public string? CustomValue { get; set; } + /// /// 获取或设置图片信息。 /// [Newtonsoft.Json.JsonProperty("sku_img")] [System.Text.Json.Serialization.JsonPropertyName("sku_img")] - public new Types.Image? Image { get; set; } + public Types.Image? Image { get; set; } } public class StockInfo : ProductCreateProductRequest.Types.SKU.Types.StockInfo @@ -58,31 +88,52 @@ public class IdentifierCodeInfo : ProductCreateProductRequest.Types.SKU.Types.Id [System.Text.Json.Serialization.JsonPropertyName("id")] public string? SKUId { get; set; } + /// + /// 获取或设置外部 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("outer_sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("outer_sku_id")] + public string? OuterSKUId { get; set; } + /// /// 获取或设置销售属性列表。 /// [Newtonsoft.Json.JsonProperty("sales_attributes")] [System.Text.Json.Serialization.JsonPropertyName("sales_attributes")] - public new IList? SalesAttributeList { get; set; } + public IList? SalesAttributeList { get; set; } /// /// 获取或设置库存信息列表。 /// [Newtonsoft.Json.JsonProperty("stock_infos")] [System.Text.Json.Serialization.JsonPropertyName("stock_infos")] - public new IList? StockInfoList { get; set; } + public IList? StockInfoList { get; set; } + + /// + /// 获取或设置卖家 SKU 信息。 + /// + [Newtonsoft.Json.JsonProperty("seller_sku")] + [System.Text.Json.Serialization.JsonPropertyName("seller_sku")] + public string? SellerSKU { get; set; } + + /// + /// 获取或设置原价。 + /// + [Newtonsoft.Json.JsonProperty("original_price")] + [System.Text.Json.Serialization.JsonPropertyName("original_price")] + public decimal OriginalPrice { get; set; } /// /// 获取或设置产品标识码信息。 /// [Newtonsoft.Json.JsonProperty("product_identifier_code")] [System.Text.Json.Serialization.JsonPropertyName("product_identifier_code")] - public new Types.IdentifierCodeInfo? IdentifierCodeInfo { get; set; } + public Types.IdentifierCodeInfo? IdentifierCodeInfo { get; set; } } - public class ProductCertification : ProductCreateProductRequest.Types.ProductCertification + public class ProductCertification { - public static new class Types + public static class Types { public class Image : ProductCreateProductRequest.Types.ProductCertification.Types.Image { @@ -93,36 +144,51 @@ public class File : ProductCreateProductRequest.Types.ProductCertification.Types } } + /// + /// 获取或设置商品认证 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] + public string CertificationId { get; set; } = string.Empty; + /// /// 获取或设置图片列表。 /// [Newtonsoft.Json.JsonProperty("images")] [System.Text.Json.Serialization.JsonPropertyName("images")] - public new IList? ImageList { get; set; } + public IList? ImageList { get; set; } /// /// 获取或设置文件列表。 /// [Newtonsoft.Json.JsonProperty("files")] [System.Text.Json.Serialization.JsonPropertyName("files")] - public new IList? FileList { get; set; } + public IList? FileList { get; set; } } - public class ProductAttribute : ProductCreateProductRequest.Types.ProductAttribute + public class ProductAttribute { - public static new class Types + public static class Types { public class ProductAttributeValue : ProductCreateProductRequest.Types.ProductAttribute.Types.ProductAttributeValue { } } + /// + /// 获取或设置属性 ID。 + /// + [Newtonsoft.Json.JsonProperty("attribute_id")] + [System.Text.Json.Serialization.JsonPropertyName("attribute_id")] + public string AttributeId { get; set; } = string.Empty; + /// /// 获取或设置属性值列表。 /// [Newtonsoft.Json.JsonProperty("attribute_values")] [System.Text.Json.Serialization.JsonPropertyName("attribute_values")] - public new IList ValueList { get; set; } = new List(); + public IList ValueList { get; set; } = new List(); } public class ExemptionOfIdentifierCode : ProductCreateProductRequest.Types.ExemptionOfIdentifierCode @@ -163,6 +229,7 @@ public class ExemptionOfIdentifierCode : ProductCreateProductRequest.Types.Exemp /// [Newtonsoft.Json.JsonProperty("category_id")] [System.Text.Json.Serialization.JsonPropertyName("category_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringConverter))] public string CategoryId { get; set; } = string.Empty; /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductResponse.cs index 3eb8efc5..6f7eface 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductUpdateProductResponse.cs @@ -7,34 +7,64 @@ public class ProductUpdateProductResponse : TikTokShopResponse + /// 获取或设置外部 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("outer_sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("outer_sku_id")] + public string? OuterSKUId { get; set; } + + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string SKUId { get; set; } = default!; + + /// + /// 获取或设置卖家 SKU 信息。 + /// + [Newtonsoft.Json.JsonProperty("seller_sku")] + [System.Text.Json.Serialization.JsonPropertyName("seller_sku")] + public string? SellerSKU { get; set; } + /// /// 获取或设置销售属性列表。 /// [Newtonsoft.Json.JsonProperty("sales_attributes")] [System.Text.Json.Serialization.JsonPropertyName("sales_attributes")] - public new Types.SalesAttribute[] SalesAttributeList { get; set; } = default!; + public Types.SalesAttribute[] SalesAttributeList { get; set; } = default!; } } + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string ProductId { get; set; } = default!; + /// /// 获取或设置 SKU 列表。 /// [Newtonsoft.Json.JsonProperty("skus")] [System.Text.Json.Serialization.JsonPropertyName("skus")] - public new Types.SKU[] SKUList { get; set; } = default!; + public Types.SKU[] SKUList { get; set; } = default!; } } } diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/Category/GlobalProductGetCategoryListResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/Category/GlobalProductGetCategoryListResponse.json index 73be1cb3..b0db1a38 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/Category/GlobalProductGetCategoryListResponse.json +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/Category/GlobalProductGetCategoryListResponse.json @@ -6,7 +6,10 @@ "category_name": "Home Supplies", "id": 600001, "is_leaf": false, - "parent_id": 0 + "parent_id": 0, + "status": [ + 1 + ] } ] }, diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/GlobalProductCreateProductRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/GlobalProductCreateProductRequest.json index da94bab8..73711f71 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/GlobalProductCreateProductRequest.json +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/GlobalProductCreateProductRequest.json @@ -1,5 +1,5 @@ { - "category_id": "600001", + "category_id": 600001, "description": "

test

", "exemption_of_identifier_code": { "exemption_reason": "1" @@ -33,7 +33,7 @@ "type": "PDF" } ], - "id": "123456", + "id": 123456, "images": [ { "id": "tos-maliva-i-o3syd03w52-us/c668cdf70b7f483c94dbe" @@ -48,25 +48,29 @@ "skus": [ { "available_stock": 9999, - "original_price": 999, + "original_price": "999", "product_identifier_code": { "identifier_code": "12345678901234", "identifier_code_type": 1 }, "sales_attributes": [ { - "attribute_id": "100089", + "attribute_id": 100089, "attribute_name": "Specification", "custom_value": "XL", "sku_img": { "id": "tos-maliva-i-o3syd03w52-us/c668cdf70b7f483c94dbe" }, - "value_id": "1729592969712207000" + "value_id": 1729592969712207000 } ], - "seller_sku": "seller sku xxaa" + "seller_sku": "seller sku xxaa", + "stock_infos": [ + { + "available_stock": 100, + "warehouse_id": "6966568648651605766" + } + ] } - ], - "warranty_period": 1, - "warranty_policy": "warranty policy xxaa" + ] } diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/Category/ProductGetCategoryListResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/Category/ProductGetCategoryListResponse.json index bf1d35e1..8adb94a5 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/Category/ProductGetCategoryListResponse.json +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/Category/ProductGetCategoryListResponse.json @@ -6,7 +6,10 @@ "id": "600001", "is_leaf": false, "local_display_name": "Home Supplies", - "parent_id": "0" + "parent_id": "0", + "status": [ + 1 + ] } ] }, diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductCreateProductRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductCreateProductRequest.json index 6afd22a8..f25e1b83 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductCreateProductRequest.json +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductCreateProductRequest.json @@ -1,8 +1,10 @@ { "brand_id": "7082427311584347905", "category_id": "600001", - "delivery_service_ids": [ "1729592969712203232" ], - "description": "

test

", + "delivery_service_ids": [ + "1729592969712203232" + ], + "description": "\\test\\<\\/p\\>", "exemption_of_identifier_code": { "exemption_reason": "1" }, @@ -80,7 +82,5 @@ } ] } - ], - "warranty_period": 1, - "warranty_policy": "warranty policy xxaa" + ] } From b9e81fda55c6ba1554726ac614c3a5239e4525d2 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 19:35:41 +0800 Subject: [PATCH 05/12] =?UTF-8?q?feat(tiktokshop):=20=E9=9A=8F=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/Order/OrderSearchOrdersRequest.cs | 7 +++++++ .../ModelSamples/Order/OrderSearchOrdersRequest.json | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderSearchOrdersRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderSearchOrdersRequest.cs index f7ade7ee..8360f677 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderSearchOrdersRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderSearchOrdersRequest.cs @@ -47,6 +47,13 @@ public class OrderSearchOrdersRequest : TikTokShopRequest [System.Text.Json.Serialization.JsonPropertyName("delivery_option_type")] public int? DeliveryOptionType { get; set; } + /// + /// 获取或设置买家用户 ID。 + /// + [Newtonsoft.Json.JsonProperty("buyer_uid")] + [System.Text.Json.Serialization.JsonPropertyName("buyer_uid")] + public string? BuyerUserId { get; set; } + /// /// 获取或设置排序字段。 /// diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Order/OrderSearchOrdersRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Order/OrderSearchOrdersRequest.json index b0115a34..8e42028c 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Order/OrderSearchOrdersRequest.json +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Order/OrderSearchOrdersRequest.json @@ -1,8 +1,9 @@ { + "buyer_uid": "7213489962827123654", "create_time_from": 1623812664, "create_time_to": 1623812664, "cursor": "6AsPQsUMvH3RkchNUPPh22NROHkE0D8pmq/N5M1kHYcZmtRyv9aVrNv65W7Q6tFA+7D1ud64MPNz5OaT", - "delivery_option_type": null, + "delivery_option_type": 1, "order_status": 100, "page_size": 20, "sort_by": "CREATE_TIME", From bdf079620aaeb131e9cf239139ad4876224b5ede Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 20:27:46 +0800 Subject: [PATCH 06/12] =?UTF-8?q?feat(tiktokshop):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=20"shop?= =?UTF-8?q?=5Fcipher"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TikTokShopClientExecuteAuthExtensions.cs | 8 ++--- ...hopClientExecuteGlobalProductExtensions.cs | 30 ++++++++++++------- .../TikTokShopClient.cs | 1 + .../TikTokShopRequest.cs | 7 +++++ 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs index daf57992..99d10954 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs @@ -28,11 +28,11 @@ public static class TikTokShopClientExecuteAuthExtensions IFlurlRequest flurlReq = client .CreateFlurlRequest(request, HttpMethod.Get, "token", "get") .WithUrl($"{client.EndpointForAuth}/token/get") - .RemoveQueryParams("app_key", "access_token", "timestamp", "shop_id", "version") .SetQueryParam("app_key", client.Credentials.AppKey) .SetQueryParam("app_secret", client.Credentials.AppSecret) .SetQueryParam("grant_type", request.GrantType) - .SetQueryParam("auth_code", request.AuthorizedCode); + .SetQueryParam("auth_code", request.AuthorizedCode) + .RemoveQueryParams("app_key", "access_token", "timestamp", "shop_id", "version"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -57,11 +57,11 @@ public static class TikTokShopClientExecuteAuthExtensions IFlurlRequest flurlReq = client .CreateFlurlRequest(request, HttpMethod.Get, "token", "refresh") .WithUrl($"{client.EndpointForAuth}/token/refresh") - .RemoveQueryParams("app_key", "access_token", "timestamp", "shop_id", "version") .SetQueryParam("app_key", client.Credentials.AppKey) .SetQueryParam("app_secret", client.Credentials.AppSecret) .SetQueryParam("grant_type", request.GrantType) - .SetQueryParam("refresh_token", request.RefreshToken); + .SetQueryParam("refresh_token", request.RefreshToken) + .RemoveQueryParams("app_key", "access_token", "timestamp", "shop_id", "version"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteGlobalProductExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteGlobalProductExtensions.cs index 977970f6..ece7cbbd 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteGlobalProductExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteGlobalProductExtensions.cs @@ -26,7 +26,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateFlurlRequest(request, HttpMethod.Post, "product", "global_products", "search"); + .CreateFlurlRequest(request, HttpMethod.Post, "product", "global_products", "search") + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -49,7 +50,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions IFlurlRequest flurlReq = client .CreateFlurlRequest(request, HttpMethod.Get, "product", "global_products") - .SetQueryParam("product_id", request.GlobalProductId); + .SetQueryParam("product_id", request.GlobalProductId) + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -71,7 +73,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateFlurlRequest(request, HttpMethod.Post, "product", "global_products"); + .CreateFlurlRequest(request, HttpMethod.Post, "product", "global_products") + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -93,7 +96,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateFlurlRequest(request, HttpMethod.Put, "product", "global_products"); + .CreateFlurlRequest(request, HttpMethod.Put, "product", "global_products") + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -115,7 +119,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateFlurlRequest(request, HttpMethod.Put, "product", "global_products", "prices"); + .CreateFlurlRequest(request, HttpMethod.Put, "product", "global_products", "prices") + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -137,7 +142,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateFlurlRequest(request, HttpMethod.Post, "product", "global_products", "publish"); + .CreateFlurlRequest(request, HttpMethod.Post, "product", "global_products", "publish") + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -159,7 +165,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateFlurlRequest(request, HttpMethod.Delete, "product", "global_products"); + .CreateFlurlRequest(request, HttpMethod.Delete, "product", "global_products") + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -182,7 +189,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions if (request is null) throw new ArgumentNullException(nameof(request)); IFlurlRequest flurlReq = client - .CreateFlurlRequest(request, HttpMethod.Get, "product", "global_products", "categories"); + .CreateFlurlRequest(request, HttpMethod.Get, "product", "global_products", "categories") + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -205,7 +213,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions IFlurlRequest flurlReq = client .CreateFlurlRequest(request, HttpMethod.Get, "product", "global_products", "attributes") - .SetQueryParam("category_id", request.CategoryId); + .SetQueryParam("category_id", request.CategoryId) + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -228,7 +237,8 @@ public static class TikTokShopClientExecuteGlobalProductExtensions IFlurlRequest flurlReq = client .CreateFlurlRequest(request, HttpMethod.Get, "product", "global_products", "categories", "rules") - .SetQueryParam("category_id", request.CategoryId); + .SetQueryParam("category_id", request.CategoryId) + .RemoveQueryParam("shop_cipher"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClient.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClient.cs index 975d5cc2..2ae8a129 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClient.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopClient.cs @@ -77,6 +77,7 @@ public IFlurlRequest CreateFlurlRequest(TikTokShopRequest request, HttpMethod ht .SetQueryParam("access_token", request.AccessToken) .SetQueryParam("timestamp", request.Timestamp) .SetQueryParam("shop_id", request.ShopId) + .SetQueryParam("shop_cipher", request.ShopCipher) .SetQueryParam("version", request.ApiVersion); } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs index c7df7a41..e5767ccc 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs @@ -26,6 +26,13 @@ public abstract class TikTokShopRequest : CommonRequestBase, ICommonRequest [System.Text.Json.Serialization.JsonIgnore] public virtual string? ShopId { get; set; } + /// + /// 获取或设置店铺密码。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public virtual string? ShopCipher { get; set; } + /// /// 获取或设置 API 版本号。 /// From 0985344393f0a7a3ab392e59234a0cf3cd6c3877 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 20:54:06 +0800 Subject: [PATCH 07/12] =?UTF-8?q?feat(tiktokshop):=20=E9=9A=8F=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Order/OrderGetOrderDetailResponse.cs | 327 +++++++----------- .../TikTokShopRequest.cs | 2 +- .../Order/OrderGetOrderDetailResponse.json | 238 +++---------- 3 files changed, 174 insertions(+), 393 deletions(-) diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailResponse.cs index 91fcc88b..d88cb102 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailResponse.cs @@ -48,6 +48,14 @@ public class PaymentInfo [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal ShippingFee { get; set; } + /// + /// 获取或设置运费税。 + /// + [Newtonsoft.Json.JsonProperty("shipping_fee_tax")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_tax")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingFeeTax { get; set; } + /// /// 获取或设置卖家优惠金额。 /// @@ -96,6 +104,14 @@ public class PaymentInfo [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal ShippingFeePlatformDiscount { get; set; } + /// + /// 获取或设置零售配送费。 + /// + [Newtonsoft.Json.JsonProperty("retail_delivery_fee")] + [System.Text.Json.Serialization.JsonPropertyName("retail_delivery_fee")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal RetailDeliveryFee { get; set; } + /// /// 获取或设置税费。 /// @@ -111,6 +127,14 @@ public class PaymentInfo [System.Text.Json.Serialization.JsonPropertyName("small_order_fee")] [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SmallOrderFee { get; set; } + + /// + /// 获取或设置商品税。 + /// + [Newtonsoft.Json.JsonProperty("product_taxes")] + [System.Text.Json.Serialization.JsonPropertyName("product_taxes")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ProductTaxes { get; set; } } public class RecipientAddress @@ -129,41 +153,6 @@ public class RecipientAddress [System.Text.Json.Serialization.JsonPropertyName("region_code")] public string RegionCode { get; set; } = default!; - /// - /// 获取或设置国家或地区。 - /// - [Newtonsoft.Json.JsonProperty("region")] - [System.Text.Json.Serialization.JsonPropertyName("region")] - public string Region { get; set; } = default!; - - /// - /// 获取或设置州/省。 - /// - [Newtonsoft.Json.JsonProperty("state")] - [System.Text.Json.Serialization.JsonPropertyName("state")] - public string State { get; set; } = default!; - - /// - /// 获取或设置市。 - /// - [Newtonsoft.Json.JsonProperty("city")] - [System.Text.Json.Serialization.JsonPropertyName("city")] - public string City { get; set; } = default!; - - /// - /// 获取或设置县。 - /// - [Newtonsoft.Json.JsonProperty("district")] - [System.Text.Json.Serialization.JsonPropertyName("district")] - public string District { get; set; } = default!; - - /// - /// 获取或设置镇。 - /// - [Newtonsoft.Json.JsonProperty("town")] - [System.Text.Json.Serialization.JsonPropertyName("town")] - public string Town { get; set; } = default!; - /// /// 获取或设置电话号码。 /// @@ -193,154 +182,32 @@ public class RecipientAddress public string AddressDetail { get; set; } = default!; /// - /// 获取或设置地址分行列表。 - /// - [Newtonsoft.Json.JsonProperty("address_line_list")] - [System.Text.Json.Serialization.JsonPropertyName("address_line_list")] - public string[] AddressLineList { get; set; } = default!; - } - - public class SKU - { - /// - /// 获取或设置商品 ID。 - /// - [Newtonsoft.Json.JsonProperty("product_id")] - [System.Text.Json.Serialization.JsonPropertyName("product_id")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] - public string ProductId { get; set; } = default!; - - /// - /// 获取或设置商品名称。 - /// - [Newtonsoft.Json.JsonProperty("product_name")] - [System.Text.Json.Serialization.JsonPropertyName("product_name")] - public string ProductName { get; set; } = default!; - - /// - /// 获取或设置 SKU ID。 - /// - [Newtonsoft.Json.JsonProperty("sku_id")] - [System.Text.Json.Serialization.JsonPropertyName("sku_id")] - public string SKUId { get; set; } = default!; - - /// - /// 获取或设置 SKU 名称。 - /// - [Newtonsoft.Json.JsonProperty("sku_name")] - [System.Text.Json.Serialization.JsonPropertyName("sku_name")] - public string SKUName { get; set; } = default!; - - /// - /// 获取或设置 SKU 类型。 - /// - [Newtonsoft.Json.JsonProperty("sku_type")] - [System.Text.Json.Serialization.JsonPropertyName("sku_type")] - public int SKUType { get; set; } - - /// - /// 获取或设置 SKU 图片 URL。 - /// - [Newtonsoft.Json.JsonProperty("sku_image")] - [System.Text.Json.Serialization.JsonPropertyName("sku_image")] - public string SKUImageUrl { get; set; } = default!; - - /// - /// 获取或设置数量。 - /// - [Newtonsoft.Json.JsonProperty("quantity")] - [System.Text.Json.Serialization.JsonPropertyName("quantity")] - public int Quantity { get; set; } - - /// - /// 获取或设置卖家 SKU 信息。 - /// - [Newtonsoft.Json.JsonProperty("seller_sku")] - [System.Text.Json.Serialization.JsonPropertyName("seller_sku")] - public string? SellerSKU { get; set; } - - /// - /// 获取或设置原价。 - /// - [Newtonsoft.Json.JsonProperty("sku_original_price")] - [System.Text.Json.Serialization.JsonPropertyName("sku_original_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] - public decimal OriginalPrice { get; set; } - - /// - /// 获取或设置售价。 + /// 获取或设置地址行 1。 /// - [Newtonsoft.Json.JsonProperty("sku_sale_price")] - [System.Text.Json.Serialization.JsonPropertyName("sku_sale_price")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] - public decimal SalePrice { get; set; } + [Newtonsoft.Json.JsonProperty("addressline1")] + [System.Text.Json.Serialization.JsonPropertyName("addressline1")] + public string? AddressLine1 { get; set; } /// - /// 获取或设置平台优惠金额。 + /// 获取或设置地址行 2。 /// - [Newtonsoft.Json.JsonProperty("sku_platform_discount")] - [System.Text.Json.Serialization.JsonPropertyName("sku_platform_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] - public decimal PlatformDiscount { get; set; } + [Newtonsoft.Json.JsonProperty("addressline2")] + [System.Text.Json.Serialization.JsonPropertyName("addressline2")] + public string? AddressLine2 { get; set; } /// - /// 获取或设置卖家优惠金额。 + /// 获取或设置地址行 3。 /// - [Newtonsoft.Json.JsonProperty("sku_seller_discount")] - [System.Text.Json.Serialization.JsonPropertyName("sku_seller_discount")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] - public decimal SellerDiscount { get; set; } + [Newtonsoft.Json.JsonProperty("addressline3")] + [System.Text.Json.Serialization.JsonPropertyName("addressline3")] + public string? AddressLine3 { get; set; } /// - /// 获取或设置平台优惠总金额。 + /// 获取或设置地址行 4。 /// - [Newtonsoft.Json.JsonProperty("sku_platform_discount_total")] - [System.Text.Json.Serialization.JsonPropertyName("sku_platform_discount_total")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] - public decimal TotalPlatformDiscount { get; set; } - - /// - /// 获取或设置小额订单费。 - /// - [Newtonsoft.Json.JsonProperty("sku_small_order_fee")] - [System.Text.Json.Serialization.JsonPropertyName("sku_small_order_fee")] - [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] - public decimal SmallOrderFee { get; set; } - - /// - /// 获取或设置显示状态。 - /// - [Newtonsoft.Json.JsonProperty("sku_display_status")] - [System.Text.Json.Serialization.JsonPropertyName("sku_display_status")] - public int DisplayStatus { get; set; } - - /// - /// 获取或设置取消状态。 - /// - [Newtonsoft.Json.JsonProperty("sku_ext_status")] - [System.Text.Json.Serialization.JsonPropertyName("sku_ext_status")] - public int CancelStatus { get; set; } - - /// - /// 获取或设置取消者。 - /// - [Newtonsoft.Json.JsonProperty("sku_cancel_user")] - [System.Text.Json.Serialization.JsonPropertyName("sku_cancel_user")] - public string? CancelUser { get; set; } - - /// - /// 获取或设置取消原因。 - /// - [Newtonsoft.Json.JsonProperty("sku_cancel_reason")] - [System.Text.Json.Serialization.JsonPropertyName("sku_cancel_reason")] - public string? CancelReason { get; set; } - - /// - /// 获取或设置准备发货时间戳。 - /// - [Newtonsoft.Json.JsonProperty("sku_rts_time")] - [System.Text.Json.Serialization.JsonPropertyName("sku_rts_time")] - public long? ReadyToShipTimestamp { get; set; } + [Newtonsoft.Json.JsonProperty("addressline4")] + [System.Text.Json.Serialization.JsonPropertyName("addressline4")] + public string? AddressLine4 { get; set; } } public class Package @@ -373,6 +240,27 @@ public class DistrictInfo public class OrderLine { + public static class Types + { + public class ItemTax + { + /// + /// 获取或设置税费类型。 + /// + [Newtonsoft.Json.JsonProperty("tax_type")] + [System.Text.Json.Serialization.JsonPropertyName("tax_type")] + public int TaxType { get; set; } + + /// + /// 获取或设置税费金额。 + /// + [Newtonsoft.Json.JsonProperty("tax_amount")] + [System.Text.Json.Serialization.JsonPropertyName("tax_amount")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal TaxAmount { get; set; } + } + } + /// /// 获取或设置订单行 ID。 /// @@ -470,6 +358,22 @@ public class OrderLine [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] public decimal SellerDiscount { get; set; } + /// + /// 获取或设置零售配送费。 + /// + [Newtonsoft.Json.JsonProperty("retail_delivery_fee")] + [System.Text.Json.Serialization.JsonPropertyName("retail_delivery_fee")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal RetailDeliveryFee { get; set; } + + /// + /// 获取或设置小额订单费。 + /// + [Newtonsoft.Json.JsonProperty("small_order_fee")] + [System.Text.Json.Serialization.JsonPropertyName("small_order_fee")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SmallOrderFee { get; set; } + /// /// 获取或设置显示状态。 /// @@ -477,13 +381,6 @@ public class OrderLine [System.Text.Json.Serialization.JsonPropertyName("display_status")] public int DisplayStatus { get; set; } - /// - /// 获取或设置取消状态。 - /// - [Newtonsoft.Json.JsonProperty("ext_status")] - [System.Text.Json.Serialization.JsonPropertyName("ext_status")] - public int CancelStatus { get; set; } - /// /// 获取或设置取消者。 /// @@ -547,16 +444,23 @@ public class OrderLine [Newtonsoft.Json.JsonProperty("package_freeze_status")] [System.Text.Json.Serialization.JsonPropertyName("package_freeze_status")] public int? PackageFreezeStatus { get; set; } + + /// + /// 获取或设置是否是礼品。 + /// + [Newtonsoft.Json.JsonProperty("is_gift")] + [System.Text.Json.Serialization.JsonPropertyName("is_gift")] + public bool IsGift { get; set; } + + /// + /// 获取或设置商品税费列表。 + /// + [Newtonsoft.Json.JsonProperty("item_tax")] + [System.Text.Json.Serialization.JsonPropertyName("item_tax")] + public Types.ItemTax[]? ItemTaxList { get; set; } } } - /// - /// 获取或设置订单子状态。 - /// - [Newtonsoft.Json.JsonProperty("ext_status")] - [System.Text.Json.Serialization.JsonPropertyName("ext_status")] - public int SubStatus { get; set; } - /// /// 获取或设置支付方式。 /// @@ -585,13 +489,6 @@ public class OrderLine [System.Text.Json.Serialization.JsonPropertyName("payment_info")] public Types.PaymentInfo PaymentInfo { get; set; } = default!; - /// - /// 获取或设置 SKU 列表。 - /// - [Newtonsoft.Json.JsonProperty("item_list")] - [System.Text.Json.Serialization.JsonPropertyName("item_list")] - public Types.SKU[] SKUList { get; set; } = default!; - /// /// 获取或设置配送方式。 /// @@ -655,6 +552,13 @@ public class OrderLine [System.Text.Json.Serialization.JsonPropertyName("buyer_message")] public string? BuyerMessage { get; set; } + /// + /// 获取或设置买家匿名邮箱。 + /// + [Newtonsoft.Json.JsonProperty("buyer_email")] + [System.Text.Json.Serialization.JsonPropertyName("buyer_email")] + public string? BuyerEmail { get; set; } + /// /// 获取或设置卖家备注。 /// @@ -774,20 +678,6 @@ public class OrderLine [System.Text.Json.Serialization.JsonPropertyName("is_cod")] public bool IsCashOnDelivery { get; set; } - /// - /// 获取或设置货到付款风险类型。 - /// - [Newtonsoft.Json.JsonProperty("cod_risk_type")] - [System.Text.Json.Serialization.JsonPropertyName("cod_risk_type")] - public int? CashOnDeliveryRiskType { get; set; } - - /// - /// 获取或设置货到付款风险原因列表。 - /// - [Newtonsoft.Json.JsonProperty("cod_risk_reason")] - [System.Text.Json.Serialization.JsonPropertyName("cod_risk_reason")] - public string[]? CashOnDeliveryRiskReasonList { get; set; } - /// /// 获取或设置行政区划列表。 /// @@ -801,6 +691,27 @@ public class OrderLine [Newtonsoft.Json.JsonProperty("order_line_list")] [System.Text.Json.Serialization.JsonPropertyName("order_line_list")] public Types.OrderLine[]? OrderLineList { get; set; } + + /// + /// 获取或设置个人税务登记号。 + /// + [Newtonsoft.Json.JsonProperty("cpf")] + [System.Text.Json.Serialization.JsonPropertyName("cpf")] + public string? CPFNumber { get; set; } + + /// + /// 获取或设置需要上传发票状态。 + /// + [Newtonsoft.Json.JsonProperty("need_upload_invoice")] + [System.Text.Json.Serialization.JsonPropertyName("need_upload_invoice")] + public int? NeedUploadInvoiceStatus { get; set; } + + /// + /// 获取或设置是否是示例订单。 + /// + [Newtonsoft.Json.JsonProperty("is_sample_order")] + [System.Text.Json.Serialization.JsonPropertyName("is_sample_order")] + public bool? IsSampleOrder { get; set; } } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs index e5767ccc..6b8d8cfe 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs @@ -38,6 +38,6 @@ public abstract class TikTokShopRequest : CommonRequestBase, ICommonRequest ///
[Newtonsoft.Json.JsonIgnore] [System.Text.Json.Serialization.JsonIgnore] - public virtual int? ApiVersion { get; set; } + public virtual string? ApiVersion { get; set; } } } diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Order/OrderGetOrderDetailResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Order/OrderGetOrderDetailResponse.json index 64915b10..cde7caf2 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Order/OrderGetOrderDetailResponse.json +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Order/OrderGetOrderDetailResponse.json @@ -3,83 +3,68 @@ "data": { "order_list": [ { - "buyer_message": "abcde", + "buyer_email": "v2b2V5@chat.seller.tiktok.com", + "buyer_message": "asdfda", "buyer_uid": "7021436810468230477", - "cancel_order_sla": "1619621355", + "cancel_order_sla": 1619621355, "cancel_reason": "Pricing error", "cancel_user": "SELLER", - "cod_risk_reason": [], - "cod_risk_type": 0, + "cpf": "3213-31231412", "create_time": "1619611561674", - "delivery_option": "STANDARD", - "delivery_option_description": "", - "delivery_option_id": "", - "delivery_option_type": 0, - "delivery_sla": 0, + "delivery_option_description": "Shipped from seller", + "delivery_option_id": "7091146663229654785", + "delivery_option_type": 1, + "delivery_sla": 1678389618, "district_info_list": [ { - "address_level_name": "", - "address_name": "" - } - ], - "ext_status": "101", - "fulfillment_type": "0", - "is_cod": true, - "item_list": [ - { - "product_id": "1729382476852921560", - "product_name": "test cart 50 sku", - "quantity": "5", - "seller_sku": "X-123", - "sku_cancel_reason": "", - "sku_cancel_user": "", - "sku_display_status": 0, - "sku_ext_status": 101, - "sku_id": "2729382476852921560", - "sku_image": "https://p19-oec-sg.ibyteimg.com/tos-maliva-i-o3syd03w52-us/12345670c5480408aa668", - "sku_name": "white,128g", - "sku_original_price": "5000", - "sku_platform_discount": "500", - "sku_platform_discount_total": 500, - "sku_rts_time": 0, - "sku_sale_price": "5000", - "sku_seller_discount": "500", - "sku_small_order_fee": 5000, - "sku_type": 0 + "address_level_name": "Country", + "address_name": "United Kingdom" } ], + "fulfillment_type": 0, + "is_cod": false, + "is_sample_order": true, + "need_upload_invoice": 1, "order_id": "576461413038785752", "order_line_list": [ { - "cancel_reason": "", - "cancel_user": "", - "display_status": 0, - "ext_status": 0, - "order_line_id": "", - "original_price": 0, + "cancel_reason": "Discount not as expected", + "cancel_user": "BUYER", + "display_status": 100, + "is_gift": false, + "item_tax": [ + { + "tax_amount": 21.2, + "tax_type": 1 + } + ], + "order_line_id": "577086512123755123", + "original_price": 0.01, "package_freeze_status": 0, - "package_id": "", - "package_status": 0, + "package_id": 1153132168123859200, + "package_status": 5, "platform_discount": 0, - "product_id": "", - "product_name": "", - "rts_time": 0, - "sale_price": 0, + "product_id": "1729582718312380123", + "product_name": "Women's Winter Crochet Clothes", + "retail_delivery_fee": 1.29, + "rts_time": 1678389618, + "sale_price": 0.01, "seller_discount": 0, - "seller_sku": "", - "shipping_provider_id": "", - "shipping_provider_name": "", + "seller_sku": "red_iphone_256", + "shipping_provider_id": "6617675021119438849", + "shipping_provider_name": "TT Virtual express", "sku_id": "2729382476852921560", - "sku_image": "", - "sku_name": "", + "sku_image": "https://p16-oec-va.itexeitg.com/tos-maliva-d-o5syd03w52-us/46123e87d14f40b69b839", + "sku_name": "1#, Standard", "sku_type": 0, - "tracking_number": "" + "small_order_fee": 5000, + "tracking_number": "JX12345" } ], "order_status": 100, "package_list": [ { - "package_id": "2882335594258860015" + "package_id": "1152321127278713123" } ], "paid_time": 1619611563, @@ -88,158 +73,43 @@ "original_shipping_fee": 5000, "original_total_product_price": 5000, "platform_discount": 5000, + "product_taxes": 21.3, + "retail_delivery_fee": 1.29, "seller_discount": 5000, "shipping_fee": 5000, "shipping_fee_platform_discount": 5000, "shipping_fee_seller_discount": 5000, - "small_order_fee": 5000, + "shipping_fee_tax": 11, + "small_order_fee": 3000, "sub_total": 5000, "taxes": 5000, "total_amount": 5000 }, - "payment_method": "BANK_CARD", - "payment_method_name": "", - "payment_method_type": 0, + "payment_method_name": "CCDC", + "payment_method_type": 4, "receiver_address_updated": 0, "recipient_address": { "address_detail": "unit one building 8", - "address_line_list": [ - "", - "" - ], - "city": "Central Bangka Regency", - "district": "Koba", - "full_address": "Indonesia, Bangka Belitung Province, Central Bangka Regency, Koba, Arung Dalam, ", + "addressline1": "Tiktok 5800 bristol Pkwy", + "addressline2": "suit 100", + "addressline3": "\"\"", + "addressline4": "\"\"", + "full_address": "Indonesia, Bangka Belitung Province, Central Bangka Regency, Koba, Arung Dalam,", "name": "zay", "phone": "(+86)12345678980", - "region": "Indonesia", "region_code": "ID", - "state": "Bangka Belitung Province", - "town": "Arung Dalam", "zipcode": "23683" }, - "rts_sla": "1619611688", + "rts_sla": 1619611688, "rts_time": 1619611563, "seller_note": "seller note", "shipping_provider": "TT Virtual express", "shipping_provider_id": "6617675021119438849", "split_or_combine_tag": "combined", "tracking_number": "JX12345", - "tts_sla": "1619611761", - "update_time": "1619621355", - "warehouse_id": "" - }, - { - "order_id": "576461413038785752", - "order_status": 100, - "payment_method": "BANK_CARD", - "delivery_option": "STANDARD", - "shipping_provider": "TT Virtual express", - "shipping_provider_id": "6617675021119438849", - "create_time": "1619611561674", - "paid_time": 1619611563, - "buyer_message": "abcde", - "payment_info": { - "currency": "IDR", - "sub_total": 5000, - "shipping_fee": 170685, - "seller_discount": 0, - "total_amount": 175685, - "original_total_product_price": 10, - "original_shipping_fee": 10, - "shipping_fee_seller_discount": 0, - "shipping_fee_platform_discount": 0 - }, - "recipient_address": { - "full_address": "Indonesia, Bangka Belitung Province, Central Bangka Regency, Koba, Arung Dalam, babba", - "region": "Indonesia", - "state": "Bangka Belitung Province", - "city": "Central Bangka Regency", - "district": "Koba", - "town": "Arung Dalam", - "phone": "(+86)12345678980", - "name": "zay", - "zipcode": "23683", - "address_detail": "babba", - "address_line_list": [ - "Street name Test", - "Hourse name Test" - ] - }, - "tracking_number": "Jx12345", - "item_list": [ - { - "sku_id": "1729389661993665752", - "product_id": "1729388199855555800", - "sku_name": "-", - "quantity": 1, - "seller_sku": "", - "product_name": "iphone max 11111", - "sku_image": "https://asdfghj", - "sku_original_price": 20000, - "sku_sale_price": 20000, - "sku_platform_discount": 0, - "sku_seller_discount": 0, - "sku_ext_status": 0, - "sku_display_status": 112, - "sku_rts_time": 1649817943 - }, - { - "sku_id": "1729388495591146712", - "product_id": "1729388495591081176", - "sku_name": "blue", - "quantity": 1, - "seller_sku": "test_seller_sku", - "product_name": "presale", - "sku_image": "https://asdfghj", - "sku_original_price": 501, - "sku_sale_price": 501, - "sku_platform_discount": 0, - "sku_seller_discount": 0, - "sku_ext_status": 0, - "sku_display_status": 112, - "sku_rts_time": 1649817943 - }, - { - "sku_id": "1729389552620045528", - "product_id": "1729389456828105944", - "sku_name": "TT", - "quantity": 1, - "seller_sku": "", - "product_name": "test product", - "sku_image": "https://asdfghj", - "sku_original_price": 1000, - "sku_sale_price": 1000, - "sku_platform_discount": 0, - "sku_seller_discount": 0, - "sku_ext_status": 203, - "sku_display_status": 140, - "sku_cancel_reason": "Wrong delivery information", - "sku_cancel_user": "BUYER" - } - ], - "rts_time": 1619611563, - "rts_sla": 1619611688, "tts_sla": 1619611761, - "cancel_order_sla": 1619621355, - "receiver_address_updated": 0, "update_time": 1619621355, - "buyer_uid": "7493990569595471353", - "fulfillment_type": 0, - "order_line_list": [ - { - "order_line_id": "576465323303339224", - "sku_id": "1729389661993665752" - }, - { - "order_line_id": "576465323303404760", - "sku_id": "1729388495591146712" - }, - { - "order_line_id": "576465323303470296", - "sku_id": "1729389552620045528" - } - ] + "warehouse_id": "'6955005333819123123'" } ] }, From 52eee4bdabe3b87dcbf31187bbfe978aef6fc149 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 21:34:10 +0800 Subject: [PATCH 08/12] =?UTF-8?q?feat(tiktokshop):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=95=86=E5=93=81=E5=BA=93=E5=AD=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TikTokGlobalShop/Basic_ModelDefinition.md | 1 + ...ikTokShopClientExecuteProductExtensions.cs | 22 +++ .../Product/ProductGetProductStocksRequest.cs | 24 +++ .../ProductGetProductStocksResponse.cs | 179 ++++++++++++++++++ .../ProductGetProductStocksRequest.json | 8 + .../ProductGetProductStocksResponse.json | 42 ++++ 6 files changed, 276 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductStocksRequest.json create mode 100644 test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductStocksResponse.json diff --git a/docs/TikTokGlobalShop/Basic_ModelDefinition.md b/docs/TikTokGlobalShop/Basic_ModelDefinition.md index fbc16203..57d14048 100644 --- a/docs/TikTokGlobalShop/Basic_ModelDefinition.md +++ b/docs/TikTokGlobalShop/Basic_ModelDefinition.md @@ -31,6 +31,7 @@ Naming Policies: - Update Stock: `ProductUpdateProductStock` - Get Product List: `ProductSearchProducts` - Get Product Detail: `ProductGetProductDetail` + - Get Product Stock: `ProductGetProductStocks` - Deactivate Product: `ProductDeactivateProducts` - Activate Product: `ProductActivateProducts` - Recover Deleted Product: `ProductRecoverProducts` diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs index edc5c943..b313dc9a 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs @@ -101,6 +101,28 @@ public static class TikTokShopClientExecuteProductExtensions return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + /// + /// 异步调用 [POST] /products/stock/list 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteProductGetProductStocksAsync(this TikTokShopClient client, Models.ProductGetProductStocksRequest 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, "products", "stock", "list"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + /// /// 异步调用 [PUT] /products/stocks 接口。 /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksRequest.cs new file mode 100644 index 00000000..389d67cd --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksRequest.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /products/stock/list 接口的请求。 + /// + public class ProductGetProductStocksRequest : TikTokShopRequest + { + /// + /// 获取或设置商品 ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("product_ids")] + [System.Text.Json.Serialization.JsonPropertyName("product_ids")] + public IList? ProductIdList { get; set; } + + /// + /// 获取或设置 SKU ID 列表。 + /// + [Newtonsoft.Json.JsonProperty("sku_ids")] + [System.Text.Json.Serialization.JsonPropertyName("sku_ids")] + public IList? SKUIdList { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksResponse.cs new file mode 100644 index 00000000..fef6cd06 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksResponse.cs @@ -0,0 +1,179 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /products/stock/list 接口的响应。 + /// + public class ProductGetProductStocksResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class Product + { + public static class Types + { + public class SKU + { + public static class Types + { + public class WarehouseStockInfo + { + /// + /// 获取或设置仓库 ID。 + /// + [Newtonsoft.Json.JsonProperty("warehouse_id")] + [System.Text.Json.Serialization.JsonPropertyName("warehouse_id")] + public string WarehouseId { get; set; } = default!; + + /// + /// 获取或设置可用库存。 + /// + [Newtonsoft.Json.JsonProperty("available_stock")] + [System.Text.Json.Serialization.JsonPropertyName("available_stock")] + public int AvailableStock { get; set; } + + /// + /// 获取或设置已订购库存。 + /// + [Newtonsoft.Json.JsonProperty("committed_stock")] + [System.Text.Json.Serialization.JsonPropertyName("committed_stock")] + public int CommittedStock { get; set; } + } + + public class TotalAvailableStockDistribution + { + public static class Types + { + public class CampaignStockInfo + { + /// + /// 获取或设置活动名称。 + /// + [Newtonsoft.Json.JsonProperty("campaign_name")] + [System.Text.Json.Serialization.JsonPropertyName("campaign_name")] + public string CampaignName { get; set; } = default!; + + /// + /// 获取或设置可用库存。 + /// + [Newtonsoft.Json.JsonProperty("available_stock")] + [System.Text.Json.Serialization.JsonPropertyName("available_stock")] + public int AvailableStock { get; set; } + } + + public class CreatorStockInfo + { + /// + /// 获取或设置创作者名称。 + /// + [Newtonsoft.Json.JsonProperty("creator_name")] + [System.Text.Json.Serialization.JsonPropertyName("creator_name")] + public string CreatorName { get; set; } = default!; + + /// + /// 获取或设置可用库存。 + /// + [Newtonsoft.Json.JsonProperty("available_stock")] + [System.Text.Json.Serialization.JsonPropertyName("available_stock")] + public int AvailableStock { get; set; } + } + } + + /// + /// 获取或设置活动库存列表。 + /// + [Newtonsoft.Json.JsonProperty("campaign_stock")] + [System.Text.Json.Serialization.JsonPropertyName("campaign_stock")] + public Types.CampaignStockInfo[]? CampaignStockList { get; set; } + + /// + /// 获取或设置创作者库存列表。 + /// + [Newtonsoft.Json.JsonProperty("creator_stock")] + [System.Text.Json.Serialization.JsonPropertyName("creator_stock")] + public Types.CreatorStockInfo[]? CreatorStockList { get; set; } + + /// + /// 获取或设置店内库存。 + /// + [Newtonsoft.Json.JsonProperty("in_shop_stock")] + [System.Text.Json.Serialization.JsonPropertyName("in_shop_stock")] + public int? InShopStock { 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.NumericalStringReadOnlyConverter))] + public string SKUId { get; set; } = default!; + + /// + /// 获取或设置卖家 SKU 信息。 + /// + [Newtonsoft.Json.JsonProperty("seller_sku")] + [System.Text.Json.Serialization.JsonPropertyName("seller_sku")] + public string? SellerSKU { get; set; } + + /// + /// 获取或设置总可用库存。 + /// + [Newtonsoft.Json.JsonProperty("total_available_stock")] + [System.Text.Json.Serialization.JsonPropertyName("total_available_stock")] + public int TotalAvailableStock { get; set; } + + /// + /// 获取或设置总已订购库存。 + /// + [Newtonsoft.Json.JsonProperty("total_committed_stock")] + [System.Text.Json.Serialization.JsonPropertyName("total_committed_stock")] + public int TotalCommittedStock { get; set; } + + /// + /// 获取或设置各仓库库存列表。 + /// + [Newtonsoft.Json.JsonProperty("warehouse_stock_infos")] + [System.Text.Json.Serialization.JsonPropertyName("warehouse_stock_infos")] + public Types.WarehouseStockInfo[] WarehouseStockList { get; set; } = default!; + + /// + /// 获取或设置总可用库存分布信息。 + /// + [Newtonsoft.Json.JsonProperty("total_available_stock_distribution")] + [System.Text.Json.Serialization.JsonPropertyName("total_available_stock_distribution")] + public Types.TotalAvailableStockDistribution TotalAvailableStockDistribution { get; set; } = default!; + } + } + + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string ProductId { get; set; } = default!; + + /// + /// 获取或设置 SKU 列表。 + /// + [Newtonsoft.Json.JsonProperty("skus")] + [System.Text.Json.Serialization.JsonPropertyName("skus")] + public Types.SKU[] SKU { get; set; } = default!; + } + } + + /// + /// 获取或设置商品列表。 + /// + [Newtonsoft.Json.JsonProperty("product_stocks")] + [System.Text.Json.Serialization.JsonPropertyName("product_stocks")] + public Types.Product[] ProductList { get; set; } = default!; + } + } + } +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductStocksRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductStocksRequest.json new file mode 100644 index 00000000..4baa611d --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductStocksRequest.json @@ -0,0 +1,8 @@ +{ + "product_ids": [ + "1729592969712207008" + ], + "sku_ids": [ + "1729388324987897824" + ] +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductStocksResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductStocksResponse.json new file mode 100644 index 00000000..68aacc98 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductStocksResponse.json @@ -0,0 +1,42 @@ +{ + "code": 0, + "data": { + "product_stocks": [ + { + "product_id": "1729592969712207008", + "skus": [ + { + "seller_sku": "6919959100928", + "sku_id": "1729388324987897824", + "total_available_stock": 50, + "total_available_stock_distribution": { + "campaign_stock": [ + { + "available_stock": 25, + "campaign_name": "Big Sale" + } + ], + "creator_stock": [ + { + "available_stock": 10, + "creator_name": "username_123" + } + ], + "in_shop_stock": 15 + }, + "total_committed_stock": 14, + "warehouse_stock_infos": [ + { + "available_stock": 50, + "committed_stock": 14, + "warehouse_id": "7054915283043174149" + } + ] + } + ] + } + ] + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} From 453ab5d4481f6f86d46c830a62f4c63d90b5f140 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 22:18:18 +0800 Subject: [PATCH 09/12] =?UTF-8?q?feat(tiktokshop):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=95=86=E5=93=81=E9=A2=84=E6=A3=80=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TikTokGlobalShop/Basic_ModelDefinition.md | 1 + ...ikTokShopClientExecuteProductExtensions.cs | 22 +++++ .../Models/Product/ProductPrecheckRequest.cs | 13 +++ .../Models/Product/ProductPrecheckResponse.cs | 99 +++++++++++++++++++ ...GlobalProductGetProductDetailResponse.json | 3 - .../ProductGetProductDetailResponse.json | 3 - .../Product/ProductPrecheckResponse.json | 20 ++++ 7 files changed, 155 insertions(+), 6 deletions(-) create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductPrecheckRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductPrecheckResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductPrecheckResponse.json diff --git a/docs/TikTokGlobalShop/Basic_ModelDefinition.md b/docs/TikTokGlobalShop/Basic_ModelDefinition.md index 57d14048..49b8739a 100644 --- a/docs/TikTokGlobalShop/Basic_ModelDefinition.md +++ b/docs/TikTokGlobalShop/Basic_ModelDefinition.md @@ -42,6 +42,7 @@ Naming Policies: - Get Attributes: `ProductGetAttributeList` - Get Category Rule: `ProductGetCategoryRules` - Category Recommended: `ProductRecommendCategory` + - Pre-check for Operating Product: `ProductPrecheck` - Order - Get Order Detail: `OrderGetOrderDetail` - Get Order List: `OrderSearchOrders` diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs index b313dc9a..8b0db782 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteProductExtensions.cs @@ -277,6 +277,28 @@ public static class TikTokShopClientExecuteProductExtensions return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + /// + /// 异步调用 [POST] /products/pre_check 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteProductPrecheckAsync(this TikTokShopClient client, Models.ProductPrecheckRequest 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, "products", "pre_check"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #region Upload /// /// 异步调用 [POST] /products/upload_files 接口。 diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductPrecheckRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductPrecheckRequest.cs new file mode 100644 index 00000000..61daa603 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductPrecheckRequest.cs @@ -0,0 +1,13 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /products/pre_check 接口的请求。 + /// + public class ProductPrecheckRequest : TikTokShopRequest + { + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override string? ApiVersion { get; set; } = "202306"; + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductPrecheckResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductPrecheckResponse.cs new file mode 100644 index 00000000..4ba8569e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductPrecheckResponse.cs @@ -0,0 +1,99 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /products/pre_check 接口的响应。 + /// + public class ProductPrecheckResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class ShopInfo + { + public static class Types + { + public class GNEInfo + { + /// + /// 获取或设置产品数量限制 JSON 字符串。 + /// + [Newtonsoft.Json.JsonProperty("product_quantity_limit")] + [System.Text.Json.Serialization.JsonPropertyName("product_quantity_limit")] + public string ProductQuantityLimitString { get; set; } = default!; + } + + public class LogisticsInfo + { + /// + /// 获取或设置发货仓库 JSON 字符串。 + /// + [Newtonsoft.Json.JsonProperty("delivery_warehouse")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_warehouse")] + public string DeliveryWarehouseLimitString { get; set; } = default!; + + /// + /// 获取或设置退货仓库 JSON 字符串。 + /// + [Newtonsoft.Json.JsonProperty("return_warehouse")] + [System.Text.Json.Serialization.JsonPropertyName("return_warehouse")] + public string ReturnWarehouseLimitString { get; set; } = default!; + + /// + /// 获取或设置货运模板 JSON 字符串。 + /// + [Newtonsoft.Json.JsonProperty("shipping_template")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_template")] + public string ShippingTemplateJson { get; set; } = default!; + + /// + /// 获取或设置物流服务 JSON 字符串。 + /// + [Newtonsoft.Json.JsonProperty("logistics_service")] + [System.Text.Json.Serialization.JsonPropertyName("logistics_service")] + public string LogisticsServiceJson { get; set; } = default!; + } + } + + /// + /// 获取或设置店铺状态 JSON 字符串。 + /// + [Newtonsoft.Json.JsonProperty("shop_status")] + [System.Text.Json.Serialization.JsonPropertyName("shop_status")] + public string ShopInfoJson { get; set; } = default!; + + /// + /// 获取或设置税费信息 JSON 字符串。 + /// + [Newtonsoft.Json.JsonProperty("tax_info")] + [System.Text.Json.Serialization.JsonPropertyName("tax_info")] + public string TaxInfoJson { get; set; } = default!; + + /// + /// 获取或设置 GNE 信息。 + /// + [Newtonsoft.Json.JsonProperty("gne_info")] + [System.Text.Json.Serialization.JsonPropertyName("gne_info")] + public Types.GNEInfo GNEInfo { get; set; } = default!; + + /// + /// 获取或设置物流信息。 + /// + [Newtonsoft.Json.JsonProperty("logistics_info")] + [System.Text.Json.Serialization.JsonPropertyName("logistics_info")] + public Types.LogisticsInfo LogisticsInfo { get; set; } = default!; + } + } + + /// + /// 获取或设置店铺信息。 + /// + [Newtonsoft.Json.JsonProperty("shop_info")] + [System.Text.Json.Serialization.JsonPropertyName("shop_info")] + public Types.ShopInfo ShopInfo { get; set; } = default!; + } + } + } +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/GlobalProductGetProductDetailResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/GlobalProductGetProductDetailResponse.json index f2e54d2c..86fc4043 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/GlobalProductGetProductDetailResponse.json +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/GlobalProduct/GlobalProductGetProductDetailResponse.json @@ -4,9 +4,6 @@ "category_id": 600006, "create_time": 123456789, "description": "

test

", - "exemption_of_identifier_code": { - "exemption_reason": "1" - }, "global_product_id": 1729592969712208000, "images": [ { diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductDetailResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductDetailResponse.json index 8d5fb530..c2ab5365 100644 --- a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductDetailResponse.json +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductGetProductDetailResponse.json @@ -23,9 +23,6 @@ } ], "description": "", - "exemption_of_identifier_code": { - "exemption_reason": "1" - }, "images": [ { "height": 600, diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductPrecheckResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductPrecheckResponse.json new file mode 100644 index 00000000..6fee3527 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Product/ProductPrecheckResponse.json @@ -0,0 +1,20 @@ +{ + "code": 0, + "data": { + "shop_info": { + "gne_info": { + "product_quantity_limit": "{\\\"id\\\":\\\"product_quantity_limit\\\",\\\"name\\\":\\\"product_quantity_limit\\\",\\\"check_result\\\":{\\\"is_failed\\\":false}}" + }, + "logistics_info": { + "delivery_warehouse": "{\\\"id\\\":\\\"delivery_warehouse\\\",\\\"name\\\":\\\"delivery_warehouse\\\",\\\"check_result\\\":{\\\"is_failed\\\":false}}", + "logistics_service": "{\\\"id\\\":\\\"logistics_service\\\",\\\"name\\\":\\\"logistics_service\\\",\\\"check_result\\\":{\\\"is_failed\\\":true,\\\"fail_reasons\\\":[\\\"Cannot add products because the warehouse didn't set logistics service. You can check in the shipping option page\\\"]}}", + "return_warehouse": "{\\\"id\\\":\\\"return_warehouse\\\",\\\"name\\\":\\\"return_warehouse\\\",\\\"check_result\\\":{\\\"is_failed\\\":true,\\\"fail_reasons\\\":[\\\"Couldn't publish this product as you haven't set the return warehouse for your shop. Add the return warehouse information on TikTok Shop Seller Center first and try again.\\\"]}}", + "shipping_template": "{\\\"id\\\":\\\"shipping_template\\\",\\\"name\\\":\\\"shipping_template\\\",\\\"check_result\\\":{\\\"is_failed\\\":false}}" + }, + "shop_status": "{\\\"id\\\":\\\"shop_status\\\",\\\"name\\\":\\\"shop_status\\\",\\\"check_result\\\":{\\\"is_failed\\\":false}}", + "tax_info": "{\\\"id\\\":\\\"tax_info\\\",\\\"name\\\":\\\"tax_info\\\",\\\"check_result\\\":{\\\"is_failed\\\":true,\\\"fail_reasons\\\":[\\\"This seller is not able to create or edit product. Check if the seller has a valid tax number.\\\"]}}" + } + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} From e25c5cc7770d9e681d6e10cd0088d5f643e53817 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 22:18:22 +0800 Subject: [PATCH 10/12] =?UTF-8?q?feat(tiktokshop):=20=E4=B8=BA=E7=89=B9?= =?UTF-8?q?=E5=AE=9A=E7=9A=84=E8=AF=B7=E6=B1=82=E6=A8=A1=E5=9E=8B=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=BB=98=E8=AE=A4=E7=9A=84=20API=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TikTokShopClientExecuteAuthExtensions.cs | 4 ++-- .../GlobalProductGetProductDetailRequest.cs | 5 +++++ .../GlobalProductGetProductDetailResponse.cs | 11 ----------- .../Models/Order/OrderGetOrderDetailRequest.cs | 5 +++++ .../Category/ProductGetCategoryListRequest.cs | 4 ++++ .../Product/ProductGetProductDetailRequest.cs | 5 +++++ .../Product/ProductGetProductDetailResponse.cs | 17 ----------------- .../Product/ProductGetProductStocksRequest.cs | 5 +++++ .../ReverseSearchReverseOrdersRequest.cs | 5 +++++ .../TikTokShopRequest.cs | 2 +- 10 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs index 99d10954..843d4284 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteAuthExtensions.cs @@ -32,7 +32,7 @@ public static class TikTokShopClientExecuteAuthExtensions .SetQueryParam("app_secret", client.Credentials.AppSecret) .SetQueryParam("grant_type", request.GrantType) .SetQueryParam("auth_code", request.AuthorizedCode) - .RemoveQueryParams("app_key", "access_token", "timestamp", "shop_id", "version"); + .RemoveQueryParams("access_token", "timestamp", "shop_id", "shop_cipher", "version"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -61,7 +61,7 @@ public static class TikTokShopClientExecuteAuthExtensions .SetQueryParam("app_secret", client.Credentials.AppSecret) .SetQueryParam("grant_type", request.GrantType) .SetQueryParam("refresh_token", request.RefreshToken) - .RemoveQueryParams("app_key", "access_token", "timestamp", "shop_id", "version"); + .RemoveQueryParams("access_token", "timestamp", "shop_id", "shop_cipher", "version"); return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailRequest.cs index fc36f3e3..326e3fb0 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailRequest.cs @@ -5,6 +5,11 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models ///
public class GlobalProductGetProductDetailRequest : TikTokShopRequest { + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override string? ApiVersion { get; set; } = "202306"; + /// /// 获取或设置全球商品 ID。 /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailResponse.cs index afc7a548..50badee5 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/GlobalProduct/GlobalProductGetProductDetailResponse.cs @@ -248,10 +248,6 @@ public class ProductAttributeValue [System.Text.Json.Serialization.JsonPropertyName("attribute_values")] public Types.ProductAttributeValue[] ValueList { get; set; } = default!; } - - public class ExemptionOfIdentifierCode : ProductGetProductDetailResponse.Types.Data.Types.ExemptionOfIdentifierCode - { - } } /// @@ -382,13 +378,6 @@ public class ExemptionOfIdentifierCode : ProductGetProductDetailResponse.Types.D [System.Text.Json.Serialization.JsonPropertyName("product_attributes")] public Types.ProductAttribute[]? ProductAttributeList { get; set; } - /// - /// 获取或设置产品标识码豁免信息。 - /// - [Newtonsoft.Json.JsonProperty("exemption_of_identifier_code")] - [System.Text.Json.Serialization.JsonPropertyName("exemption_of_identifier_code")] - public Types.ExemptionOfIdentifierCode? ExemptionOfIdentifierCode { get; set; } - /// /// 获取或设置创建时间戳。 /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailRequest.cs index 19fc7eda..68b97585 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderDetailRequest.cs @@ -7,6 +7,11 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models /// public class OrderGetOrderDetailRequest : TikTokShopRequest { + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override string? ApiVersion { get; set; } = "202305"; + /// /// 获取或设置订单 ID 列表。 /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListRequest.cs index 40330b08..48cf2b92 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryListRequest.cs @@ -5,5 +5,9 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models ///
public class ProductGetCategoryListRequest : TikTokShopRequest { + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override string? ApiVersion { get; set; } = "202303"; } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailRequest.cs index 51222f73..5d95090d 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailRequest.cs @@ -5,6 +5,11 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models ///
public class ProductGetProductDetailRequest : TikTokShopRequest { + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override string? ApiVersion { get; set; } = "202306"; + /// /// 获取或设置商品 ID。 /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs index 036a21a7..bf2daae7 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductDetailResponse.cs @@ -468,16 +468,6 @@ public class ProductAttributeValue public Types.ProductAttributeValue[] ValueList { get; set; } = default!; } - public class ExemptionOfIdentifierCode - { - /// - /// 获取或设置 GTIN 豁免原因类型。 - /// - [Newtonsoft.Json.JsonProperty("exemption_reason")] - [System.Text.Json.Serialization.JsonPropertyName("exemption_reason")] - public int? ExemptionReasonType { get; set; } - } - public class QCReason { /// @@ -644,13 +634,6 @@ public class QCReason [System.Text.Json.Serialization.JsonPropertyName("product_attributes")] public Types.ProductAttribute[]? ProductAttributeList { get; set; } - /// - /// 获取或设置产品标识码豁免信息。 - /// - [Newtonsoft.Json.JsonProperty("exemption_of_identifier_code")] - [System.Text.Json.Serialization.JsonPropertyName("exemption_of_identifier_code")] - public Types.ExemptionOfIdentifierCode? ExemptionOfIdentifierCode { get; set; } - /// /// 获取或设置 QC 原因列表。 /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksRequest.cs index 389d67cd..7f0bbc78 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetProductStocksRequest.cs @@ -7,6 +7,11 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models /// public class ProductGetProductStocksRequest : TikTokShopRequest { + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override string? ApiVersion { get; set; } = "202305"; + /// /// 获取或设置商品 ID 列表。 /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersRequest.cs index 57f1acc8..357c7186 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Reverse/ReverseSearchReverseOrdersRequest.cs @@ -5,6 +5,11 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models /// public class ReverseSearchReverseOrdersRequest : TikTokShopRequest { + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override string? ApiVersion { get; set; } = "202307"; + /// /// 获取或设置更新时间范围起始时间戳。 /// diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs index 6b8d8cfe..3326cf7d 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/TikTokShopRequest.cs @@ -34,7 +34,7 @@ public abstract class TikTokShopRequest : CommonRequestBase, ICommonRequest public virtual string? ShopCipher { get; set; } /// - /// 获取或设置 API 版本号。 + /// 获取或设置 API 版本号。如果不指定将使用系统所支持的最高版本号。 /// [Newtonsoft.Json.JsonIgnore] [System.Text.Json.Serialization.JsonIgnore] From e42a6da64be33e117abdb6064044aa9de39a0948 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 22:33:45 +0800 Subject: [PATCH 11/12] =?UTF-8?q?feat(tiktokshop):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=BF=90=E8=BE=93=E6=9C=8D=E5=8A=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TikTokGlobalShop/Basic_ModelDefinition.md | 2 + ...kShopClientExecuteFulfillmentExtensions.cs | 44 +++++ .../FulfillmentCreateLabelRequest.cs | 64 +++++++ .../FulfillmentCreateLabelResponse.cs | 70 ++++++++ .../FulfillmentGetShippingServiceRequest.cs | 83 +++++++++ .../FulfillmentGetShippingServiceResponse.cs | 160 ++++++++++++++++++ .../FulfillmentCreateLabelRequest.json | 12 ++ .../FulfillmentCreateLabelResponse.json | 26 +++ .../FulfillmentGetShippingServiceRequest.json | 11 ++ ...FulfillmentGetShippingServiceResponse.json | 29 ++++ 10 files changed, 501 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentCreateLabelRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentCreateLabelResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetShippingServiceRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetShippingServiceResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentCreateLabelRequest.json create mode 100644 test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentCreateLabelResponse.json create mode 100644 test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentGetShippingServiceRequest.json create mode 100644 test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentGetShippingServiceResponse.json diff --git a/docs/TikTokGlobalShop/Basic_ModelDefinition.md b/docs/TikTokGlobalShop/Basic_ModelDefinition.md index 49b8739a..cd6d120e 100644 --- a/docs/TikTokGlobalShop/Basic_ModelDefinition.md +++ b/docs/TikTokGlobalShop/Basic_ModelDefinition.md @@ -64,6 +64,8 @@ Naming Policies: - Update Package Delivery Status: `FulfillmentUpdatePackageDeliveryStatus` - Fulfillment Upload File: `FulfillmentUploadFile` - Batch Ship Packages: `FulfillmentBatchShipPackage` + - Get Shipping Service: `FulfillmentGetShippingService` + - Create Label: `FulfillmentCreateLabel` - Logistics - Get Subscribed Delivery Options: `LogisticsGetSubscribedDeliveryOptions` - Update Shipping Info: `LogisticsUpdateShippingInfo` diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFulfillmentExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFulfillmentExtensions.cs index 3919b5e6..37ddddde 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFulfillmentExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFulfillmentExtensions.cs @@ -215,6 +215,50 @@ public static class TikTokShopClientExecuteFulfillmentExtensions return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + /// + /// 异步调用 [POST] /fulfillment/shipping_service/get 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteFulfillmentGetShippingServiceAsync(this TikTokShopClient client, Models.FulfillmentGetShippingServiceRequest 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, "fulfillment", "shipping_service", "get"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /fulfillment/create_label 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteFulfillmentCreateLabelAsync(this TikTokShopClient client, Models.FulfillmentCreateLabelRequest 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, "fulfillment", "create_label"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #region Order /// /// 异步调用 [POST] /fulfillment/order_split/verify 接口。 diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentCreateLabelRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentCreateLabelRequest.cs new file mode 100644 index 00000000..bf6cb948 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentCreateLabelRequest.cs @@ -0,0 +1,64 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /fulfillment/create_label 接口的请求。 + /// + public class FulfillmentCreateLabelRequest : TikTokShopRequest + { + public static class Types + { + public class Dimension : FulfillmentGetShippingServiceRequest.Types.Dimension + { + } + } + + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override string? ApiVersion { get; set; } = "202304"; + + /// + /// 获取或设置包裹 ID。 + /// + [Newtonsoft.Json.JsonProperty("package_id")] + [System.Text.Json.Serialization.JsonPropertyName("package_id")] + public string PackageId { get; set; } = string.Empty; + + /// + /// 获取或设置重量。 + /// + [Newtonsoft.Json.JsonProperty("weight")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] + [System.Text.Json.Serialization.JsonPropertyName("weight")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))] + public decimal? Weight { get; set; } + + /// + /// 获取或设置重量单位。 + /// + [Newtonsoft.Json.JsonProperty("weight_unit")] + [System.Text.Json.Serialization.JsonPropertyName("weight_unit")] + public int? WeightUnit { get; set; } + + /// + /// 获取或设置尺寸信息。 + /// + [Newtonsoft.Json.JsonProperty("dimension")] + [System.Text.Json.Serialization.JsonPropertyName("dimension")] + public Types.Dimension? Dimension { get; set; } + + /// + /// 获取或设置尺寸单位。 + /// + [Newtonsoft.Json.JsonProperty("dimension_unit")] + [System.Text.Json.Serialization.JsonPropertyName("dimension_unit")] + public int? DimensionUnit { get; set; } + + /// + /// 获取或设置货运服务 ID。 + /// + [Newtonsoft.Json.JsonProperty("shipping_service_id")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_service_id")] + public string? ShippingServiceId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentCreateLabelResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentCreateLabelResponse.cs new file mode 100644 index 00000000..d30c9989 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentCreateLabelResponse.cs @@ -0,0 +1,70 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /fulfillment/create_label 接口的响应。 + /// + public class FulfillmentCreateLabelResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class Dimension : FulfillmentGetShippingServiceResponse.Types.Data.Types.Dimension + { + } + + public class ShippingServiceInfo : FulfillmentGetShippingServiceResponse.Types.Data.Types.ShippingServiceInfo + { + } + } + + /// + /// 获取或设置包裹 ID。 + /// + [Newtonsoft.Json.JsonProperty("package_id")] + [System.Text.Json.Serialization.JsonPropertyName("package_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string PackageId { get; set; } = default!; + + /// + /// 获取或设置重量。 + /// + [Newtonsoft.Json.JsonProperty("weight")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberReadOnlyConverter))] + [System.Text.Json.Serialization.JsonPropertyName("weight")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal? Weight { get; set; } + + /// + /// 获取或设置重量单位。 + /// + [Newtonsoft.Json.JsonProperty("weight_unit")] + [System.Text.Json.Serialization.JsonPropertyName("weight_unit")] + public int? WeightUnit { get; set; } + + /// + /// 获取或设置尺寸信息。 + /// + [Newtonsoft.Json.JsonProperty("dimension")] + [System.Text.Json.Serialization.JsonPropertyName("dimension")] + public Types.Dimension? Dimension { get; set; } + + /// + /// 获取或设置尺寸单位。 + /// + [Newtonsoft.Json.JsonProperty("dimension_unit")] + [System.Text.Json.Serialization.JsonPropertyName("dimension_unit")] + public int? DimensionUnit { get; set; } + + /// + /// 获取或设置货运服务信息。 + /// + [Newtonsoft.Json.JsonProperty("shipping_service_info")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_service_info")] + public Types.ShippingServiceInfo? ShippingServiceInfo { get; set; } + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetShippingServiceRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetShippingServiceRequest.cs new file mode 100644 index 00000000..ef056c7f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetShippingServiceRequest.cs @@ -0,0 +1,83 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /fulfillment/shipping_service/get 接口的请求。 + /// + public class FulfillmentGetShippingServiceRequest : TikTokShopRequest + { + public static class Types + { + public class Dimension + { + /// + /// 获取或设置长度。 + /// + [Newtonsoft.Json.JsonProperty("length")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] + [System.Text.Json.Serialization.JsonPropertyName("length")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))] + public decimal? Length { get; set; } + + /// + /// 获取或设置宽度。 + /// + [Newtonsoft.Json.JsonProperty("width")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] + [System.Text.Json.Serialization.JsonPropertyName("width")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))] + public decimal? Width { get; set; } + + /// + /// 获取或设置高度。 + /// + [Newtonsoft.Json.JsonProperty("height")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] + [System.Text.Json.Serialization.JsonPropertyName("height")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))] + public decimal? Height { get; set; } + } + } + + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override string? ApiVersion { get; set; } = "202304"; + + /// + /// 获取或设置包裹 ID。 + /// + [Newtonsoft.Json.JsonProperty("package_id")] + [System.Text.Json.Serialization.JsonPropertyName("package_id")] + public string PackageId { get; set; } = string.Empty; + + /// + /// 获取或设置重量。 + /// + [Newtonsoft.Json.JsonProperty("weight")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))] + [System.Text.Json.Serialization.JsonPropertyName("weight")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))] + public decimal? Weight { get; set; } + + /// + /// 获取或设置重量单位。 + /// + [Newtonsoft.Json.JsonProperty("weight_unit")] + [System.Text.Json.Serialization.JsonPropertyName("weight_unit")] + public int? WeightUnit { get; set; } + + /// + /// 获取或设置尺寸信息。 + /// + [Newtonsoft.Json.JsonProperty("dimension")] + [System.Text.Json.Serialization.JsonPropertyName("dimension")] + public Types.Dimension? Dimension { get; set; } + + /// + /// 获取或设置尺寸单位。 + /// + [Newtonsoft.Json.JsonProperty("dimension_unit")] + [System.Text.Json.Serialization.JsonPropertyName("dimension_unit")] + public int? DimensionUnit { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetShippingServiceResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetShippingServiceResponse.cs new file mode 100644 index 00000000..df47b990 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Fulfillment/FulfillmentGetShippingServiceResponse.cs @@ -0,0 +1,160 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /fulfillment/shipping_service/get 接口的响应。 + /// + public class FulfillmentGetShippingServiceResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class Dimension + { + /// + /// 获取或设置长度。 + /// + [Newtonsoft.Json.JsonProperty("length")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberReadOnlyConverter))] + [System.Text.Json.Serialization.JsonPropertyName("length")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal? Length { get; set; } + + /// + /// 获取或设置宽度。 + /// + [Newtonsoft.Json.JsonProperty("width")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberReadOnlyConverter))] + [System.Text.Json.Serialization.JsonPropertyName("width")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal? Width { get; set; } + + /// + /// 获取或设置高度。 + /// + [Newtonsoft.Json.JsonProperty("height")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberReadOnlyConverter))] + [System.Text.Json.Serialization.JsonPropertyName("height")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal? Height { get; set; } + } + + public class ShippingServiceInfo + { + /// + /// 获取或设置服务 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string ServiceId { get; set; } = default!; + + /// + /// 获取或设置服务名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string ServiceName { get; set; } = default!; + + /// + /// 获取或设置价格。 + /// + [Newtonsoft.Json.JsonProperty("price")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberReadOnlyConverter))] + [System.Text.Json.Serialization.JsonPropertyName("price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal Price { get; set; } + + /// + /// 获取或设置价格币种。 + /// + [Newtonsoft.Json.JsonProperty("currency")] + [System.Text.Json.Serialization.JsonPropertyName("currency")] + public string Currency { get; set; } = default!; + + /// + /// 获取或设置预计最早运输时间戳。 + /// + [Newtonsoft.Json.JsonProperty("delivery_time_start")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_time_start")] + public int DeliveryTimestampStart { get; set; } + + /// + /// 获取或设置预计最晚运输时间戳。 + /// + [Newtonsoft.Json.JsonProperty("delivery_time_end")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_time_end")] + public int DeliveryTimestampEnd { get; set; } + + /// + /// 获取或设置运输服务商 ID。 + /// + [Newtonsoft.Json.JsonProperty("provider_id")] + [System.Text.Json.Serialization.JsonPropertyName("provider_id")] + public string? ProviderId { get; set; } + + /// + /// 获取或设置运输服务商名称 + /// + [Newtonsoft.Json.JsonProperty("provider_name")] + [System.Text.Json.Serialization.JsonPropertyName("provider_name")] + public string? ProviderName { get; set; } + + /// + /// 获取或设置是否默认。 + /// + [Newtonsoft.Json.JsonProperty("is_default")] + [System.Text.Json.Serialization.JsonPropertyName("is_default")] + public bool? IsDefault { get; set; } + } + } + + /// + /// 获取或设置包裹 ID。 + /// + [Newtonsoft.Json.JsonProperty("package_id")] + [System.Text.Json.Serialization.JsonPropertyName("package_id")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))] + public string PackageId { get; set; } = default!; + + /// + /// 获取或设置重量。 + /// + [Newtonsoft.Json.JsonProperty("weight")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberReadOnlyConverter))] + [System.Text.Json.Serialization.JsonPropertyName("weight")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal? Weight { get; set; } + + /// + /// 获取或设置重量单位。 + /// + [Newtonsoft.Json.JsonProperty("weight_unit")] + [System.Text.Json.Serialization.JsonPropertyName("weight_unit")] + public int? WeightUnit { get; set; } + + /// + /// 获取或设置尺寸信息。 + /// + [Newtonsoft.Json.JsonProperty("dimension")] + [System.Text.Json.Serialization.JsonPropertyName("dimension")] + public Types.Dimension? Dimension { get; set; } + + /// + /// 获取或设置尺寸单位。 + /// + [Newtonsoft.Json.JsonProperty("dimension_unit")] + [System.Text.Json.Serialization.JsonPropertyName("dimension_unit")] + public int? DimensionUnit { get; set; } + + /// + /// 获取或设置货运服务列表。 + /// + [Newtonsoft.Json.JsonProperty("shipping_service_info")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_service_info")] + public Types.ShippingServiceInfo[] ShippingServiceList { get; set; } = default!; + } + } + } +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentCreateLabelRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentCreateLabelRequest.json new file mode 100644 index 00000000..1cbdacb2 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentCreateLabelRequest.json @@ -0,0 +1,12 @@ +{ + "dimension": { + "height": "0.03", + "length": "1.2", + "width": "0.2" + }, + "dimension_unit": 2, + "package_id": "2882335594258860015", + "shipping_service_id": "288233559123860015", + "weight": "1.2", + "weight_unit": 2 +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentCreateLabelResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentCreateLabelResponse.json new file mode 100644 index 00000000..e555897d --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentCreateLabelResponse.json @@ -0,0 +1,26 @@ +{ + "code": 0, + "data": { + "dimension": { + "height": "0.03", + "length": "1.2", + "width": "0.2" + }, + "dimension_unit": 2, + "package_id": "2882335594258860015", + "shipping_service_info": { + "currency": "dollar", + "delivery_time_end": 5, + "delivery_time_start": 3, + "id": "288233559123860015", + "name": "UPS-first class", + "price": "10", + "provider_id": "288232259123860012", + "provider_name": "UPS" + }, + "weight": "1.2", + "weight_unit": 2 + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentGetShippingServiceRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentGetShippingServiceRequest.json new file mode 100644 index 00000000..f1ac388b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentGetShippingServiceRequest.json @@ -0,0 +1,11 @@ +{ + "dimension": { + "height": "0.04", + "length": "0.3", + "width": "0.2" + }, + "dimension_unit": 2, + "package_id": "2882335594258860015", + "weight": "0.4", + "weight_unit": 2 +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentGetShippingServiceResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentGetShippingServiceResponse.json new file mode 100644 index 00000000..2326720b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/Fulfillment/FulfillmentGetShippingServiceResponse.json @@ -0,0 +1,29 @@ +{ + "code": 0, + "data": { + "dimension": { + "height": "0.04", + "length": "0.3", + "width": "0.2" + }, + "dimension_unit": 2, + "package_id": "2882335594258860015", + "shipping_service_info": [ + { + "currency": "dollar", + "delivery_time_end": 5, + "delivery_time_start": 3, + "id": "288233559123860015", + "is_default": false, + "name": "UPS-first class", + "price": "5", + "provider_id": "288233559123860012", + "provider_name": "UPS" + } + ], + "weight": "0.4", + "weight_unit": 2 + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} From 411727771536d303bef12f3898ec891ebc50c916 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 22:51:16 +0800 Subject: [PATCH 12/12] feat(tiktokshop): bump version to v3.0.0 --- CHANGELOG.md | 74 +++++++++++-------- .../README.md | 2 +- ...tpClient.ByteDance.TikTokGlobalShop.csproj | 6 +- 3 files changed, 47 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4c9629d..5981545f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,7 @@ [展开查看] -- Release 2.5.0 +- Release 2.5.0 (2023-07-17) - **新增**:新增担保支付自动结算结果查询接口。(_via_ [GitHub #12](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.ByteDance/pull/12)) @@ -41,19 +41,19 @@ - **新增**:随官方更新泛知识课程库添加和修改泛课程接口模型。(_via_ [GitHub #18](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.ByteDance/pull/18)) -- Release 2.4.1 +- Release 2.4.1 (2023-06-23) - **修复**:修复部分服务商授权相关接口模型定义错误。(_via_ [GitHub #11](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.ByteDance/pull/11)) - **修复**:修复回调通知事件验证签名错误。(_via_ [GitHub #11](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.ByteDance/pull/11)) -- Release 2.4.0 +- Release 2.4.0 (2023-03-28) - **新增**:新增担保支付账单相关接口。 - **新增**:新增直播小玩法相关接口。 -- Release 2.3.0 +- Release 2.3.0 (2023-02-21) - **新增**:新增若干服务商平台代商家管理小程序相关的回调通知事件模型。 @@ -63,7 +63,7 @@ - **修复**:修复泛知识课程库接入点错误。 -- Release 2.2.0 +- Release 2.2.0 (2023-02-20) - **新增**:新增小程序获取已设置的服务类目、上传资源、订阅消息模板库、剪映视频模板、抖音开放能力、普通二维码绑定、流量主等相关接口。 @@ -75,7 +75,7 @@ - **变更**:移除部分已废弃接口。 -- Release 2.1.0 +- Release 2.1.0 (2023-01-17) - **新增**:新增小程序挂载、分发、引导关注抖音号、数据分析等相关接口。 @@ -83,11 +83,11 @@ - **变更**:标记获取粉丝列表、获取关注列表接口为已废弃。 -- Release 2.0.0 +- Release 2.0.0 (2022-12-06) - **变更**:升级公共组件至 v2.6.0。 -- Release 1.4.0 +- Release 1.4.0 (2022-12-04) - **新增**:新增 UrlLink 分享相关接口。 @@ -99,19 +99,19 @@ - **变更**:标记 v1 版授权登录接口为已废弃。 -- Release 1.3.0 +- Release 1.3.0 (2022-08-24) - **新增**:新增担保支付进件、退分账、提现相关接口。 - **新增**:随官方更新担保支付接口获取页面链接相关接口。 -- Release 1.2.0 +- Release 1.2.0 (2022-05-02) - **新增**:新增独立的小游戏接入点。 - **变更**:重命名部分接口模型,将路由中的版本号信息后置。 -- Release 1.1.0 +- Release 1.1.0 (2022-05-02) - **新增**:新增小程序任务后台任务上传接口。 @@ -125,7 +125,7 @@ - **变更**:统一接口响应模型中关于错误代码的字段。 -- Release 1.0.0 +- Release 1.0.0 (2022-03-01) - 首次发布。 @@ -139,13 +139,13 @@ [展开查看] -- Release 2.4.0 +- Release 2.4.0 (2023-05-25) - **新增**:新增创建图文相关接口。 - **新增**:随官方上传视频、分片上传视频、创建视频等接口地址。 -- Release 2.3.0 +- Release 2.3.0 (2023-04-15) - **新增**:新增互动管理场景跳转相关接口。 @@ -153,11 +153,11 @@ - **变更**:移除头条视频、西瓜视频相关接口。 -- Release 2.2.1 +- Release 2.2.1 (2023-02-28) - **修复**:修复生活服务开放能力门店信息查询接口响应模型定义错误。(_via_ [Gitee #I6IG50](https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.ByteDance/issues/I6IG50)) -- Release 2.2.0 +- Release 2.2.0 (2023-02-27) - **新增**:新增部分抖音生活服务相关 Webhook 事件模型。 @@ -165,21 +165,21 @@ - **变更**:重命名扩展方法 `DouyinOpenClient.DecryptMobileNumber` 为 `DouyinOpenClient.DecryptOAuthUserInfoMobileNumber`。 -- Release 2.1.0 +- Release 2.1.0 (2023-02-21) - **新增**:新增物料配置相关接口。 - **新增**:新增抖音生活服务创建适用人群、代运营、外卖等相关接口。 -- Release 2.0.1 +- Release 2.0.1 (2023-02-06) - **修复**:修复刷新接口调用凭证接口模型定义错误。 -- Release 2.0.0 +- Release 2.0.0 (2022-12-06) - **变更**:升级公共组件至 v2.6.0。 -- Release 1.4.0 +- Release 1.4.0 (2022-12-05) - **新增**:新增部分生活服务开放能力抖音生活服务相关接口。 @@ -187,7 +187,7 @@ - **修复**:修复 `TikTokClientResponseExtra` 类型的拼写错误。 -- Release 1.3.0 +- Release 1.3.0 (2022-12-04) - **新增**:随官方更新抖音视频相关接口模型。 @@ -195,7 +195,7 @@ - **变更**:移除部分已废弃接口。 -- Release 1.2.0 +- Release 1.2.0 (2022-08-25) - **新增**:新增服务市场开放能力相关接口。 @@ -205,7 +205,7 @@ - **变更**:调整 `TikTokClientOptions.Endpoints` 的默认值。 -- Release 1.1.0 +- Release 1.1.0 (2022-05-02) - **新增**:新增生活服务开放能力商品库接入相关接口。 @@ -213,7 +213,7 @@ - **变更**:升级公共组件至 v2.5.0。 -- Release 1.0.0 +- Release 1.0.0 (2022-03-07) - 首次发布。 @@ -227,19 +227,19 @@ [展开查看] -- Release 3.0.0 +- Release 3.0.0 (2024-03-04) - **新增**:新增内容发布(Content Posting)、个人数据可携带权(Data Portability)、调研(Research)、商业化内容(Commercial Content)等相关接口。 - - **变更**:升级公共组件至 v3.0.0。完整变更说明请参阅迁移指南。 - - **变更**:移除原 v1 版 API 客户端。 -- Release 2.1.0 + - **变更**:升级公共组件至 v3.0.0。完整变更说明请参阅迁移指南。 + +- Release 2.1.0 (2023-03-11) - **新增**:支持 OAuth、用户等相关的 v2 版 API。 -- Release 2.0.0 +- Release 2.0.0 (2022-12-06) - 首次发布。 @@ -253,11 +253,23 @@ [展开查看] -- Release 2.1.0 +- Release 3.0.0 (2024-03-04) + + - **新增**:新增获取商品库存列表接口。 + + - **新增**:新增商品预检接口。 + + - **新增**:新增获取运输服务接口。 + + - **新增**:随官方更新商品、订单等相关接口模型。 + + - **变更**:升级公共组件至 v3.0.0。完整变更说明请参阅迁移指南。 + +- Release 2.1.0 (2023-05-09) - **新增**:新增创建品牌接口。 -- Release 2.0.0 +- Release 2.0.0 (2023-03-28) - 首次发布。 diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/README.md b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/README.md index 51d87e12..52218251 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/README.md +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/README.md @@ -10,7 +10,7 @@ ### 【功能特性】 -- 基于 TikTok Shop Open Platform API 封装。 +- 基于 TikTok Shop Open Platform API v202309 封装。 - 请求时自动生成签名,无需开发者手动干预。 - 提供了 HMAC-SHA-256 等算法工具类。 diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.csproj b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.csproj index 5dc7adef..e174211f 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.csproj +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.csproj @@ -1,7 +1,7 @@ - net461; netstandard2.0; net6.0 + net462; netstandard2.0; net6.0 10.0 enable true @@ -14,7 +14,7 @@ MIT https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.ByteDance Flurl.Http ByteDance TikTok TikTokShop TikTokShopPartner TikTokShopOpenPlatform TikTokShopOpenAPI TTS TTSPartner TTSOpenPlatform TTSOpenAPI 字节 字节跳动 抖音国际版 抖音国际版电商 抖音跨境电商 抖音跨境电商开放平台 - 3.0.0-preview.1 + 3.0.0 基于 Flurl.Http 的 TikTok Shop Open Platform API 客户端。 The TikTok Shop Open Platform API SDK for .NET. (Offical Website: https://partner.tiktokshop.com/) @@ -39,7 +39,7 @@ - +