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
665 B

  1. package main
  2. import (
  3. "gin-vue-admin/core"
  4. "gin-vue-admin/global"
  5. "gin-vue-admin/gva/init_data"
  6. "gin-vue-admin/initialize"
  7. )
  8. // @title Swagger Example API
  9. // @version 0.0.1
  10. // @description This is a sample Server pets
  11. // @securityDefinitions.apikey ApiKeyAuth
  12. // @in header
  13. // @name x-token
  14. // @BasePath /
  15. func main() {
  16. initialize.Gorm()
  17. if global.GVA_CONFIG.System.NeedInitData {
  18. init_data.InitData() // 通过配置文件初始化数据 默认为 false 首次运行需要将 ./config.yaml中 system下的 need-init-data 修改为true
  19. }
  20. // 程序结束前关闭数据库链接
  21. db, _ := global.GVA_DB.DB()
  22. defer db.Close()
  23. core.RunWindowsServer()
  24. }