ebai filter

This commit is contained in:
richboo111
2023-02-16 10:05:20 +08:00
parent c32151cdb4
commit 5a3cb1926d
3 changed files with 23 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
package ebaiapi
import (
"fmt"
"testing"
"git.rosy.net.cn/baseapi/utils"
@@ -122,7 +123,27 @@ func TestShopStatusGet(t *testing.T) {
//todo 修改ebai平台与本地映射
func TestShopIDBatchUpdate(t *testing.T) {
err := api.ShopIDBatchUpdate([]string{utils.Int2Str(2235877567)}, []string{"100920"})
var (
fBaiduShopIDs []string
fShopIDs []string
)
key := map[int64]string{
2235877567: "100920",
508281125: "6688759",
}
for k, v := range key {
k1 := utils.Int64ToStr(k)
remoteRel, err := api.ShopGet2("", k)
fmt.Sprintf("err====%v", err)
if remoteRel.ShopID != v {
fBaiduShopIDs = append(fBaiduShopIDs, k1)
fShopIDs = append(fShopIDs, v)
}
}
fmt.Sprintf("fBaiduIDs=====%s", fBaiduShopIDs)
fmt.Sprintf("fBaiduIDs=====%s", fShopIDs)
err := api.ShopIDBatchUpdate(fBaiduShopIDs, fShopIDs)
//err := api.ShopIDBatchUpdate([]string{utils.Int2Str(2235877567)}, []string{"100920"})
if err != nil {
t.Fatal(err)
}