Skip to content

Commit b945d96

Browse files
committed
style:方便linker捕获
1 parent ed7ded1 commit b945d96

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

server/api/v1/system/sys_initdb.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,16 @@ func (i *DBApi) InitDB(c *gin.Context) {
4545
// @Success 200 {string} string "{"code":0,"data":{},"msg":"探测完成"}"
4646
// @Router /init/checkdb [post]
4747
func (i *DBApi) CheckDB(c *gin.Context) {
48+
var (
49+
message = "前往初始化数据库"
50+
needInit = true
51+
)
52+
4853
if global.GVA_DB != nil {
49-
global.GVA_LOG.Info("数据库无需初始化")
50-
response.OkWithDetailed(gin.H{"needInit": false}, "数据库无需初始化", c)
51-
return
52-
} else {
53-
global.GVA_LOG.Info("前往初始化数据库")
54-
response.OkWithDetailed(gin.H{"needInit": true}, "前往初始化数据库", c)
55-
return
54+
message = "数据库无需初始化"
55+
needInit = false
5656
}
57+
global.GVA_LOG.Info(message)
58+
response.OkWithDetailed(gin.H{"needInit": needInit}, message, c)
59+
return
5760
}

0 commit comments

Comments
 (0)