package controllers import ( "net/http" "git.rosy.net.cn/baseapi/platformapi/wxpay" "github.com/astaxie/beego" ) type WXPayController struct { beego.Controller } func (c *WXPayController) Msg() { if c.Ctx.Input.Method() == http.MethodPost { var callbackResponse *wxpay.CallbackResponse if callbackResponse == nil { callbackResponse = wxpay.SuccessResponse } c.Data["xml"] = callbackResponse c.ServeXML() } else { c.Abort("404") } }