From fae696dd912c8141f204c783a87c34569d02b502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 10 Oct 2023 16:26:01 +0800 Subject: [PATCH] 1 --- platformapi/tiktok_shop/tiktok_api/afs_test.go | 2 +- .../tiktok_shop/tiktok_api/sku_delete_test.go | 14 +++++++++++--- platformapi/tiktok_shop/tiktok_api/store_test.go | 12 +++--------- .../tiktok_shop/tiktok_api/transport_test.go | 2 -- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index e9aa38b0..a95ae649 100644 --- a/platformapi/tiktok_shop/tiktok_api/afs_test.go +++ b/platformapi/tiktok_shop/tiktok_api/afs_test.go @@ -7,7 +7,7 @@ import ( "testing" ) -var token = `{"access_token":"719db06b-3fbf-461b-8cf2-e5ae70293cdc","expires_in":1695876413,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"8c478de3-8fbd-4535-a78c-06792b8a20a4","authority_id":""}` +var token = `{"access_token":"90283046-8f2b-46cf-90f1-e522b229e784","expires_in":1697080460,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"ae493f0f-97d8-43ca-9b0e-727480add1fa","authority_id":""}` var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token) diff --git a/platformapi/tiktok_shop/tiktok_api/sku_delete_test.go b/platformapi/tiktok_shop/tiktok_api/sku_delete_test.go index fddca0f6..d7db4aea 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_delete_test.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_delete_test.go @@ -18,9 +18,17 @@ func TestN2ame(t *testing.T) { } func TestGetRecommendCategory(t *testing.T) { - img, _, err := GetTiktokImgListTest(a, "668707", "", "", "http://img20.360buyimg.com/vc/jfs/t1/8979/39/8591/236012/5c0e45f3E1537c120/a66aafc95cf66977.jpg", "http://img20.360buyimg.com/vc/jfs/t1/23027/3/955/82830/5c0e45f3E0855eeae/ae65ee9555a29579.jpg") - fmt.Println(err) - data, err := a.GetRecommendCategory(strings.Split(img, "|")) + //img, _, err := GetTiktokImgListTest(a, "668707", "", "", "http://img20.360buyimg.com/vc/jfs/t1/8979/39/8591/236012/5c0e45f3E1537c120/a66aafc95cf66977.jpg", "http://img20.360buyimg.com/vc/jfs/t1/23027/3/955/82830/5c0e45f3E0855eeae/ae65ee9555a29579.jpg") + //fmt.Println(err) + img := []string{ + //"https://p3-aio.ecombdimg.com/obj/ecom-shop-material/VqGYBUaL_m_f229ad3ce7a93d906a2412709e363825_sx_762890_www750-3527", + "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/VqGYBUaL_m_7457cda4c101d05bcd2a1258b61d2ba1_sx_223234_www800-800", + //"https://p3-aio.ecombdimg.com/obj/ecom-shop-material/v1_GhxlaZ_70852585116381186630419_c55b8401b00e96e4114431a1dbd7c99c_sx_582346_www1000-1000", + } + var token = `{"access_token":"90283046-8f2b-46cf-90f1-e522b229e784","expires_in":1697080460,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"ae493f0f-97d8-43ca-9b0e-727480add1fa","authority_id":""}` + var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token) + + data, err := a.GetRecommendCategory(img) fmt.Println(data) fmt.Println(err) } diff --git a/platformapi/tiktok_shop/tiktok_api/store_test.go b/platformapi/tiktok_shop/tiktok_api/store_test.go index e28a17d7..14290e29 100644 --- a/platformapi/tiktok_shop/tiktok_api/store_test.go +++ b/platformapi/tiktok_shop/tiktok_api/store_test.go @@ -285,10 +285,8 @@ func TestGetWarehouseByStore(t *testing.T) { storeIDs := []int64{87542533} need := []int64{} errList := errlist.New() - var str = `{"access_token":"719db06b-3fbf-461b-8cf2-e5ae70293cdc","expires_in":1695876413,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"8c478de3-8fbd-4535-a78c-06792b8a20a4","authority_id":""}` - var apis = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", str) for _, v := range storeIDs { - resp, err := apis.GetWarehouseByStore(v) + resp, err := a.GetWarehouseByStore(v) if resp.WarehouseInfoMap[utils.Int64ToStr(v)] == nil || len(resp.WarehouseInfoMap[utils.Int64ToStr(v)][0].OutFenceIds) == 0 { need = append(need, v) } else { @@ -483,10 +481,8 @@ func TestCreateWarehouse(t *testing.T) { // 批量创建区域仓 func TestBatchCreateWarehouse(t *testing.T) { - token3 := `{"access_token":"719db06b-3fbf-461b-8cf2-e5ae70293cdc","expires_in":1695876413,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"8c478de3-8fbd-4535-a78c-06792b8a20a4","authority_id":""}` - a2 := New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token3) - data, err := a2.BatchCreateWarehouse(&warehouse_createBatch_request.WarehouseCreateBatchParam{ + data, err := a.BatchCreateWarehouse(&warehouse_createBatch_request.WarehouseCreateBatchParam{ OutWarehouseList: []warehouse_createBatch_request.OutWarehouseListItem{ { OutWarehouseId: "668841", @@ -507,9 +503,7 @@ func TestBatchCreateWarehouse(t *testing.T) { //查询四级地址全量省份信息 func TestGetProvince(t *testing.T) { - token3 := `{"access_token":"719db06b-3fbf-461b-8cf2-e5ae70293cdc","expires_in":1695876413,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"8c478de3-8fbd-4535-a78c-06792b8a20a4","authority_id":""}` - a2 := New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token3) - retVal, err := a2.GetProvince() + retVal, err := a.GetProvince() fmt.Println(utils.Format4Output(retVal, false)) fmt.Println(err) } diff --git a/platformapi/tiktok_shop/tiktok_api/transport_test.go b/platformapi/tiktok_shop/tiktok_api/transport_test.go index e919a9bb..4bb7332a 100644 --- a/platformapi/tiktok_shop/tiktok_api/transport_test.go +++ b/platformapi/tiktok_shop/tiktok_api/transport_test.go @@ -39,8 +39,6 @@ func Test(t *testing.T) { } func TestGetShipmentInfo(t *testing.T) { - var token = `{"access_token":"719db06b-3fbf-461b-8cf2-e5ae70293cdc","expires_in":1695876413,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"8c478de3-8fbd-4535-a78c-06792b8a20a4","authority_id":""}` - var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token) data, err := a.GetShipmentInfo(6922112012008166892, 0, ShipmentTypeInvoice) globals.SugarLogger.Debugf("======data := %s", utils.Format4Output(data, false)) globals.SugarLogger.Debugf("======data := %s", utils.Format4Output(err, false))