- dada added.
This commit is contained in:
36
controllers/dada_order.go
Normal file
36
controllers/dada_order.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/dada/controller"
|
||||
"git.rosy.net.cn/jx-callback/globals/globals2"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
// Operations about ELMOrder
|
||||
type DadaOrderController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
func (c *DadaOrderController) URLMapping() {
|
||||
c.Mapping("OrderStatusChanged", c.OrderStatusChanged)
|
||||
}
|
||||
|
||||
// @Title all msg
|
||||
// @Description create object
|
||||
// @Success 200 {string} models.Object.Id
|
||||
// @Failure 403 body is empty
|
||||
// @router /order [post]
|
||||
func (c *DadaOrderController) OrderStatusChanged() {
|
||||
obj, callbackResponse := globals2.DadaAPI.GetOrderCallbackMsg(c.Ctx.Input.RequestBody)
|
||||
if callbackResponse == nil {
|
||||
cc := &controller.OrderController{}
|
||||
callbackResponse = cc.OrderStatusChanged(obj)
|
||||
}
|
||||
if callbackResponse.Code != 200 {
|
||||
c.CustomAbort(callbackResponse.Code, string(utils.MustMarshal(callbackResponse)))
|
||||
} else {
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user