This commit is contained in:
苏尹岚
2021-03-01 14:07:40 +08:00
parent 7d34db488b
commit 1ba648d99c
2 changed files with 5 additions and 2 deletions

View File

@@ -849,13 +849,16 @@ func (a *API) UpdateExpand(storeID int) (err error) {
//https://porder.shop.jd.com/order/orderlist/allOrders
func (a *API) CreateGisFence(storeID, kilometres int) (err error) {
reqID := time.Now().Unix()
_, err = a.AccessStorePage2("https://o2o-stores.shop.jd.com/shop/createGisFence", map[string]interface{}{
result, err := a.AccessStorePage2("https://o2o-stores.shop.jd.com/shop/createGisFence", map[string]interface{}{
"storeIds": storeID,
"kilometres": kilometres,
"version": "1.0.0",
"source": "pc",
"requestId": reqID,
}, false)
if result["data"] != nil && strings.Contains(result["data"].(string), "不能重复添加") {
err = fmt.Errorf("%s", result["data"].(string)[strings.Index(result["data"].(string), "[")+1:strings.Index(result["data"].(string), "]")])
}
return err
}

View File

@@ -218,7 +218,7 @@ func TestUpdateExpand(t *testing.T) {
}
func TestCreateGisFence(t *testing.T) {
err := api.CreateGisFence(1000070143, 3)
err := api.CreateGisFence(1000069001, 3)
if err != nil {
t.Fatal(err)
}