1
This commit is contained in:
@@ -20,13 +20,13 @@ func init() {
|
|||||||
baseapi.Init(sugarLogger)
|
baseapi.Init(sugarLogger)
|
||||||
|
|
||||||
// 菜市
|
// 菜市
|
||||||
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||||
|
|
||||||
// 果园
|
// 果园
|
||||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||||
|
|
||||||
//商超
|
//商超
|
||||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw
|
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw
|
||||||
cookieStr := `
|
cookieStr := `
|
||||||
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -345,6 +345,32 @@ func (a *API) RetailSellStatus(trackInfo, poiCode string, foodData []*BareStoreF
|
|||||||
"food_data": string(utils.MustMarshal(foodData)),
|
"food_data": string(utils.MustMarshal(foodData)),
|
||||||
"sell_status": sellStatus,
|
"sell_status": sellStatus,
|
||||||
}, resultKeyMsg, trackInfo)
|
}, 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 {
|
if err == nil {
|
||||||
var tmpFailedFoodList []*AppFoodResult4SellStatus
|
var tmpFailedFoodList []*AppFoodResult4SellStatus
|
||||||
if msg, ok := result.(string); ok && msg != "" {
|
if msg, ok := result.(string); ok && msg != "" {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user