From bba31a84a20ea8775ea9194ddb20883b43883868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 31 Jul 2025 13:35:32 +0800 Subject: [PATCH] 1 --- .../request/product_listV2_request.go | 2 + .../tiktok_shop/tiktok_api/sku_test.go | 66 ++++++++----------- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_listV2/request/product_listV2_request.go b/platformapi/tiktok_shop/sdk-golang/api/product_listV2/request/product_listV2_request.go index 554b5b13..68902ffd 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/product_listV2/request/product_listV2_request.go +++ b/platformapi/tiktok_shop/sdk-golang/api/product_listV2/request/product_listV2_request.go @@ -73,4 +73,6 @@ type ProductListV2Param struct { UpdateEndTime int64 `json:"update_end_time"` // 小时达商家使用的门店id StoreId int64 `json:"store_id"` + // 商品ID,最大一百个 + ProductId []string `json:"product_id"` } diff --git a/platformapi/tiktok_shop/tiktok_api/sku_test.go b/platformapi/tiktok_shop/tiktok_api/sku_test.go index 96114079..e505c6a3 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_test.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_test.go @@ -55,7 +55,7 @@ func TestGetSkuDetail(t *testing.T) { // 查询商品详情本地商品id func TestGetSkuDetailLocalId(t *testing.T) { - data, err := a.GetSkuDetail("3765731983553069079", "") + data, err := a.GetSkuDetail("3749491763019120942", "") fmt.Println(err) globals.SugarLogger.Debugf("====%s", utils.Format4Output(data, false)) } @@ -175,49 +175,41 @@ func TestBatchDecrypt(t *testing.T) { fmt.Println(err) } -var c = []int64{ - 64251217, - 64251215, - 64251213, - 64251212, - 64251211, -} +var c = []int64{} // 删除已经创建商品,重新同步 func TestDeleteSkuAndUploadSku(t *testing.T) { var errList = make([]error, 0, 0) - for _, v := range c { - for i := 1; i < 100; i++ { - result, err := a.GetSkuDetailList(&product_listV2_request.ProductListV2Param{ - Status: 0, - CheckStatus: 3, // 1-未提交;2-待审核;3-审核通过;4-审核未通过;5-封禁;7-审核通过待上架 - Page: int64(i), - Size: 100, - StoreId: v, - }) - if err != nil { - continue - } - if len(result.Data) == 0 { - break - } - - for i2, v2 := range result.Data { - if v2.ProductId == 3592586515512991033 { - fmt.Println("aa") - } - var sonSkuid int64 = 0 - if len(v2.SpecPrices) != 0 { - sonSkuid = v2.SpecPrices[0].Id - } - sql := fmt.Sprintf(` UPDATE store_sku_bind SET vendor_son_sku_id = "%d" WHERE dd_id = "%d";`, sonSkuid, v2.ProductId) - fmt.Println(i2-i2, sql) - } - - } + //for _, v := range c { + //for i := 1; i < 100; i++ { + result, err := a.GetSkuDetailList(&product_listV2_request.ProductListV2Param{ + //Status: 0, + //CheckStatus: 3, // 1-未提交;2-待审核;3-审核通过;4-审核未通过;5-封禁;7-审核通过待上架 + Page: int64(1), + Size: 100, + ProductId: []string{ + "3603821366169751183"}, + }) + if err != nil { + fmt.Println(err) } + for i2, v2 := range result.Data { + if v2.ProductId == 3592586515512991033 { + fmt.Println("aa") + } + var sonSkuid int64 = 0 + if len(v2.SpecPrices) != 0 { + sonSkuid = v2.SpecPrices[0].Id + } + sql := fmt.Sprintf(` UPDATE store_sku_bind SET vendor_son_sku_id = "%d" WHERE dd_id = "%d";`, sonSkuid, v2.ProductId) + fmt.Println(i2-i2, sql) + } + + //} + //} + for _, v := range errList { globals.SugarLogger.Debugf("err := %s", utils.Format4Output(v, false)) }