mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
【更新】更新swagger文档
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/XM-GO/PandaKit/model"
|
||||
"github.com/XM-GO/PandaKit/restfulx"
|
||||
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
"pandax/apps/develop/api"
|
||||
"pandax/apps/develop/api/vo"
|
||||
"pandax/apps/develop/entity"
|
||||
"pandax/apps/develop/services"
|
||||
)
|
||||
|
||||
@@ -23,21 +26,21 @@ func InitGenTableRouter(container *restful.Container) {
|
||||
}).
|
||||
Doc("获取数据库列表").
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Returns(200, "OK", []map[string]any{}))
|
||||
Returns(200, "OK", model.ResultPage{}))
|
||||
|
||||
ws.Route(ws.GET("/list").To(func(request *restful.Request, response *restful.Response) {
|
||||
restfulx.NewReqCtx(request, response).WithLog("获取表列表").Handle(s.GetTablePage)
|
||||
}).
|
||||
Doc("获取表列表").
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Returns(200, "OK", []any{}))
|
||||
Returns(200, "OK", model.ResultPage{}))
|
||||
|
||||
ws.Route(ws.GET("/info/tableName").To(func(request *restful.Request, response *restful.Response) {
|
||||
restfulx.NewReqCtx(request, response).WithLog("获取表信息By tableName").Handle(s.GetTableInfoByName)
|
||||
}).
|
||||
Doc("获取表信息By tableName").
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Returns(200, "OK", []any{}))
|
||||
Returns(200, "OK", vo.TableInfoVo{}))
|
||||
|
||||
ws.Route(ws.GET("/info/{tableId}").To(func(request *restful.Request, response *restful.Response) {
|
||||
restfulx.NewReqCtx(request, response).WithLog("获取表信息").Handle(s.GetTableInfo)
|
||||
@@ -45,7 +48,7 @@ func InitGenTableRouter(container *restful.Container) {
|
||||
Doc("获取表信息").
|
||||
Param(ws.PathParameter("tenantId", "租户Id").DataType("int").DefaultValue("1")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Returns(200, "OK", map[string]any{}).
|
||||
Returns(200, "OK", vo.TableInfoVo{}).
|
||||
Returns(404, "Not Found", nil))
|
||||
|
||||
ws.Route(ws.GET("/tableTree").To(func(request *restful.Request, response *restful.Response) {
|
||||
@@ -53,7 +56,7 @@ func InitGenTableRouter(container *restful.Container) {
|
||||
}).
|
||||
Doc("获取表树").
|
||||
Metadata(restfulspec.KeyOpenAPITags, tags).
|
||||
Returns(200, "OK", []any{}))
|
||||
Returns(200, "OK", []entity.DevGenTable{}))
|
||||
|
||||
ws.Route(ws.POST("").To(func(request *restful.Request, response *restful.Response) {
|
||||
restfulx.NewReqCtx(request, response).WithLog("新增表").Handle(s.Insert)
|
||||
|
||||
Reference in New Issue
Block a user