This commit is contained in:
suyl
2021-05-22 10:52:36 +08:00
parent 4223d912d1
commit f3bdc35c35
3 changed files with 35 additions and 8 deletions

View File

@@ -226,6 +226,21 @@ func (p *PurchaseHandler) getUploadImgPoiCode() (poiCode string) {
return poiCode
}
func GetAPI(appOrgCode string, vendorStoreID string) (apiObj *mtwmapi.API) {
if appOrgCode == "" {
globals.SugarLogger.Debugf("getAPI appOrgCode is empty")
}
apiObj = partner.CurAPIManager.GetAPI(model.VendorIDMTWM, appOrgCode).(*mtwmapi.API)
if appOrgCode == globals.Mtwm2Code {
var storeDetail *dao.StoreDetail
storeDetail, _ = dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreID, model.VendorIDMTWM, 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")