Browse Source

订正了swagger

修改了
- server/api/v1/sys_initdb.go
- server/api/v1/sys_system.go
迁移了模型
- server/model/sys_init.go -> sysver/model/request/sys_init.go
songzhibin97 4 years ago
parent
commit
ddd802f9c1
3 changed files with 6 additions and 8 deletions
  1. 3 4
      server/api/v1/sys_initdb.go
  2. 2 3
      server/api/v1/sys_system.go
  3. 1 1
      server/model/request/sys_init.go

+ 3 - 4
server/api/v1/sys_initdb.go

@@ -13,11 +13,10 @@ import (
 
 // @Tags InitDB
 // @Summary 初始化用户数据库
-// @Security ApiKeyAuth
 // @Produce  application/json
-// @Param data body request.Empty true "空"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
-// @Router /init/db [post]
+// @Param data body request.InitDB true "初始化数据库参数"
+// @Success 200 {string} string "{"code":0,"data":{},"msg":"自动创建数据库成功"}"
+// @Router /initdb [post]
 func InitDB(c *gin.Context) {
 	if global.GVA_DB != nil {
 		global.GVA_LOG.Error("非法访问")

+ 2 - 3
server/api/v1/sys_system.go

@@ -51,9 +51,8 @@ func SetSystemConfig(c *gin.Context) {
 // @Summary 重启系统
 // @Security ApiKeyAuth
 // @Produce  application/json
-// @Param data body model.System true "重启系统"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":"重启系统成功"}"
-// @Router /system/ReloadSystem [post]
+// @Success 200 {string} string "{"code":0,"data":{},"msg":"重启系统成功"}"
+// @Router /system/reloadSystem [post]
 func ReloadSystem(c *gin.Context) {
 	if runtime.GOOS == "windows" {
 		response.FailWithMessage("系统不支持", c)

+ 1 - 1
server/model/sys_init.go → server/model/request/sys_init.go

@@ -1,4 +1,4 @@
-package model
+package request
 
 type InitDB struct {
 	Host     string `json:"host"`