From 0c9420593e03cfe760c6342a5f1faa2f4131dff0 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Tue, 8 Nov 2022 13:49:48 +0800 Subject: [PATCH] createwarehouse param --- .../request/warehouse_create_request.go | 2 +- .../response/warehouse_create_response.go | 2 +- .../tiktok_shop/tiktok_api/afs_test.go | 2 +- .../tiktok_shop/tiktok_api/store_test.go | 24 +++++++++++++++---- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/platformapi/tiktok_shop/sdk-golang/api/warehouse_create/request/warehouse_create_request.go b/platformapi/tiktok_shop/sdk-golang/api/warehouse_create/request/warehouse_create_request.go index 1fb23152..1ed3cf93 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/warehouse_create/request/warehouse_create_request.go +++ b/platformapi/tiktok_shop/sdk-golang/api/warehouse_create/request/warehouse_create_request.go @@ -12,7 +12,7 @@ type WarehouseCreateRequest struct { } func (c *WarehouseCreateRequest) GetUrlPath() string { - return "/warehouse/create" + return "/warehouse/createV2" } func New() *WarehouseCreateRequest { diff --git a/platformapi/tiktok_shop/sdk-golang/api/warehouse_create/response/warehouse_create_response.go b/platformapi/tiktok_shop/sdk-golang/api/warehouse_create/response/warehouse_create_response.go index 1ca1423f..ed141dae 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/warehouse_create/response/warehouse_create_response.go +++ b/platformapi/tiktok_shop/sdk-golang/api/warehouse_create/response/warehouse_create_response.go @@ -8,5 +8,5 @@ type WarehouseCreateResponse struct { } type WarehouseCreateData struct { // 仓库id - Data int64 `json:"data"` + WarehouseId string `json:"warehouse_id"` } diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index df1671c4..4c6d4c38 100644 --- a/platformapi/tiktok_shop/tiktok_api/afs_test.go +++ b/platformapi/tiktok_shop/tiktok_api/afs_test.go @@ -8,7 +8,7 @@ import ( "time" ) -var token = `{"access_token":"d590b649-0dd9-4988-a5e2-bf7e06e2f105","expires_in":1667808519,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"f57c6a55-af5f-45ca-8ade-b2282be86341","authority_id":""}` +var token = `{"access_token":"4a9e3612-7b23-4443-be73-c994f8462b1c","expires_in":1668413647,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"20d0ebb2-fefe-4ae6-b902-c35b8459b74a","authority_id":""}` var a = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token) // 查询售后单详情 diff --git a/platformapi/tiktok_shop/tiktok_api/store_test.go b/platformapi/tiktok_shop/tiktok_api/store_test.go index d679aa32..79c3884a 100644 --- a/platformapi/tiktok_shop/tiktok_api/store_test.go +++ b/platformapi/tiktok_shop/tiktok_api/store_test.go @@ -13,6 +13,7 @@ import ( warehouse_bindFences_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_bindFences/request" warehouse_bindFencesByStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_bindFencesByStore/request" warehouse_bindStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_bindStore/request" + warehouse_create_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_create/request" warehouse_createBatch_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_createBatch/request" warehouse_createFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_createFence/request" warehouse_setFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_setFence/request" @@ -220,9 +221,7 @@ func TestUpdateStore(t *testing.T) { //获取门店绑定仓库 func TestGetWarehouseByStore(t *testing.T) { - accesstoken := `{"access_token":"d590b649-0dd9-4988-a5e2-bf7e06e2f105","expires_in":1667808519,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"f57c6a55-af5f-45ca-8ade-b2282be86341","authority_id":""}` - a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken) - resp, err := a.GetWarehouseByStore(69608467) + resp, err := a.GetWarehouseByStore(65402632) fmt.Println(resp) fmt.Println(err) } @@ -337,9 +336,26 @@ func TestGetStoreBindFreight(t *testing.T) { //仓库 //创建单个仓库 +func TestCreateWarehouse(t *testing.T) { + warehouseID, err := a.CreateWarehouse(&warehouse_create_request.WarehouseCreateParam{ + OutWarehouseId: "test1108", + Intro: "这是一个测试区域仓", + Warehouse: &warehouse_create_request.Warehouse{ + AddressDetail: "这是一个测试仓库地址", + WarehouseLocation: &warehouse_create_request.WarehouseLocation{ + AddressId1: 35, + AddressId2: 350100, + AddressId3: 350104, + AddressId4: 0, + }, + }, + }) + fmt.Println(warehouseID) + fmt.Println(err) +} // 批量创建区域仓 -func TestCreateWarehouse(t *testing.T) { +func TestBatchCreateWarehouse(t *testing.T) { token := `{"access_token":"a1746210-a8a3-4497-a87b-09d1f10dbb95","expires_in":1665652230,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"c1cf8d88-0983-4f2a-b969-3746fae6b0cd","authority_id":""}` a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)