beego.go
843 字节
package beego
import (
"github.com/astaxie/beego"
"github.com/linmadan/egglib-go/web/beego/filters"
. "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/log"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/port/beego/middleware"
_ "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/port/beego/routers"
"time"
)
func init() {
beego.InsertFilter("/*", beego.BeforeExec, filters.CreateRequestBodyFilter())
//beego.InsertFilter("/*", beego.BeforeExec, filters.CreateRequstLogFilter(Logger))
//beego.InsertFilter("/*", beego.AfterExec, filters.CreateResponseLogFilter(Logger), false)
beego.InsertFilter("/*", beego.BeforeExec, middleware.CreateRequstLogFilter(Logger))
beego.InsertFilter("/*", beego.AfterExec, middleware.CreateResponseLogFilter(Logger), false)
timeLocal, _ := time.LoadLocation("Asia/Chongqing")
time.Local = timeLocal
}