diff --git a/platformapi/jdapi/order_test.go b/platformapi/jdapi/order_test.go index a03e55a0..6802b5be 100644 --- a/platformapi/jdapi/order_test.go +++ b/platformapi/jdapi/order_test.go @@ -109,7 +109,7 @@ func TestGetAfsService2(t *testing.T) { } func TestOrderShoudSettlementService2(t *testing.T) { - result, err := api.OrderShoudSettlementService2("2230697160000272") + result, err := api.OrderShoudSettlementService2("2230776748000074") if err != nil { t.Fatal(err.Error()) } diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index 573d159c..93b6fde9 100644 --- a/platformapi/tiktok_shop/tiktok_api/afs_test.go +++ b/platformapi/tiktok_shop/tiktok_api/afs_test.go @@ -8,18 +8,13 @@ import ( "testing" ) -//var token = `{ -// "access_token": "b668f8cc-d875-4887-a613-5452f05e752e", -// "expires_in": 1671432212, -// "scope": "SCOPE", -// "shop_id": 63141688, -// "shop_name": "小时达开放平台专用店", -// "refresh_token": "fa64fedf-05a7-4c1b-b6c4-f97f90e10b75", -// "authority_id": "" -//}` - +// 菜市账号 //var token = `{"access_token":"e8b6c1bc-2477-40ff-bd8e-faf547669d77","expires_in":1671431173,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"3cd84170-73a0-485c-b55a-74e128618693","authority_id":""}` -var token = `{"access_token":"83e52462-ad46-4297-98c4-242ee6b7a5c8","expires_in":1672033612,"scope":"SCOPE","shop_id":63141688,"shop_name":"二期-抖音超市小时达测试店铺","refresh_token":"8f690bc3-3f3e-49bd-bbf7-31c9e868e980","authority_id":""}` +//var token = `{"access_token":"83e52462-ad46-4297-98c4-242ee6b7a5c8","expires_in":1672033612,"scope":"SCOPE","shop_id":63141688,"shop_name":"二期-抖音超市小时达测试店铺","refresh_token":"8f690bc3-3f3e-49bd-bbf7-31c9e868e980","authority_id":""}` +//var a = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token) + +// 超市账号 +var token = `{"access_token":"99961136-7f45-4da1-9b4a-28cdbe90132b","expires_in":1672280107,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"61551caf-925e-4654-9408-c76ef7520392","authority_id":""}` var a = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token) // 查询售后单详情 diff --git a/platformapi/tiktok_shop/tiktok_api/sku_type.go b/platformapi/tiktok_shop/tiktok_api/sku_type.go index 83e7861e..9a71ee66 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_type.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_type.go @@ -7,9 +7,13 @@ type Imgs struct { // 抖店文件夹id写死两个 const ( - TiktokFolder1 = "71580417560930552391570" // 文件夹(京西菜市) - TiktokFolder2 = "71482723234545339291960" - TiktokFolder3 = "71762017122139835211688" // (方案二测试文件夹) + TiktokFolder1 = "71580417560930552391570" // 文件夹(京西菜市) + TiktokFolder2 = "71482723234545339291960" + TiktokFolder3 = "71762017122139835211688" // (方案二测试文件夹) + TiktokShoppingFolder = "71802347591117703711619" // (方案二测试文件夹) + TiktokFloderKeyVegetableKey = 57939570 // (菜市的文件夹id) + TiktokFloderKeyShoppingKey = 68023619 // (商超账号的文件夹id) + TiktokFloderKeyTestKey = 63141688 // (测试账号) ) // 商品减库存类型 diff --git a/platformapi/tiktok_shop/tiktok_api/sku_warehouse.go b/platformapi/tiktok_shop/tiktok_api/sku_warehouse.go index 8abd9b41..0df2b753 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_warehouse.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_warehouse.go @@ -44,14 +44,17 @@ func (a *API) BatchUploadImages(imgs []Imgs) (map[string]material_batchUploadIma for i := 0; i < len(imgs); i++ { img := material_batchUploadImageSync_request.MaterialsItem{ RequestId: imgs[i].Name, - FolderId: TiktokFolder1, // 默认存储 MaterialType: "photo", Name: imgs[i].Name, Url: imgs[i].Url, } - // 测试文件夹 - if a.accessTokenObj.ShopId == 63141688 { + switch a.accessTokenObj.ShopId { + case TiktokFloderKeyTestKey: img.FolderId = TiktokFolder3 + case TiktokFloderKeyShoppingKey: + img.FolderId = TiktokShoppingFolder + case TiktokFloderKeyVegetableKey: + img.FolderId = TiktokFolder1 } param = append(param, img) } diff --git a/platformapi/tiktok_shop/tiktok_api/sku_warehouse_test.go b/platformapi/tiktok_shop/tiktok_api/sku_warehouse_test.go index 28fdbc5c..ad63aa51 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_warehouse_test.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_warehouse_test.go @@ -24,7 +24,7 @@ func init() { } func TestCreateFolad(t *testing.T) { - data, err := a.CreateFolder("shop_63141688") + data, err := a.CreateFolder("shopping_folder") fmt.Println("err=====", err) fmt.Println("LogId====", data.LogId) //2022092811422001020812109607601B77 fmt.Println("data====", data.Data.Name) // jxcs_folder