1
This commit is contained in:
@@ -345,6 +345,32 @@ func (a *API) RetailSellStatus(trackInfo, poiCode string, foodData []*BareStoreF
|
||||
"food_data": string(utils.MustMarshal(foodData)),
|
||||
"sell_status": sellStatus,
|
||||
}, resultKeyMsg, trackInfo)
|
||||
globals.SugarLogger.Debugf("美团不可售参数 params :%s,poiCode:%s,sellStatus:%d", utils.Format4Output(foodData, false), poiCode, sellStatus)
|
||||
globals.SugarLogger.Debugf("====result:%s", utils.Format4Output(result, false))
|
||||
globals.SugarLogger.Debugf("====reerrr:%v", err)
|
||||
if err == nil {
|
||||
var tmpFailedFoodList []*AppFoodResult4SellStatus
|
||||
if msg, ok := result.(string); ok && msg != "" {
|
||||
if err = utils.UnmarshalUseNumber([]byte(msg), &tmpFailedFoodList); err == nil {
|
||||
for _, v := range tmpFailedFoodList {
|
||||
failedFoodList = append(failedFoodList, &AppFoodResult{
|
||||
AppFoodCode: v.AppFoodCode,
|
||||
ErrorMsg: v.Msg,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return failedFoodList, err
|
||||
}
|
||||
|
||||
// 此接口部分失败也返回成功,但错误消息格式(errorMsg, appFoodCode)与其它两个不一样
|
||||
func (a *API) RetailSellStatus2(trackInfo, poiCode string, foodData []map[string]string, sellStatus int) (failedFoodList []*AppFoodResult, err error) {
|
||||
result, err := a.AccessAPI2("retail/sellStatus", false, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"food_data": foodData,
|
||||
"sell_status": sellStatus,
|
||||
}, resultKeyMsg, trackInfo)
|
||||
if err == nil {
|
||||
var tmpFailedFoodList []*AppFoodResult4SellStatus
|
||||
if msg, ok := result.(string); ok && msg != "" {
|
||||
|
||||
Reference in New Issue
Block a user