- 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()
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ func (c *ELMOrderController) URLMapping() {
|
||||
// @Failure 403 body is empty
|
||||
// @router /msg [post]
|
||||
func (c *ELMOrderController) MsgPost() {
|
||||
obj, callbackResponse := globals2.ElmAPI.GetMsgFromData(c.Ctx.Input.RequestBody)
|
||||
obj, callbackResponse := globals2.ElmAPI.GetCallbackMsg(c.Ctx.Input.RequestBody)
|
||||
if callbackResponse == nil {
|
||||
cc := &controller.OrderController{}
|
||||
callbackResponse = cc.OrderMessage(obj)
|
||||
|
||||
@@ -24,7 +24,7 @@ func (c *JDOrderController) URLMapping() {
|
||||
}
|
||||
|
||||
func (c *JDOrderController) orderStatus() {
|
||||
obj, callbackResponse := globals2.Jdapi.GetOrderMsg(c.Ctx.Request)
|
||||
obj, callbackResponse := globals2.Jdapi.GetOrderCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse == nil {
|
||||
cc := controller.OrderController{}
|
||||
callbackResponse = cc.OrderStatus(obj)
|
||||
@@ -120,7 +120,7 @@ func (c *JDOrderController) UserCancelOrder() {
|
||||
// @Failure 403 body is empty
|
||||
// @router /applyCancelOrder [post]
|
||||
func (c *JDOrderController) ApplyCancelOrder() {
|
||||
obj, callbackResponse := globals2.Jdapi.GetOrderApplyCancelMsg(c.Ctx.Request)
|
||||
obj, callbackResponse := globals2.Jdapi.GetOrderApplyCancelCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse == nil {
|
||||
cc := controller.OrderController{}
|
||||
callbackResponse = cc.OrderStatus(obj)
|
||||
@@ -136,7 +136,7 @@ func (c *JDOrderController) ApplyCancelOrder() {
|
||||
// @Failure 403 body is empty
|
||||
// @router /pushDeliveryStatus [post]
|
||||
func (c *JDOrderController) PushDeliveryStatus() {
|
||||
obj, callbackResponse := globals2.Jdapi.GetOrderDeliveryMsg(c.Ctx.Request)
|
||||
obj, callbackResponse := globals2.Jdapi.GetOrderDeliveryCallbackMsg(c.Ctx.Request)
|
||||
if callbackResponse == nil {
|
||||
cc := controller.OrderController{}
|
||||
callbackResponse = cc.OrderDeliveryStatus(obj)
|
||||
|
||||
Reference in New Issue
Block a user