美团商超
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user