This commit is contained in:
邹宗楠
2023-12-22 18:43:12 +08:00
parent 71599e3d74
commit 8dadd431a6

View File

@@ -289,29 +289,24 @@ func handleRetailBatchResultByRegexp(result interface{}) (failedFoodList []*AppF
// https://developer.waimai.meituan.com/home/myquestionDetail/6716
// 另外这个接口即使不指定operate_type为1也可能报错”商品spu名称在该店内分类中已存在“原因就是已经存在两个相同的SKU了
func (a *API) RetailInitData(trackInfo, poiCode, foodCode string, params map[string]interface{}) (err error) {
globals.SugarLogger.Debugf("=============result1 := %d", len(params))
_, err = a.AccessAPI2("retail/initdata", false, utils.MergeMaps(map[string]interface{}{
KeyAppPoiCode: poiCode,
KeyAppFoodCode: foodCode,
}, params), resultKeyData, trackInfo)
globals.SugarLogger.Debugf("=============er1r := %v", err)
return err
}
func (a *API) RetailBatchInitData(trackInfo, poiCode string, foodDataList []map[string]interface{}) (failedFoodList []*AppFoodResult, err error) {
globals.SugarLogger.Debugf("=============result := %d", len(foodDataList))
result, err := a.AccessAPI2("retail/batchinitdata", false, map[string]interface{}{
KeyAppPoiCode: poiCode,
"food_data": string(utils.MustMarshal(foodDataList)),
}, resultKeyMsg, trackInfo)
globals.SugarLogger.Debugf("=============result := %s", utils.Format4Output(result, false))
globals.SugarLogger.Debugf("=============err := %v", err)
if err == nil {
failedFoodList, err = handleRetailBatchResult(result)
}
if err != nil {
globals.SugarLogger.Debugf("=============err := %v", err)
}
return failedFoodList, err
}