From 85c6ebe7c4da6590d6b29d17940d71c2b454d0a5 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 4 Mar 2024 10:50:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(tiktokshop):=20=E5=8D=87=E7=BA=A7=E5=85=AC?= =?UTF-8?q?=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\\" + } }