- refresh elme and weixin token only in prod env. - change dada callback to dadadelivery/msg
37 lines
974 B
Go
37 lines
974 B
Go
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 /msg [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()
|
|
}
|
|
}
|