- move Cacher from globals to api
- vendorPromotionID for CreatePromotion - LockPromotionSkus
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/weixinapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/cache"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/cache/redis"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/astaxie/beego/orm"
|
||||
@@ -24,6 +26,8 @@ var (
|
||||
WeixinAPI *weixinapi.API
|
||||
AutonaviAPI *autonavi.API
|
||||
QiniuAPI *qbox.Mac
|
||||
|
||||
Cacher cache.ICacher
|
||||
)
|
||||
|
||||
func Init() {
|
||||
@@ -47,6 +51,7 @@ func Init() {
|
||||
if !beego.AppConfig.DefaultBool("disableEbai", false) {
|
||||
EbaiAPI = ebaiapi.New(beego.AppConfig.String("ebaiSource"), beego.AppConfig.String("ebaiSecret"))
|
||||
}
|
||||
Cacher = redis.New(beego.AppConfig.DefaultString("redisHost", "localhost"), beego.AppConfig.DefaultInt("redisPort", 0), beego.AppConfig.DefaultString("redisPassword", ""))
|
||||
}
|
||||
|
||||
func initElm() {
|
||||
|
||||
@@ -2,8 +2,6 @@ package globals
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/cache"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/cache/redis"
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/astaxie/beego/logs"
|
||||
_ "github.com/go-sql-driver/mysql" // import your used driver
|
||||
@@ -22,8 +20,6 @@ var (
|
||||
|
||||
SugarLogger *zap.SugaredLogger
|
||||
|
||||
Cacher cache.ICacher
|
||||
|
||||
AliKey string
|
||||
AliSecret string
|
||||
|
||||
@@ -51,8 +47,6 @@ func Init() {
|
||||
ReallySendWeixinMsg = beego.BConfig.RunMode == "prod"
|
||||
ReallyCallPlatformAPI = true
|
||||
|
||||
Cacher = redis.New(beego.AppConfig.DefaultString("redisHost", "localhost"), beego.AppConfig.DefaultInt("redisPort", 0), beego.AppConfig.DefaultString("redisPassword", ""))
|
||||
|
||||
AliKey = beego.AppConfig.DefaultString("aliKey", "")
|
||||
AliSecret = beego.AppConfig.DefaultString("aliSecret", "")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user