Skip to content

Commit 61813a4

Browse files
committed
feat(tiktokshop): 随官方更新商品相关接口模型
1 parent 927fa5c commit 61813a4

5 files changed

Lines changed: 53 additions & 10 deletions

File tree

src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/Category/ProductGetCategoryRulesResponse.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,35 @@ public static class Types
1313
{
1414
public class Certification
1515
{
16+
public static class Types
17+
{
18+
public class RequirementCondition
19+
{
20+
/// <summary>
21+
/// 获取或设置条件类型。
22+
/// </summary>
23+
[Newtonsoft.Json.JsonProperty("condition_type")]
24+
[System.Text.Json.Serialization.JsonPropertyName("condition_type")]
25+
public string ConditionType { get; set; } = default!;
26+
27+
/// <summary>
28+
/// 获取或设置属性 ID。
29+
/// </summary>
30+
[Newtonsoft.Json.JsonProperty("attribute_id")]
31+
[System.Text.Json.Serialization.JsonPropertyName("attribute_id")]
32+
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
33+
public string AttributeId { get; set; } = default!;
34+
35+
/// <summary>
36+
/// 获取或设置属性值 ID。
37+
/// </summary>
38+
[Newtonsoft.Json.JsonProperty("attribute_value_id")]
39+
[System.Text.Json.Serialization.JsonPropertyName("attribute_value_id")]
40+
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalStringReadOnlyConverter))]
41+
public string AttributeValueId { get; set; } = default!;
42+
}
43+
}
44+
1645
/// <summary>
1746
/// 获取或设置商品认证 ID。
1847
/// </summary>
@@ -41,6 +70,13 @@ public class Certification
4170
[Newtonsoft.Json.JsonProperty("is_required")]
4271
[System.Text.Json.Serialization.JsonPropertyName("is_required")]
4372
public bool IsRequired { get; set; }
73+
74+
/// <summary>
75+
/// 获取或设置必需条件列表。
76+
/// </summary>
77+
[Newtonsoft.Json.JsonProperty("requirement_conditions")]
78+
[System.Text.Json.Serialization.JsonPropertyName("requirement_conditions")]
79+
public Types.RequirementCondition[]? RequirementConditionList { get; set; }
4480
}
4581

4682
public class SizeChart

src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetListingSchemasRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ public class ProductGetListingSchemasRequest : TikTokShopRequest
99
{
1010
/// <summary>
1111
/// 获取或设置 API 版本号。
12-
/// <para>默认值:202401</para>
12+
/// <para>默认值:202407</para>
1313
/// </summary>
1414
[Newtonsoft.Json.JsonIgnore]
1515
[System.Text.Json.Serialization.JsonIgnore]
16-
public override int ApiVersion { get; set; } = 202401;
16+
public override int ApiVersion { get; set; } = 202407;
1717

1818
/// <summary>
1919
/// 获取或设置分类 ID 列表。

src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Product/ProductGetListingSchemasResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ public class Option
102102
/// <summary>
103103
/// 获取或设置字段列表。
104104
/// </summary>
105-
[Newtonsoft.Json.JsonProperty("fileds")]
106-
[System.Text.Json.Serialization.JsonPropertyName("fileds")]
105+
[Newtonsoft.Json.JsonProperty("fields")]
106+
[System.Text.Json.Serialization.JsonPropertyName("fields")]
107107
public Types.Field[] FieldList { get; set; } = default!;
108108
}
109109

test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Product/Category/ProductGetCategoryRulesResponse.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
"id": "602362",
1616
"is_required": true,
1717
"name": "SNI Certificate",
18+
"requirement_conditions": [
19+
{
20+
"attribute_id": "101610",
21+
"attribute_value_id": "1024358",
22+
"condition_type": "VALUE_ID_MATCH"
23+
}
24+
],
1825
"sample_image_url": "https://p-boei18n.byted.org/tos-boei18n-i-jvtte31kaf/80b32f2896829eeb69d4b278c4f3aa75.jpg~tplv-jvtte31kaf-origin-jpeg.jpeg"
1926
}
2027
],

test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Product/ProductGetListingSchemasResponse.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"listing_schemas": [
1414
{
1515
"category_id": 60001,
16-
"fileds": [
16+
"fields": [
1717
{
1818
"complex_values": [
1919
{
@@ -27,7 +27,7 @@
2727
],
2828
"rules": [
2929
{
30-
"type": "MULTIINPUT",
30+
"type": "REQUIRED",
3131
"value": "true"
3232
}
3333
]
@@ -37,14 +37,14 @@
3737
"name": "product_attributes",
3838
"options": [
3939
{
40-
"id": " ",
41-
"name": " "
40+
"id": " ",
41+
"name": " "
4242
}
4343
],
4444
"rules": [
4545
{
46-
"type": "REQUIRED",
47-
"value": "true"
46+
"type": "MAX_LENGTH",
47+
"value": "20"
4848
}
4949
]
5050
}

0 commit comments

Comments
 (0)