From fb8bce878f7836b13fbc144733084731e2da2015 Mon Sep 17 00:00:00 2001 From: gazebo Date: Fri, 21 Feb 2020 11:32:43 +0800 Subject: [PATCH] dada notify msg --- controllers/dada_order.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/controllers/dada_order.go b/controllers/dada_order.go index 71bebc33d..8635d3fac 100644 --- a/controllers/dada_order.go +++ b/controllers/dada_order.go @@ -38,15 +38,16 @@ func (c *DadaDeliveryController) Notify() { obj, notifyResponse := api.DadaAPI.GetNotifyMsg(c.Ctx.Input.RequestBody) if notifyResponse == nil && obj.MessageObj != nil { 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) } if notifyResponse == nil { 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 { c.Abort("404") }