- ebai.OnCallbackMsg中要判断事件后才会调用GetOrderIDFromMsg

This commit is contained in:
gazebo
2019-04-11 19:46:05 +08:00
parent e2f728889b
commit f3939687ed
2 changed files with 13 additions and 9 deletions

View File

@@ -0,0 +1,29 @@
package controllers
import (
"net/http"
"git.rosy.net.cn/jx-callback/business/partner/purchase/ebai"
"git.rosy.net.cn/jx-callback/globals/api"
"github.com/astaxie/beego"
)
type EbaiController struct {
beego.Controller
}
func (c *EbaiController) Msg() {
if c.Ctx.Input.Method() == http.MethodPost {
obj, callbackResponse := api.EbaiAPI.GetCallbackMsg(c.Ctx.Request)
if callbackResponse == nil {
callbackResponse = ebai.OnCallbackMsg(obj)
}
if callbackResponse == nil {
callbackResponse = api.EbaiAPI.Err2CallbackResponse(obj.Cmd, nil, nil)
}
c.Data["json"] = callbackResponse
c.ServeJSON()
} else {
c.Abort("404")
}
}