This commit is contained in:
邹宗楠
2023-09-22 17:53:34 +08:00
parent 8bb0c546c3
commit 27924729e4

View File

@@ -1,12 +1,10 @@
package mtwmapi package mtwmapi
import ( import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals"
"regexp" "regexp"
"strings" "strings"
"time"
"git.rosy.net.cn/baseapi/utils"
) )
const ( const (
@@ -188,8 +186,7 @@ func (a *API) RetailCatUpdate(poiCode, catName string, updateParams *Param4Updat
params := utils.Struct2MapByJson(updateParams) params := utils.Struct2MapByJson(updateParams)
params[KeyAppPoiCode] = poiCode params[KeyAppPoiCode] = poiCode
params["category_name"] = catName params["category_name"] = catName
globals.SugarLogger.Debugf("RetailCatUpdate updateParams %s", utils.Format4Output(updateParams, false))
time.Sleep(200 * time.Millisecond)
_, err = a.AccessAPI("retailCat/update", false, params) _, err = a.AccessAPI("retailCat/update", false, params)
return err return err
@@ -246,8 +243,8 @@ func (a *API) RetailList(poiCode string, offset, limit int) (foodList []*AppFood
func (a *API) RetailListAll(poiCode string, offset int) (foodList []*AppFood, err error) { func (a *API) RetailListAll(poiCode string, offset int) (foodList []*AppFood, err error) {
data := make([]*AppFood, 0, 0) data := make([]*AppFood, 0, 0)
offset = offset * 100 offset = offset * GeneralMaxLimit
batchList, err2 := a.RetailList(poiCode, offset, 100) // GeneralMaxLimit batchList, err2 := a.RetailList(poiCode, offset, GeneralMaxLimit) // GeneralMaxLimit
globals.SugarLogger.Debugf("==========batchList %d", len(batchList)) globals.SugarLogger.Debugf("==========batchList %d", len(batchList))
globals.SugarLogger.Debugf("==========batchList %s", utils.Format4Output(err2, false)) globals.SugarLogger.Debugf("==========batchList %s", utils.Format4Output(err2, false))
if err = err2; err == nil { if err = err2; err == nil {