1
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -150,9 +149,6 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
|
||||
}
|
||||
signURL := a.genURL(cmd) + "?"
|
||||
params[signKey] = a.signParams(signURL, params)
|
||||
if cmd == "retail/batchinitdata" {
|
||||
globals.SugarLogger.Debugf("=====sgin := %s", params[signKey].(string))
|
||||
}
|
||||
//globals.SugarLogger.Debugf("test mtCancelAct cmd=%s sig=%s", cmd, utils.Format4Output(params, false))
|
||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||
func() *http.Request {
|
||||
|
||||
@@ -297,16 +297,26 @@ func (a *API) RetailInitData(trackInfo, poiCode, foodCode string, params map[str
|
||||
return err
|
||||
}
|
||||
|
||||
// 这个创建加更新
|
||||
func (a *API) RetailBatchInitData(trackInfo, poiCode string, foodDataList []map[string]interface{}) (failedFoodList []*AppFoodResult, err error) {
|
||||
result, err := a.AccessAPI2("retail/batchinitdata", false, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"food_data": string(utils.MustMarshal(foodDataList)),
|
||||
}, resultKeyMsg, trackInfo)
|
||||
if err == nil {
|
||||
failedFoodList, err = handleRetailBatchResult(result)
|
||||
}
|
||||
|
||||
return failedFoodList, err
|
||||
}
|
||||
|
||||
// RetailBatchInitData2 这个只更新打包费
|
||||
func (a *API) RetailBatchInitData2(trackInfo, poiCode string, foodDataList []map[string]interface{}) (failedFoodList []*AppFoodResult, err error) {
|
||||
result, err := a.AccessAPI2("retail/batchinitdata", false, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"food_data": string(utils.MustMarshal(foodDataList)),
|
||||
"operate_type": 2,
|
||||
}, resultKeyMsg, trackInfo)
|
||||
globals.SugarLogger.Debugf("======foodDataList := %s", utils.Format4Output(foodDataList, false))
|
||||
globals.SugarLogger.Debugf("======poicode := %s", poiCode)
|
||||
globals.SugarLogger.Debugf("======result := %s", utils.Format4Output(result, false))
|
||||
globals.SugarLogger.Debugf("======err := %v", err)
|
||||
if err == nil {
|
||||
failedFoodList, err = handleRetailBatchResult(result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user