1
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package tiktok_api
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
var token = `{"access_token":"2baa1126-bba0-4510-8ffa-6af55ba0bdbd","expires_in":1670828768,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"23b3eb4e-bb00-4b85-952d-de47801de80d","authority_id":""}`
|
||||
@@ -30,5 +30,12 @@ func TestGetSkuDetailLocalID(t *testing.T) {
|
||||
|
||||
//
|
||||
func TestName(t *testing.T) {
|
||||
fmt.Println(time.Now().Day())
|
||||
body := `[{
|
||||
"tag": "101",
|
||||
"msg_id": "69793528590852580050:0:101:1670233754:1024588978:7136048270014416392",
|
||||
"data": "{\"biz\":2,\"order_status\":2,\"order_type\":0,\"p_id\":5008525809582539796,\"pay_amount\":2640,\"pay_time\":1670233752,\"pay_type\":1,\"s_ids\":[5008525809582539796],\"shop_id\":57939570}"
|
||||
}]`
|
||||
signParam := a.appKey + body + a.appSecret
|
||||
sign := fmt.Sprintf("%X", md5.Sum([]byte(signParam)))
|
||||
fmt.Println(sign)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ func TestApi(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestQueryOrderDetail(t *testing.T) {
|
||||
data, err := a.GetTiktokOrderDetail("4996895368866964710")
|
||||
data, err := a.GetTiktokOrderDetail("5008526050099613284")
|
||||
globals.SugarLogger.Debugf("=====%s", utils.Format4Output(data, false))
|
||||
globals.SugarLogger.Debugf("=====%s", err)
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ func (a *API) StoreBindWarehouse(param *warehouse_bindStore_request.WarehouseBin
|
||||
}
|
||||
|
||||
//获取门店绑定的仓库信息
|
||||
func (a *API) GetWarehouseByStore(storeID int64) (map[int64][]warehouse_getWarehouseByStore_response.WarehouseInfoMapItem, error) {
|
||||
func (a *API) GetWarehouseByStore(storeID int64) (*warehouse_getWarehouseByStore_response.WarehouseGetWarehouseByStoreData, error) {
|
||||
request := warehouse_getWarehouseByStore_request.New()
|
||||
request.Param.StoreIds = append(request.Param.StoreIds, storeID)
|
||||
response, err := request.Execute(a.accessTokenObj)
|
||||
@@ -407,7 +407,7 @@ func (a *API) GetWarehouseByStore(storeID int64) (map[int64][]warehouse_getWareh
|
||||
if len(response.Data.WarehouseInfoMap) == 0 {
|
||||
return nil, errors.New(fmt.Sprintf("门店%d 暂时未绑定仓库,请进行绑定!", storeID))
|
||||
}
|
||||
return response.Data.WarehouseInfoMap, nil
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
//创建电子围栏
|
||||
|
||||
Reference in New Issue
Block a user