1
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user