美团商超

This commit is contained in:
苏尹岚
2021-02-07 15:44:59 +08:00
parent 306c0eefff
commit f4af57cb08
20 changed files with 116 additions and 83 deletions

View File

@@ -5,6 +5,8 @@ import (
"strings"
"sync"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils"
@@ -224,7 +226,24 @@ func (p *PurchaseHandler) getUploadImgPoiCode() (poiCode string) {
return poiCode
}
func getAPI(appOrgCode string) (apiObj *mtwmapi.API) {
func getAPI(appOrgCode string, storeID int, vendorStoreID string) (apiObj *mtwmapi.API) {
if appOrgCode == "" {
globals.SugarLogger.Warnf("getAPI appOrgCode is empty")
}
apiObj = partner.CurAPIManager.GetAPI(model.VendorIDMTWM, appOrgCode).(*mtwmapi.API)
if appOrgCode == globals.Mtwm2Code {
var storeDetail *dao.StoreDetail
if storeID != 0 {
storeDetail, _ = dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDEBAI, appOrgCode)
} else if vendorStoreID != "" {
storeDetail, _ = dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreID, model.VendorIDEBAI, appOrgCode)
}
apiObj.SetToken(storeDetail.MtwmToken)
}
return apiObj
}
func getAPIWithoutToken(appOrgCode string) (apiObj *mtwmapi.API) {
if appOrgCode == "" {
globals.SugarLogger.Warnf("getAPI appOrgCode is empty")
}