Files
jx-callback/controllers/elm_order.go
2018-07-05 12:21:25 +08:00

43 lines
1.0 KiB
Go

package controllers
import (
"git.rosy.net.cn/baseapi/platformapi/elmapi"
"git.rosy.net.cn/jx-callback/globals/api"
"git.rosy.net.cn/jx-callback/legacy/elm/controller"
"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 := api.ElmAPI.GetCallbackMsg(c.Ctx.Input.RequestBody)
if callbackResponse == nil {
cc := &controller.OrderController{}
callbackResponse = 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()
}