1
This commit is contained in:
@@ -3,7 +3,6 @@ package apimanager
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
@@ -31,7 +30,6 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
globals.SugarLogger.Debug("init apimanager")
|
||||
CurAPIManager = &APIManager{}
|
||||
partner.InitAPIManager(CurAPIManager)
|
||||
}
|
||||
@@ -46,6 +44,9 @@ func (a *APIManager) GetAPI(vendorID int, appOrgCode string) (pfAPI interface{})
|
||||
pfAPI = api.FakeJdAPI
|
||||
} else {
|
||||
codes, _ := dao.GetVendorOrgCode(db, vendorID, appOrgCode, "platform")
|
||||
if len(codes) == 0 {
|
||||
return nil
|
||||
}
|
||||
code := codes[0]
|
||||
api.JdAPI = jdapi.New(code.Token, code.AppKey, code.AppSecret)
|
||||
pfAPI = api.JdAPI
|
||||
@@ -69,8 +70,10 @@ func (a *APIManager) GetAPI(vendorID int, appOrgCode string) (pfAPI interface{})
|
||||
pfAPI = api.TiktokApi
|
||||
case model.VendorIDDD:
|
||||
codes, _ := dao.GetVendorOrgCode(db, vendorID, appOrgCode, "platform")
|
||||
if len(codes) == 0 {
|
||||
return nil
|
||||
}
|
||||
pfAPI = tiktok_api.New(beego.AppConfig.DefaultString("tiktokShopAppId", ""), beego.AppConfig.DefaultString("tiktokShopAppSecret", ""), codes[0].Token)
|
||||
globals.SugarLogger.Debugf("pfAPI ================%v", utils.Format4Output(pfAPI, true))
|
||||
}
|
||||
return pfAPI
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user