This commit is contained in:
邹宗楠
2023-03-02 13:38:50 +08:00
parent 1cdd5f19d5
commit 66019fac4b
3 changed files with 74 additions and 65 deletions

View File

@@ -20,13 +20,13 @@ func init() {
baseapi.Init(sugarLogger)
// 菜市
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
// 果园
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
//商超
api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw
cookieStr := `
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
`

View File

@@ -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 != "" {

File diff suppressed because one or more lines are too long