修复swagger无法生成文档

This commit is contained in:
linwenxiang committed 2021-03-24 18:52:59 +08:00
1 parent 6fb7da87a3
commit 12893fc09d
31 files changed
+2032 -2442

No files matched your search

+2 -1
View File
@@ -5,6 +5,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/pkg"
_ "github.com/go-admin-team/go-admin-core/sdk/pkg/response"
"go-admin/app/admin/models/tools"
)
@@ -15,7 +16,7 @@ import (
// @Param tableName query string false "tableName / 数据表名称"
// @Param pageSize query int false "pageSize / 页条数"
// @Param pageIndex query int false "pageIndex / 页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/db/columns/page [get]
func (e *Gen) GetDBColumnList(c *gin.Context) {
log := e.GetLogger(c)
+3 -2
View File
@@ -7,6 +7,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/config"
"github.com/go-admin-team/go-admin-core/sdk/pkg"
_ "github.com/go-admin-team/go-admin-core/sdk/pkg/response"
"go-admin/app/admin/models/tools"
)
@@ -17,10 +18,10 @@ import (
// @Param tableName query string false "tableName / 数据表名称"
// @Param pageSize query int false "pageSize / 页条数"
// @Param pageIndex query int false "pageIndex / 页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/db/tables/page [get]
func (e *Gen) GetDBTableList(c *gin.Context) {
//var res app.Response
//var res response.Response
var data tools.DBTables
var err error
var pageSize = 10
+2 -3
View File
@@ -245,7 +245,6 @@ func (e *Gen) NOActionsGenV3(c *gin.Context, tab tools.SysTables) {
}
func (e *Gen) genApiToFile(c *gin.Context, tab tools.SysTables) {
log := e.GetLogger(c)
@@ -262,7 +261,7 @@ func (e *Gen) genApiToFile(c *gin.Context, tab tools.SysTables) {
err = t1.Execute(&b1, struct {
tools.SysTables
GenerateTime string
}{tab,i} )
}{tab, i})
pkg.FileCreate(b1, "./cmd/migrate/migration/version/"+i+"_migrate.go")
@@ -574,4 +573,4 @@ func (e *Gen) GenMenuAndApi(c *gin.Context) {
ADelete.MenuId, err = ADelete.Create(db)
e.OK(c, "", "数据生成成功!")
}
}
+3 -2
View File
@@ -7,6 +7,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/pkg"
"github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user"
_ "github.com/go-admin-team/go-admin-core/sdk/pkg/response"
"gorm.io/gorm"
"go-admin/app/admin/models/tools"
@@ -23,7 +24,7 @@ type SysTable struct {
// @Param tableName query string false "tableName / 数据表名称"
// @Param pageSize query int false "pageSize / 页条数"
// @Param pageIndex query int false "pageIndex / 页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/sys/tables/page [get]
func (e *SysTable) GetSysTableList(c *gin.Context) {
log := e.GetLogger(c)
@@ -62,7 +63,7 @@ func (e *SysTable) GetSysTableList(c *gin.Context) {
// @Description 获取JSON
// @Tags 工具 - 生成表
// @Param configKey path int true "configKey"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/sys/tables/info/{tableId} [get]
// @Security Bearer
func (e *SysTable) GetSysTables(c *gin.Context) {