Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -36,8 +36,6 @@ var api2 = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", to
|
||||
|
||||
//创建店铺
|
||||
func TestCreateStore(t *testing.T) {
|
||||
accesstoken := `{"access_token":"c4afc5bc-7ddf-4244-b35a-0c393f3dca32","expires_in":1666862533,"scope":"SCOPE","shop_id":"57939570","shop_name":"京西菜市速食","refresh_token":"5a4f9dfe-306b-4bca-8b35-2ae9afc0245e","authority_id":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||
|
||||
param := shop_batchCreateStore_request.StoreListItem{
|
||||
RowId: 1,
|
||||
@@ -164,8 +162,6 @@ func TestAPI_CreateTradeLimitTemplate(t *testing.T) {
|
||||
|
||||
//创建电子围栏
|
||||
func TestCreateFence(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)
|
||||
param := &warehouse_createFence_request.WarehouseCreateFenceParam{
|
||||
FenceInfo: &warehouse_createFence_request.FenceInfo{
|
||||
OutFenceId: "667094",
|
||||
@@ -186,8 +182,6 @@ func TestCreateFence(t *testing.T) {
|
||||
|
||||
//绑定电子围栏与门店
|
||||
func TestBindFence(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)
|
||||
var ids = []string{"668469"}
|
||||
param := &warehouse_bindFencesByStore_request.WarehouseBindFencesByStoreParam{
|
||||
StoreId: 63114504,
|
||||
@@ -198,8 +192,6 @@ func TestBindFence(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateFence(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)
|
||||
param := &warehouse_setFence_request.WarehouseSetFenceParam{
|
||||
FenceInfo: &warehouse_setFence_request.FenceInfo{
|
||||
OutFenceId: "668469",
|
||||
@@ -217,8 +209,6 @@ func TestUpdateFence(t *testing.T) {
|
||||
fmt.Println(err)
|
||||
}
|
||||
func TestWarehouseBindFence(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)
|
||||
param := &warehouse_bindFences_request.WarehouseBindFencesParam{
|
||||
OutWarehouseId: "668510",
|
||||
OutFenceIds: []string{"668410-2"},
|
||||
@@ -231,8 +221,6 @@ func TestJNTM(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestStoreSuspend(t *testing.T) {
|
||||
accesstoken := `{"access_token":"e1c4333c-6e5e-4db8-83d3-173923e0815f","expires_in":1677450559,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"89d62aee-5bb3-433c-9514-e435172a3263","authority_id":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||
param := &shop_storeSuspend_request.ShopStoreSuspendParam{
|
||||
StoreId: 84670563,
|
||||
}
|
||||
@@ -293,9 +281,19 @@ func TestUpdateStore(t *testing.T) {
|
||||
|
||||
//获取门店绑定仓库
|
||||
func TestGetWarehouseByStore(t *testing.T) {
|
||||
resp, err := a.GetWarehouseByStore(64270382)
|
||||
fmt.Println(resp.WarehouseInfoMap["64270382"][0].OutFenceIds[0])
|
||||
fmt.Println(err)
|
||||
storeIDs := []int64{89519481, 89476907, 89127678, 89107647, 88868369, 88580829, 86794412, 86793595, 86763746, 85770993, 83727828, 81386642, 81385390, 78318835, 78118788, 76879546, 76877797, 76877419, 76876821, 76875172, 75323740, 71199379, 71199371, 71199369, 71199367, 71199362, 71199352, 70870393, 69395217, 65585133, 65402632, 65401463, 64270373, 64270365, 64270337, 64270333, 64270318, 64270279, 64270267, 64270240, 64270227, 64270222, 64270214, 64270206, 64270183, 64270137, 64270136, 64270122, 64270095, 64270063, 64270050, 64270027, 64269990, 64269953, 64251889, 64251887, 64251878, 64251875, 64251857, 64251634, 64251633, 64251632, 64251631, 64251630, 64251629, 64251624, 64251623, 64251622, 64251620, 64251617, 64251616, 64251614, 64251611, 64251610, 64251608, 64251604, 64251603, 64251600, 64251599, 64251224, 64251223, 64251221, 64251219, 64251214, 64251213, 64251208, 64251207, 64251204, 64251198, 64250754, 64250751, 64250746, 64250744, 64250742, 64250741, 64250739, 64250735, 64250734, 64250731, 64250730, 64250729, 64250728, 64250727, 64250722, 64250720, 64250709, 64250707, 64250704, 64212758, 64212030, 64208821, 64208482, 64208305, 64208009, 64089616, 64042829, 63841925, 63840103, 63836369, 63521502, 63521394, 63511878, 63468038, 63467659, 63467462, 63465423, 63463026, 63462817, 63224599, 63183340, 63181030, 63179331, 63178998, 62490423}
|
||||
need := []int64{}
|
||||
errList := errlist.New()
|
||||
for _, v := range storeIDs {
|
||||
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 {
|
||||
errList.AddErr(err)
|
||||
}
|
||||
}
|
||||
fmt.Println(need)
|
||||
fmt.Println(errList.GetErrListAsOne())
|
||||
}
|
||||
|
||||
func TestUtilsTime2Date(t *testing.T) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
func (a *API) GetOrderPrice(req map[string]interface{}) (*GetOrderPriceResp, error) {
|
||||
preParam := a.MakeUURequestHead()
|
||||
resp, err := a.AccessAPI(BaseURL, "getorderprice.ashx", RequestPost, utils.MergeMaps(preParam, req))
|
||||
fmt.Println(utils.Format4Output(resp, false))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user