- config prod2 added for another jd account.

- can disable some platform.
This commit is contained in:
gazebo
2018-10-18 12:07:21 +08:00
parent 6dbadf0569
commit 0db0dd4ca1
7 changed files with 61 additions and 16 deletions

View File

@@ -32,9 +32,11 @@ type DeliveryHandler struct {
} }
func init() { func init() {
if api.DadaAPI != nil {
curDeliveryHandler = new(DeliveryHandler) curDeliveryHandler = new(DeliveryHandler)
scheduler.CurrentScheduler.RegisterDeliveryPlatform(curDeliveryHandler, true) scheduler.CurrentScheduler.RegisterDeliveryPlatform(curDeliveryHandler, true)
} }
}
func OnWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaapi.CallbackResponse) { func OnWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaapi.CallbackResponse) {
return curDeliveryHandler.OnWaybillMsg(msg) return curDeliveryHandler.OnWaybillMsg(msg)

View File

@@ -34,9 +34,11 @@ type DeliveryHandler struct {
} }
func init() { func init() {
if api.MtpsAPI != nil {
curDeliveryHandler = new(DeliveryHandler) curDeliveryHandler = new(DeliveryHandler)
scheduler.CurrentScheduler.RegisterDeliveryPlatform(curDeliveryHandler, true) scheduler.CurrentScheduler.RegisterDeliveryPlatform(curDeliveryHandler, true)
} }
}
func (c *DeliveryHandler) GetVendorID() int { func (c *DeliveryHandler) GetVendorID() int {
return model.VendorIDMTPS return model.VendorIDMTPS

View File

@@ -4,6 +4,7 @@ import (
"git.rosy.net.cn/baseapi/platformapi/ebaiapi" "git.rosy.net.cn/baseapi/platformapi/ebaiapi"
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler" "git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals/api"
) )
var ( var (
@@ -15,9 +16,11 @@ type PurchaseHandler struct {
} }
func init() { func init() {
if api.EbaiAPI != nil {
curPurchaseHandler = new(PurchaseHandler) curPurchaseHandler = new(PurchaseHandler)
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler) scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
} }
}
func EbaiBusStatus2JxStatus(ebaiStatus int) int { func EbaiBusStatus2JxStatus(ebaiStatus int) int {
if ebaiStatus == ebaiapi.ShopBusStatusOffline || ebaiStatus == ebaiapi.ShopBusStatusSuspended { if ebaiStatus == ebaiapi.ShopBusStatusOffline || ebaiStatus == ebaiapi.ShopBusStatusSuspended {

View File

@@ -6,6 +6,7 @@ import (
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler" "git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
"git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals/api"
) )
var ( var (
@@ -17,9 +18,11 @@ type PurchaseHandler struct {
} }
func init() { func init() {
if api.ElmAPI != nil {
curPurchaseHandler = new(PurchaseHandler) curPurchaseHandler = new(PurchaseHandler)
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler) scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
} }
}
func (c *PurchaseHandler) GetVendorID() int { func (c *PurchaseHandler) GetVendorID() int {
return model.VendorIDELM return model.VendorIDELM

View File

@@ -5,6 +5,7 @@ import (
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler" "git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals/api"
) )
var ( var (
@@ -16,9 +17,11 @@ type PurchaseHandler struct {
} }
func init() { func init() {
if api.JdAPI != nil {
curPurchaseHandler = new(PurchaseHandler) curPurchaseHandler = new(PurchaseHandler)
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler) scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
} }
}
func (c *PurchaseHandler) GetVendorID() int { func (c *PurchaseHandler) GetVendorID() int {
return model.VendorIDJD return model.VendorIDJD

View File

@@ -78,6 +78,26 @@ dbConnectStr = "root:WebServer@1@tcp(db1.int.jxc4.com:3306)/jxd_dev_0?charset=ut
enableStore = false enableStore = false
[prod2]
httpport = 8082
freshFoodServerURL = ""
disableJd = false
jdToken = "46058015-11b1-485d-9622-b7a91e446023"
jdAppKey = "8410aba1b67e4d3199098e944f91cb68"
jdSecret = "14af1be608934b73accab57b9efe8c96"
disableElm = true
disableMtps = true
disableDada = true
disableWeixin = true
disableEbai = true
dbConnectStr = "root:WebServer@1@tcp(db1.int.jxc4.com:3306)/jxd_dev_2?charset=utf8mb4&loc=Local&parseTime=true"
enableStore = true
[test] [test]
freshFoodServerURL = "http://portal.alpha.int.jxc4.com" freshFoodServerURL = "http://portal.alpha.int.jxc4.com"

View File

@@ -27,15 +27,27 @@ var (
) )
func Init() { func Init() {
if !beego.AppConfig.DefaultBool("disableJd", false) {
JdAPI = jdapi.New(beego.AppConfig.String("jdToken"), beego.AppConfig.String("jdAppKey"), beego.AppConfig.String("jdSecret")) JdAPI = jdapi.New(beego.AppConfig.String("jdToken"), beego.AppConfig.String("jdAppKey"), beego.AppConfig.String("jdSecret"))
}
if !beego.AppConfig.DefaultBool("disableElm", false) {
initElm() initElm()
}
if !beego.AppConfig.DefaultBool("disableMtps", false) {
MtpsAPI = mtpsapi.New(beego.AppConfig.String("mtpsAppKey"), beego.AppConfig.String("mtpsSecret")) MtpsAPI = mtpsapi.New(beego.AppConfig.String("mtpsAppKey"), beego.AppConfig.String("mtpsSecret"))
}
if !beego.AppConfig.DefaultBool("disableDada", false) {
DadaAPI = dadaapi.New(beego.AppConfig.String("dadaAppKey"), beego.AppConfig.String("dadaAppSecret"), beego.AppConfig.String("dadaSourceID"), beego.AppConfig.String("dadaCallbackURL"), beego.AppConfig.DefaultBool("dadaIsProd", false)) DadaAPI = dadaapi.New(beego.AppConfig.String("dadaAppKey"), beego.AppConfig.String("dadaAppSecret"), beego.AppConfig.String("dadaSourceID"), beego.AppConfig.String("dadaCallbackURL"), beego.AppConfig.DefaultBool("dadaIsProd", false))
}
if !beego.AppConfig.DefaultBool("disableWeixin", false) {
WeixinAPI = weixinapi.New(beego.AppConfig.String("weixinAppID"), beego.AppConfig.String("weixinSecret")) WeixinAPI = weixinapi.New(beego.AppConfig.String("weixinAppID"), beego.AppConfig.String("weixinSecret"))
}
AutonaviAPI = autonavi.New(beego.AppConfig.String("autonaviKey")) AutonaviAPI = autonavi.New(beego.AppConfig.String("autonaviKey"))
QiniuAPI = qbox.NewMac(beego.AppConfig.String("qiniuAK"), beego.AppConfig.String("qiniuSK")) QiniuAPI = qbox.NewMac(beego.AppConfig.String("qiniuAK"), beego.AppConfig.String("qiniuSK"))
if !beego.AppConfig.DefaultBool("disableEbai", false) {
EbaiAPI = ebaiapi.New(beego.AppConfig.String("ebaiSource"), beego.AppConfig.String("ebaiSecret")) EbaiAPI = ebaiapi.New(beego.AppConfig.String("ebaiSource"), beego.AppConfig.String("ebaiSecret"))
} }
}
func initElm() { func initElm() {
token := beego.AppConfig.String("elmToken") token := beego.AppConfig.String("elmToken")