package main import ( _ "eta/eta_mini_ht_api/common/component" logger "eta/eta_mini_ht_api/common/component/log" "eta/eta_mini_ht_api/common/exception" _ "eta/eta_mini_ht_api/routers" _ "eta/eta_mini_ht_api/task" "github.com/beego/beego/v2/server/web" ) func main() { if web.BConfig.RunMode == "dev" { web.BConfig.WebConfig.DirectoryIndex = true web.BConfig.WebConfig.StaticDir["/swagger"] = "swagger" } //web.ErrorHandler("*", exception.ControllerAdvice()) web.BConfig.RecoverFunc = exception.PanicAdvice go func() { //内存数据预热预加载 logger.Info("开始预加载数据") }() logger.Info("初始化成功") web.Run() }