beego.go
585 字节
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/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)
timeLocal, _ := time.LoadLocation("Asia/Chongqing")
time.Local = timeLocal
}