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" ) // Operations about ELMOrder type MTPSOrderController struct { beego.Controller } func (c *MTPSOrderController) URLMapping() { c.Mapping("Status", c.Status) c.Mapping("Except", c.Except) } // @Title all msg // @Description create object // @Success 200 {string} models.Object.Id // @Failure 403 body is empty // @router /status [post] func (c *MTPSOrderController) Status() { obj, callbackResponse := api.MtpsAPI.GetOrderCallbackMsg(c.Ctx.Request) if callbackResponse == nil { 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() } // @Title all msg test // @Description create object // @Success 200 {string} models.Object.Id // @Failure 403 body is empty // @router /except [Post] func (c *MTPSOrderController) Except() { obj, callbackResponse := api.MtpsAPI.GetOrderExceptionCallbackMsg(c.Ctx.Request) if callbackResponse == nil { 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() }