init.go 343 B

12345678910111213141516171819
  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. }