You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
670 B

  1. package main
  2. import (
  3. "gin-vue-admin/core"
  4. "gin-vue-admin/global"
  5. "gin-vue-admin/initialize"
  6. )
  7. // @title Swagger Example API
  8. // @version 0.0.1
  9. // @description This is a sample Server pets
  10. // @securityDefinitions.apikey ApiKeyAuth
  11. // @in header
  12. // @name x-token
  13. // @BasePath /
  14. func main() {
  15. global.GVA_VP = core.Viper() // 初始化Viper
  16. global.GVA_LOG = core.Zap() // 初始化zap日志库
  17. global.GVA_DB = initialize.Gorm() // gorm连接数据库
  18. if global.GVA_DB != nil {
  19. initialize.MysqlTables(global.GVA_DB) // 初始化表
  20. // 程序结束前关闭数据库链接
  21. db, _ := global.GVA_DB.DB()
  22. defer db.Close()
  23. }
  24. core.RunWindowsServer()
  25. }