Files
jx-callback/controllers/elm_order.go
gazebo 03c7efbe1e - mtps added.
- refactor.
2018-06-18 12:03:53 +08:00

43 lines
1.0 KiB
Go

package controllers
import (
"git.rosy.net.cn/baseapi/platform/elmapi"
"git.rosy.net.cn/jx-callback/business/elm/controller"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego"
)
// Operations about ELMOrder
type ELMOrderController struct {
beego.Controller
}
func (c *ELMOrderController) URLMapping() {
c.Mapping("MsgPost", c.MsgPost)
c.Mapping("MsgGet", c.MsgGet)
}
// @Title all msg
// @Description create object
// @Success 200 {string} models.Object.Id
// @Failure 403 body is empty
// @router /msg [post]
func (c *ELMOrderController) MsgPost() {
obj, callbackResponse := globals.ElmAPI.GetMsgFromData(c.Ctx.Input.RequestBody)
if callbackResponse == nil {
cc := &controller.OrderController{}
c.Data["json"] = cc.OrderMessage(obj)
}
c.Data["json"] = callbackResponse
c.ServeJSON()
}
// @Title all msg test
// @Description create object
// @Success 200 {string} models.Object.Id
// @router /msg [get]
func (c *ELMOrderController) MsgGet() {
c.Data["json"] = elmapi.SuccessResponse
c.ServeJSON()
}