- ShopIDBatchUpdate

This commit is contained in:
gazebo
2018-09-20 17:03:41 +08:00
parent 7508c0cf34
commit 8c2a7b4c48
2 changed files with 20 additions and 0 deletions

View File

@@ -128,3 +128,12 @@ func (a *API) ShopBusStatusGet(shopID string, baiduShopID int64, platformFlag st
}
return 0, err
}
// 相同值再次重复映射会出错
func (a *API) ShopIDBatchUpdate(baiduShopIDs []string, shopIDs []string) (err error) {
_, err = a.AccessAPI("shop.id.batchupdate", utils.Params2Map("baidu_shop_ids", baiduShopIDs, "shop_ids", shopIDs))
if err == nil {
return nil
}
return err
}

View File

@@ -53,3 +53,14 @@ func TestShopBusStatusGet(t *testing.T) {
t.Log(result)
}
}
func TestShopIDBatchUpdate(t *testing.T) {
err := api.ShopIDBatchUpdate([]string{utils.Int2Str(testShopBaiduID)}, []string{""})
if err != nil {
t.Fatal(err)
}
// err = api.ShopIDBatchUpdate([]string{utils.Int2Str(testShopBaiduID)}, []string{testShopID})
// if err != nil {
// t.Fatal(err)
// }
}