dada notify msg

This commit is contained in:
gazebo
2020-02-21 11:32:43 +08:00
parent 79a14a2235
commit fb8bce878f

View File

@@ -38,15 +38,16 @@ func (c *DadaDeliveryController) Notify() {
obj, notifyResponse := api.DadaAPI.GetNotifyMsg(c.Ctx.Input.RequestBody) obj, notifyResponse := api.DadaAPI.GetNotifyMsg(c.Ctx.Input.RequestBody)
if notifyResponse == nil && obj.MessageObj != nil { if notifyResponse == nil && obj.MessageObj != nil {
err := api.DadaAPI.ConfirmRidderCancel(obj.MessageObj.OrderID, obj.MessageObj.DadaOrderID, true) err := api.DadaAPI.ConfirmRidderCancel(obj.MessageObj.OrderID, obj.MessageObj.DadaOrderID, true)
if err != nil {
notifyResponse = dadaapi.FailedNotifyResponse
}
globals.SugarLogger.Debugf("dada notify, obj:%s, err:%v", utils.Format4Output(obj, false), err) globals.SugarLogger.Debugf("dada notify, obj:%s, err:%v", utils.Format4Output(obj, false), err)
} }
if notifyResponse == nil { if notifyResponse == nil {
notifyResponse = dadaapi.SuccessNotifyResponse notifyResponse = dadaapi.SuccessNotifyResponse
} else {
c.Data["json"] = notifyResponse
c.ServeJSON()
} }
globals.SugarLogger.Debugf("DadaDeliveryController.Notify:%s", utils.Format4Output(notifyResponse, false)) c.Data["json"] = notifyResponse
c.ServeJSON()
} else { } else {
c.Abort("404") c.Abort("404")
} }