- mtps added.
- refactor.
This commit is contained in:
47
controllers/mtps_order.go
Normal file
47
controllers/mtps_order.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/mtps/controller"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"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 := globals.MtpsAPI.GetOrderCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse == nil {
|
||||
cc := &controller.OrderController{}
|
||||
c.Data["json"] = cc.OrderStatusChanged(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 := globals.MtpsAPI.GetOrderExceptionCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse == nil {
|
||||
cc := &controller.OrderController{}
|
||||
c.Data["json"] = cc.OrderException(obj)
|
||||
}
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
}
|
||||
Reference in New Issue
Block a user