1
This commit is contained in:
@@ -2,6 +2,7 @@ package mtwm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -209,47 +210,28 @@ func (p *PurchaseHandler) getUploadImgPoiCode() (poiCode string) {
|
||||
return poiCode
|
||||
}
|
||||
|
||||
func GetAPI(appOrgCode string, storeID int, vendorStoreID string) (apiObj *mtwmapi.API) {
|
||||
// getAPI 包含门店token
|
||||
func getAPI(appOrgCode string, storeID int, vendorStoreID string) (apiObj *tao_vegetable.API) {
|
||||
if appOrgCode == "" {
|
||||
globals.SugarLogger.Debugf("getAPI appOrgCode is empty")
|
||||
}
|
||||
apiObj = partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*mtwmapi.API)
|
||||
if appOrgCode == globals.Mtwm2Code {
|
||||
var storeDetail *dao.StoreDetail
|
||||
if storeID != 0 {
|
||||
storeDetail, _ = dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDTaoVegetable, appOrgCode)
|
||||
} else if vendorStoreID != "" {
|
||||
storeDetail, _ = dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreID, model.VendorIDTaoVegetable, appOrgCode)
|
||||
}
|
||||
if storeDetail != nil {
|
||||
apiObj.SetToken(storeDetail.MtwmToken)
|
||||
}
|
||||
apiObj = partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*tao_vegetable.API)
|
||||
var storeDetail *dao.StoreDetail
|
||||
if storeID != model.NO {
|
||||
storeDetail, _ = dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDTaoVegetable, appOrgCode)
|
||||
} else if vendorStoreID != "" {
|
||||
storeDetail, _ = dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreID, model.VendorIDTaoVegetable, appOrgCode)
|
||||
}
|
||||
if storeDetail != nil {
|
||||
apiObj.SetToken(storeDetail.MtwmToken)
|
||||
}
|
||||
return apiObj
|
||||
}
|
||||
|
||||
func getAPI(appOrgCode string, storeID int, vendorStoreID string) (apiObj *mtwmapi.API) {
|
||||
if appOrgCode == "" {
|
||||
globals.SugarLogger.Debugf("getAPI appOrgCode is empty")
|
||||
}
|
||||
apiObj = partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*mtwmapi.API)
|
||||
if appOrgCode == globals.Mtwm2Code {
|
||||
var storeDetail *dao.StoreDetail
|
||||
if storeID != 0 {
|
||||
storeDetail, _ = dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDTaoVegetable, appOrgCode)
|
||||
} else if vendorStoreID != "" {
|
||||
storeDetail, _ = dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreID, model.VendorIDTaoVegetable, appOrgCode)
|
||||
}
|
||||
if storeDetail != nil {
|
||||
apiObj.SetToken(storeDetail.MtwmToken)
|
||||
}
|
||||
}
|
||||
return apiObj
|
||||
}
|
||||
|
||||
func getAPIWithoutToken(appOrgCode string) (apiObj *mtwmapi.API) {
|
||||
if appOrgCode == "" {
|
||||
globals.SugarLogger.Warnf("getAPI appOrgCode is empty")
|
||||
}
|
||||
return partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*mtwmapi.API)
|
||||
}
|
||||
//
|
||||
//func getAPIWithoutToken(appOrgCode string) (apiObj *mtwmapi.API) {
|
||||
// if appOrgCode == "" {
|
||||
// globals.SugarLogger.Warnf("getAPI appOrgCode is empty")
|
||||
// }
|
||||
// return partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*mtwmapi.API)
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user