This commit is contained in:
suyl
2021-06-15 11:13:30 +08:00
parent fe4073597e
commit c6275b162f
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package controllers
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
beego "github.com/astaxie/beego/server/web"
"net/http"
)
type PrintController struct {
beego.Controller
}
type CallBackPrint struct {
Data string `json:"data"`
Code string `json:"code"`
}
func (c *PrintController) Msg() {
if c.Ctx.Input.Method() == http.MethodPost {
callBackPrint := &CallBackPrint{}
globals.SugarLogger.Debugf("print callback callbackResponse:%s", utils.Format4Output(c.Ctx.Request, true))
c.Data["json"] = callBackPrint
c.ServeJSON()
} else {
c.Abort("404")
}
}

View File

@@ -61,6 +61,11 @@ func init() {
&controllers.UnionController{},
),
),
web.NSNamespace("/print",
web.NSInclude(
&controllers.PrintController{},
),
),
)
web.AddNamespace(ns)
web.AutoRouter(&controllers.WXPayController{})