This commit is contained in:
苏尹岚
2021-03-26 15:12:19 +08:00
parent d85011dd0a
commit 14b364724d
2 changed files with 9 additions and 2 deletions

View File

@@ -40,6 +40,14 @@ func GetAPI(appOrgCode string) (apiObj *jdapi.API) {
return getAPI(appOrgCode)
}
func GetAPIbyKey(appKey string) (apiObj *jdapi.API) {
if code, err := dao.GetVendorOrgCodeByKey(dao.GetDB(), model.VendorIDJD, appKey); err == nil && code != nil {
return jdapi.New(code.Token, code.AppKey, code.AppSecret)
}
globals.SugarLogger.Warnf("GetAPIbyKey appKey:%s get empty vendorOrgCode", appKey)
return nil
}
func AppKey2OrgCode(appKey string) (vendorOrgCode string) {
// apiList := partner.CurAPIManager.GetAppOrgCodeList(model.VendorIDJD)
// for _, v := range apiList {