From d838356f85bf45fa8f02561e39ab9e9bbee7c460 Mon Sep 17 00:00:00 2001 From: QiuSW <105186638@qq.com> Date: Wed, 16 Sep 2026 09:43:34 +0800 Subject: [PATCH] recognize Chinese size variation names --- app/admin/apis/shopee_product_spec.go | 2 +- app/admin/apis/shopee_product_spec_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/apis/shopee_product_spec.go b/app/admin/apis/shopee_product_spec.go index 0c7d2f5..460de79 100644 --- a/app/admin/apis/shopee_product_spec.go +++ b/app/admin/apis/shopee_product_spec.go @@ -125,7 +125,7 @@ func extractProductSpec(itemInfo json.RawMessage) (productSpec, error) { switch { case strings.Contains(name, "颜色"), strings.Contains(name, "顏色"), strings.Contains(name, "color"): target, seen = &spec.Color, colorSeen - case strings.Contains(name, "尺码"), strings.Contains(name, "尺碼"), strings.Contains(name, "size"): + case strings.Contains(name, "尺码"), strings.Contains(name, "尺碼"), strings.Contains(name, "尺寸"), strings.Contains(name, "size"): target, seen = &spec.Size, sizeSeen default: continue diff --git a/app/admin/apis/shopee_product_spec_test.go b/app/admin/apis/shopee_product_spec_test.go index 851000c..41c2ad1 100644 --- a/app/admin/apis/shopee_product_spec_test.go +++ b/app/admin/apis/shopee_product_spec_test.go @@ -13,7 +13,7 @@ func TestExtractProductSpec(t *testing.T) { {"variationOptionName":"黑色 微喇褲夏款"}, {"variationOptionName":"黑色 微喇褲夏款"} ]}, - {"variationName":"尺碼","variationOptionList":[ + {"variationName":"尺寸","variationOptionList":[ {"variationOptionName":"4XL 77.5-87.5公斤"} ]} ]