This commit is contained in:
邹宗楠
2023-10-10 16:26:01 +08:00
parent 5a96151629
commit fae696dd91
4 changed files with 15 additions and 15 deletions

View File

@@ -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)

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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))