- 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,8 +32,10 @@ type DeliveryHandler struct {
}
func init() {
curDeliveryHandler = new(DeliveryHandler)
scheduler.CurrentScheduler.RegisterDeliveryPlatform(curDeliveryHandler, true)
if api.DadaAPI != nil {
curDeliveryHandler = new(DeliveryHandler)
scheduler.CurrentScheduler.RegisterDeliveryPlatform(curDeliveryHandler, true)
}
}
func OnWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaapi.CallbackResponse) {

View File

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

View File

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

View File

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

View File

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

View File

@@ -78,6 +78,26 @@ dbConnectStr = "root:WebServer@1@tcp(db1.int.jxc4.com:3306)/jxd_dev_0?charset=ut
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]
freshFoodServerURL = "http://portal.alpha.int.jxc4.com"

View File

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