This commit is contained in:
richboo111
2022-10-26 18:16:56 +08:00
parent 83a07f51e5
commit fce03afdc2
3 changed files with 17 additions and 5 deletions

View File

@@ -28,7 +28,8 @@ func TestDelVipPrice(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
// t.Log(utils.Format4Output(result, false)) t.Fatal(err)
//t.Log(utils.Format4Output(result, false))
} }
//func TestQueryOpenUseable(t *testing.T) { //func TestQueryOpenUseable(t *testing.T) {

View File

@@ -238,11 +238,15 @@ func (a *API) GetStoreFreight(storeId int64) ([]int64, error) {
if result.Code != RequestSuccessCode { if result.Code != RequestSuccessCode {
return nil, errors.New(result.SubMsg) return nil, errors.New(result.SubMsg)
} }
tempList := make([]int64, 0) if len(result.Data.StoreFreights) == 0 {
for _, v := range result.Data.StoreFreights { return []int64{0}, err
tempList = append(tempList, v.FreightId) } else {
tempList := make([]int64, 0)
for _, v := range result.Data.StoreFreights {
tempList = append(tempList, v.FreightId)
}
return tempList, err
} }
return tempList, err
} }
// 获取门店绑定的运费模板 // 获取门店绑定的运费模板

View File

@@ -255,3 +255,10 @@ func TestUpdateStore(t *testing.T) {
err := a.EditStore(param) err := a.EditStore(param)
fmt.Println(err) fmt.Println(err)
} }
func TestGetStoreBindFreight(t *testing.T) {
accesstoken := `{"access_token":"47690a84-3cc2-4958-abf9-41cc7fca5f82","expires_in":1666862533,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"66ea2395-07c7-409d-84ae-93ac1e600b74","authority_id":""}`
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
resp, err := a.GetStoreFreight(668619)
fmt.Println(resp)
fmt.Println(err)
}