dadadelivery notify
This commit is contained in:
@@ -3,8 +3,10 @@ package controllers
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/dadaapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/delivery/dada"
|
"git.rosy.net.cn/jx-callback/business/partner/delivery/dada"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
)
|
)
|
||||||
@@ -30,3 +32,21 @@ func (c *DadaDeliveryController) Msg() {
|
|||||||
c.Abort("404")
|
c.Abort("404")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *DadaDeliveryController) Notify() {
|
||||||
|
if c.Ctx.Input.Method() == http.MethodPost {
|
||||||
|
obj, notifyResponse := api.DadaAPI.GetNotifyMsg(c.Ctx.Input.RequestBody)
|
||||||
|
if notifyResponse == nil {
|
||||||
|
err := api.DadaAPI.ConfirmRidderCancel(obj.MessageObj.OrderID, obj.MessageObj.DadaOrderID, true)
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
c.Abort("404")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user