35 lines
879 B
Go
35 lines
879 B
Go
package mt
|
|
|
|
import (
|
|
"gitrosy.jxc4.com/baseapi/platformapi/mtunionapi"
|
|
"gitrosy.jxc4.com/jx-callback/business/jxstore/partner"
|
|
"gitrosy.jxc4.com/jx-callback/business/model"
|
|
"gitrosy.jxc4.com/jx-callback/business/model/dao"
|
|
"gitrosy.jxc4.com/jx-callback/globals/api"
|
|
)
|
|
|
|
type UnionHandler struct {
|
|
}
|
|
|
|
var (
|
|
unionHandler *UnionHandler
|
|
)
|
|
|
|
func init() {
|
|
partner.UnionHandlerMap[model.VendorIDMTWM] = unionHandler
|
|
}
|
|
|
|
func getAPI() (apiobj *mtunionapi.API) {
|
|
if configs, err := dao.QueryConfigs(dao.GetDB(), "mtunionCookie", model.ConfigTypeCookie, ""); err == nil {
|
|
api.MtUnionAPI.SetCookieWithStr(configs[0].Value)
|
|
}
|
|
return api.MtUnionAPI
|
|
}
|
|
|
|
func GetAPI() (apiobj *mtunionapi.API) {
|
|
if configs, err := dao.QueryConfigs(dao.GetDB(), "mtunionCookie", model.ConfigTypeCookie, ""); err == nil {
|
|
api.MtUnionAPI.SetCookieWithStr(configs[0].Value)
|
|
}
|
|
return api.MtUnionAPI
|
|
}
|