- big big refactor.

This commit is contained in:
gazebo
2018-07-12 14:41:40 +08:00
parent ac2d4214e5
commit 6386f1b6f5
18 changed files with 687 additions and 644 deletions

View File

@@ -2,6 +2,9 @@ package controllers
import (
"git.rosy.net.cn/baseapi/platformapi/elmapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/controller/elm"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api"
"git.rosy.net.cn/jx-callback/legacy/elm/controller"
"github.com/astaxie/beego"
@@ -25,13 +28,16 @@ func (c *ELMOrderController) URLMapping() {
func (c *ELMOrderController) MsgPost() {
obj, callbackResponse := api.ElmAPI.GetCallbackMsg(c.Ctx.Input.RequestBody)
if callbackResponse == nil {
cc := &controller.OrderController{}
callbackResponse = cc.OrderMessage(obj)
// utils.CallFuncAsync(func() {
// cc2 := &elm.Controller{}
// cc2.OnCallbackMsg(obj)
// })
if globals.CallLegacy {
cc := &controller.OrderController{}
callbackResponse = cc.OrderMessage(obj)
}
if globals.CallNew {
utils.CallFuncAsync(func() {
cc2 := &elm.Controller{}
cc2.OnCallbackMsg(obj)
})
}
}
c.Data["json"] = callbackResponse
c.ServeJSON()