京东回调消息根据token动态选择不同的配置
This commit is contained in:
@@ -26,6 +26,22 @@ func getAPI(appOrgCode string) (apiObj *jdapi.API) {
|
||||
return partner.CurAPIManager.GetAPI(model.VendorIDJD, appOrgCode).(*jdapi.API)
|
||||
}
|
||||
|
||||
func GetAPIByToken(token string) (apiObj *jdapi.API) {
|
||||
if token == "" {
|
||||
apiObj = getAPI("")
|
||||
} else {
|
||||
apiList := partner.CurAPIManager.GetAPIList(model.VendorIDJD)
|
||||
for _, v := range apiList {
|
||||
jdAPI := v.(*jdapi.API)
|
||||
if jdAPI.GetToken() == token {
|
||||
apiObj = jdAPI
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return apiObj
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) GetVendorID() int {
|
||||
return model.VendorIDJD
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user