1
This commit is contained in:
@@ -3,40 +3,28 @@ package controllers
|
||||
import (
|
||||
"bytes"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/jdshop"
|
||||
"io/ioutil"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type JdsController struct {
|
||||
web.Controller
|
||||
}
|
||||
|
||||
// Msg 这个是京东秒送平台回调
|
||||
//func (c *JdsController) Msg() {
|
||||
// if c.Ctx.Input.Method() == http.MethodPost {
|
||||
// ctx := c.Ctx
|
||||
// ctx.Request.Body = ioutil.NopCloser(bytes.NewReader(ctx.Input.RequestBody))
|
||||
// call, err := api.JdShopAPI.GetCallbackMsg(ctx.Request)
|
||||
// if err == nil {
|
||||
// jdshop.OnCallbackMsg(call)
|
||||
// }
|
||||
// c.Data["json"] = call
|
||||
// c.ServeJSON()
|
||||
// } else {
|
||||
// c.Abort("404")
|
||||
// }
|
||||
//}
|
||||
|
||||
// Msg 这个是京东秒送平台回调
|
||||
func (c *JdsController) Msg() {
|
||||
ctx := c.Ctx
|
||||
ctx.Request.Body = ioutil.NopCloser(bytes.NewReader(ctx.Input.RequestBody))
|
||||
call, err := api.JdShopAPI.GetCallbackMsg(ctx.Request)
|
||||
if err == nil {
|
||||
jdshop.OnCallbackMsg(call)
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
ctx := c.Ctx
|
||||
ctx.Request.Body = ioutil.NopCloser(bytes.NewReader(ctx.Input.RequestBody))
|
||||
call, err := api.JdShopAPI.GetCallbackMsg(ctx.Request)
|
||||
if err == nil {
|
||||
jdshop.OnCallbackMsg(call)
|
||||
}
|
||||
c.Data["json"] = call
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
c.Abort("404")
|
||||
}
|
||||
c.Data["json"] = call
|
||||
c.ServeJSON()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user