1
This commit is contained in:
@@ -71,7 +71,8 @@ func (a *API) BatchCreateStore(param *shop_batchCreateStore_request.ShopBatchCre
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if response.Code != RequestSuccessCode {
|
if response.Code != RequestSuccessCode {
|
||||||
return nil, errors.New(response.Msg)
|
return nil, errors.New(response.Data.ResultList[0].Msg)
|
||||||
|
//return nil, errors.New(response.Msg)
|
||||||
}
|
}
|
||||||
return response.Data, nil
|
return response.Data, nil
|
||||||
}
|
}
|
||||||
@@ -253,7 +254,6 @@ func (a *API) GetStoreBindTemp(storeId int64) (freightId int64, err error) {
|
|||||||
if result.Data == nil || len(result.Data.StoreFreights) == 0 {
|
if result.Data == nil || len(result.Data.StoreFreights) == 0 {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range result.Data.StoreFreights {
|
for _, v := range result.Data.StoreFreights {
|
||||||
if v.StoreId == storeId {
|
if v.StoreId == storeId {
|
||||||
return v.FreightId, nil
|
return v.FreightId, nil
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestCreateStore(t *testing.T) {
|
func TestCreateStore(t *testing.T) {
|
||||||
accesstoken := `{"access_token":"a1746210-a8a3-4497-a87b-09d1f10dbb95","expires_in":1665652252,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对 接专用店","refresh_token":"c1cf8d88-0983-4f2a-b969-3746fae6b0cd","authorit y_id":""}`
|
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)
|
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||||
|
|
||||||
param := shop_batchCreateStore_request.StoreListItem{
|
param := shop_batchCreateStore_request.StoreListItem{
|
||||||
RowId: 1,
|
RowId: 1,
|
||||||
Name: "京西菜市老怪兽测试门店",
|
Name: "测试错误返回1025",
|
||||||
StoreCode: "668473",
|
StoreCode: "668473",
|
||||||
Longitude: "104.052236",
|
Longitude: "104.052236",
|
||||||
Latitude: "30.691359",
|
Latitude: "30.691359",
|
||||||
@@ -33,9 +33,9 @@ func TestCreateStore(t *testing.T) {
|
|||||||
District: "金牛区",
|
District: "金牛区",
|
||||||
Address: "成都市金牛区市政府旁",
|
Address: "成都市金牛区市政府旁",
|
||||||
Contact: "18981810340",
|
Contact: "18981810340",
|
||||||
OpenTime: &shop_batchCreateStore_request.OpenTime{DayMap: map[int64]string{
|
//OpenTime: &shop_batchCreateStore_request.OpenTime{DayMap: map[int64]string{
|
||||||
1: "07:00-12:00 14:00-18:00",
|
// 1: "07:00-12:00 14:00-18:00",
|
||||||
}},
|
//}},
|
||||||
}
|
}
|
||||||
paramList := &shop_batchCreateStore_request.ShopBatchCreateStoreParam{}
|
paramList := &shop_batchCreateStore_request.ShopBatchCreateStoreParam{}
|
||||||
paramList.StoreList = append(paramList.StoreList, param)
|
paramList.StoreList = append(paramList.StoreList, param)
|
||||||
|
|||||||
Reference in New Issue
Block a user