This commit is contained in:
richboo111
2023-05-30 10:32:12 +08:00
parent 46011c38d8
commit 8acdfdfa30
2 changed files with 81 additions and 22 deletions

View File

@@ -15,16 +15,18 @@ type SFPSController struct {
func (c *SFPSController) SfOrder() {
if c.Ctx.Input.Method() == http.MethodPost {
msg, callbackResponse := api.SfPsAPI.GetRiderStatusCallback(c.Ctx.Request)
msg, callbackResponse := api.SfPsAPI.GetCallbackUrlIndex(c.Ctx.Request)
if callbackResponse.ErrorCode == -1 {
c.Data["error_code"] = -1
c.ServeJSON()
return
}
// 订单回调
callbackResponse = sfps.OnWaybillMsg(msg)
c.Data["error_code"] = callbackResponse
c.ServeJSON()
for k, v := range msg {
callbackResponse = sfps.OnWaybillMsg(k, v)
c.Data["error_code"] = callbackResponse
c.ServeJSON()
}
} else {
c.Abort("404")
}
@@ -32,7 +34,6 @@ func (c *SFPSController) SfOrder() {
// SfAbnormal 异常回调
func (c *FnController) SfAbnormal() {
if c.Ctx.Input.Method() == http.MethodPost {
msg, callbackResponse := api.SfPsAPI.GetRiderExceptionCallback(c.Ctx.Request)
if callbackResponse.ErrorCode == -1 {