- 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

@@ -1,6 +1,9 @@
package controllers
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/controller/mtps"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api"
"git.rosy.net.cn/jx-callback/legacy/mtps/controller"
"github.com/astaxie/beego"
@@ -24,13 +27,16 @@ func (c *MTPSOrderController) URLMapping() {
func (c *MTPSOrderController) Status() {
obj, callbackResponse := api.MtpsAPI.GetOrderCallbackMsg(c.Ctx.Request)
if callbackResponse == nil {
cc := &controller.OrderController{}
callbackResponse = cc.OrderStatusChanged(obj)
// utils.CallFuncAsync(func() {
// cc2 := &mtps.WaybillController{}
// cc2.OnWaybillMsg(obj)
// })
if globals.CallLegacy {
cc := &controller.OrderController{}
callbackResponse = cc.OrderStatusChanged(obj)
}
if globals.CallNew {
utils.CallFuncAsync(func() {
cc2 := &mtps.WaybillController{}
cc2.OnWaybillMsg(obj)
})
}
}
c.Data["json"] = callbackResponse
c.ServeJSON()
@@ -44,13 +50,16 @@ func (c *MTPSOrderController) Status() {
func (c *MTPSOrderController) Except() {
obj, callbackResponse := api.MtpsAPI.GetOrderExceptionCallbackMsg(c.Ctx.Request)
if callbackResponse == nil {
cc := &controller.OrderController{}
callbackResponse = cc.OrderException(obj)
// utils.CallFuncAsync(func() {
// cc2 := &mtps.WaybillController{}
// cc2.OnWaybillExcept(obj)
// })
if globals.CallLegacy {
cc := &controller.OrderController{}
callbackResponse = cc.OrderException(obj)
}
if globals.CallNew {
utils.CallFuncAsync(func() {
cc2 := &mtps.WaybillController{}
cc2.OnWaybillExcept(obj)
})
}
}
c.Data["json"] = callbackResponse
c.ServeJSON()