30 lines
651 B
Go
30 lines
651 B
Go
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")
|
|
}
|
|
}
|