beego.go
668 字节
package appsvr
import (
"github.com/astaxie/beego"
. "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr/middleware"
_ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr/routers"
)
func init() {
beego.InsertFilter("/*", beego.BeforeExec, middleware.CreateRequestBodyFilter())
beego.InsertFilter("/v1/*", beego.BeforeExec, middleware.CheckJWTToken)
beego.InsertFilter("/v2/*", beego.BeforeExec, middleware.CheckJWTToken)
beego.InsertFilter("/*", beego.BeforeExec, middleware.CreateRequstLogFilter(Logger))
beego.InsertFilter("/*", beego.AfterExec, middleware.CreateResponseLogFilter(Logger), false)
}