|
1 | 1 | package main
|
2 | 2 |
|
3 |
| -//import ( |
4 |
| -// "gin-vue-admin/core" |
5 |
| -// "gin-vue-admin/global" |
6 |
| -// "gin-vue-admin/initialize" |
7 |
| -//) |
8 |
| -// |
9 |
| -////go:generate go env -w GO111MODULE=on |
10 |
| -////go:generate go env -w GOPROXY=https://goproxy.cn,direct |
11 |
| -////go:generate go mod tidy |
12 |
| -////go:generate go mod download |
13 |
| -// |
14 |
| -//// @title Swagger Example API |
15 |
| -//// @version 0.0.1 |
16 |
| -//// @description This is a sample Server pets |
17 |
| -//// @securityDefinitions.apikey ApiKeyAuth |
18 |
| -//// @in header |
19 |
| -//// @name x-token |
20 |
| -//// @BasePath / |
21 |
| -//func main() { |
22 |
| -// global.GVA_VP = core.Viper() // 初始化Viper |
23 |
| -// global.GVA_LOG = core.Zap() // 初始化zap日志库 |
24 |
| -// global.GVA_DB = initialize.Gorm() // gorm连接数据库 |
25 |
| -// initialize.Timer() |
26 |
| -// if global.GVA_DB != nil { |
27 |
| -// initialize.MysqlTables(global.GVA_DB) // 初始化表 |
28 |
| -// // 程序结束前关闭数据库链接 |
29 |
| -// db, _ := global.GVA_DB.DB() |
30 |
| -// defer db.Close() |
31 |
| -// } |
32 |
| -// core.RunWindowsServer() |
33 |
| -//} |
| 3 | +import ( |
| 4 | + "gin-vue-admin/core" |
| 5 | + "gin-vue-admin/global" |
| 6 | + "gin-vue-admin/initialize" |
| 7 | +) |
34 | 8 |
|
35 |
| -var Plugin plugin |
| 9 | +//go:generate go env -w GO111MODULE=on |
| 10 | +//go:generate go env -w GOPROXY=https://goproxy.cn,direct |
| 11 | +//go:generate go mod tidy |
| 12 | +//go:generate go mod download |
36 | 13 |
|
37 |
| -type plugin struct { |
| 14 | +// @title Swagger Example API |
| 15 | +// @version 0.0.1 |
| 16 | +// @description This is a sample Server pets |
| 17 | +// @securityDefinitions.apikey ApiKeyAuth |
| 18 | +// @in header |
| 19 | +// @name x-token |
| 20 | +// @BasePath / |
| 21 | +func main() { |
| 22 | + global.GVA_VP = core.Viper() // 初始化Viper |
| 23 | + global.GVA_LOG = core.Zap() // 初始化zap日志库 |
| 24 | + global.GVA_DB = initialize.Gorm() // gorm连接数据库 |
| 25 | + initialize.Timer() |
| 26 | + if global.GVA_DB != nil { |
| 27 | + initialize.MysqlTables(global.GVA_DB) // 初始化表 |
| 28 | + // 程序结束前关闭数据库链接 |
| 29 | + db, _ := global.GVA_DB.DB() |
| 30 | + defer db.Close() |
| 31 | + } |
| 32 | + core.RunWindowsServer() |
38 | 33 | }
|
0 commit comments