This commit is contained in:
邹宗楠
2022-10-09 17:47:14 +08:00
parent 90ce416eba
commit 3baab718b1

View File

@@ -4,6 +4,8 @@ import (
"fmt"
freightTemplate_create_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/freightTemplate_create/request"
shop_batchCreateStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/request"
warehouse_bindStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_bindStore/request"
warehouse_createBatch_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_createBatch/request"
"git.rosy.net.cn/baseapi/utils"
"math/rand"
"testing"
@@ -63,3 +65,40 @@ func TestAPI_CreateTradeLimitTemplate(t *testing.T) {
Columns: nil,
})
}
// 批量创建区域仓
func TestCreateWarehouse(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)
data, err := a.BatchCreateWarehouse(&warehouse_createBatch_request.WarehouseCreateBatchParam{
OutWarehouseList: []warehouse_createBatch_request.OutWarehouseListItem{
{
OutWarehouseId: "666667",
Name: "火车南站仓库",
Intro: "这是一个火车南站的仓库,仓库id为京西门店id",
AddressDetail: "四川省成都市新都区大丰镇南丰大道37号",
WarehouseLocation: &warehouse_createBatch_request.WarehouseLocation{
AddressId1: 51,
AddressId2: 510100,
AddressId3: 510114,
AddressId4: 0,
},
},
}})
fmt.Println(data)
fmt.Println(err)
}
// 仓库绑定门店
func TestBindWarehouseToStore(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)
data, err := a.StoreBindWarehouse(&warehouse_bindStore_request.WarehouseBindStoreParam{
StoreIds: []int64{63114504},
OutWarehouseId: "666667",
})
fmt.Println(data)
fmt.Println(err)
}