We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed7ded1 commit b945d96Copy full SHA for b945d96
server/api/v1/system/sys_initdb.go
@@ -45,13 +45,16 @@ func (i *DBApi) InitDB(c *gin.Context) {
45
// @Success 200 {string} string "{"code":0,"data":{},"msg":"探测完成"}"
46
// @Router /init/checkdb [post]
47
func (i *DBApi) CheckDB(c *gin.Context) {
48
+ var (
49
+ message = "前往初始化数据库"
50
+ needInit = true
51
+ )
52
+
53
if global.GVA_DB != nil {
- global.GVA_LOG.Info("数据库无需初始化")
- response.OkWithDetailed(gin.H{"needInit": false}, "数据库无需初始化", c)
- return
- } else {
- global.GVA_LOG.Info("前往初始化数据库")
54
- response.OkWithDetailed(gin.H{"needInit": true}, "前往初始化数据库", c)
55
+ message = "数据库无需初始化"
+ needInit = false
56
}
57
+ global.GVA_LOG.Info(message)
58
+ response.OkWithDetailed(gin.H{"needInit": needInit}, message, c)
59
+ return
60
0 commit comments