package controllers import ( "eta/eta_mini_bridge/utils" "net/url" "github.com/beego/beego/v2/server/web" ) type BaseCommonController struct { web.Controller } func (c *BaseCommonController) Prepare() { var requestBody string method := c.Ctx.Input.Method() if method == "GET" { requestBody = c.Ctx.Request.RequestURI } else { requestBody, _ = url.QueryUnescape(string(c.Ctx.Input.RequestBody)) } ip := c.Ctx.Input.IP() utils.ApiLog.Info("uri:%s, requestBody:%s, ip:%s", c.Ctx.Input.URI(), requestBody, ip) }