1
This commit is contained in:
@@ -2,10 +2,8 @@ package controllers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/jdshop"
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/jdshop"
|
||||||
|
"io/ioutil"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
"github.com/astaxie/beego/server/web"
|
"github.com/astaxie/beego/server/web"
|
||||||
@@ -15,8 +13,24 @@ type JdsController struct {
|
|||||||
web.Controller
|
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() {
|
func (c *JdsController) Msg() {
|
||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
|
||||||
ctx := c.Ctx
|
ctx := c.Ctx
|
||||||
ctx.Request.Body = ioutil.NopCloser(bytes.NewReader(ctx.Input.RequestBody))
|
ctx.Request.Body = ioutil.NopCloser(bytes.NewReader(ctx.Input.RequestBody))
|
||||||
call, err := api.JdShopAPI.GetCallbackMsg(ctx.Request)
|
call, err := api.JdShopAPI.GetCallbackMsg(ctx.Request)
|
||||||
@@ -25,7 +39,4 @@ func (c *JdsController) Msg() {
|
|||||||
}
|
}
|
||||||
c.Data["json"] = call
|
c.Data["json"] = call
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
} else {
|
|
||||||
c.Abort("404")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user