init.go 359 B

1234567891011121314151617181920
  1. package init
  2. import (
  3. "encoding/gob"
  4. "fmt"
  5. _ "github.com/beego/beego/v2/server/web/session/redis"
  6. "nginx-ui/server/config"
  7. "nginx-ui/server/db"
  8. "nginx-ui/server/models"
  9. _ "nginx-ui/server/routers"
  10. )
  11. func init() {
  12. fmt.Printf("-------init---")
  13. gob.Register(models.User{})
  14. db.Init()
  15. config.InitAdmin()
  16. fmt.Println("init success")
  17. ensureRoutes()
  18. }