diff --git a/app/admin/router/sys_router.go b/app/admin/router/sys_router.go index 67132a4..b713e4b 100644 --- a/app/admin/router/sys_router.go +++ b/app/admin/router/sys_router.go @@ -15,7 +15,7 @@ import ( "go-admin/common/middleware" "go-admin/common/middleware/handler" - _ "go-admin/docs" + _ "go-admin/docs/admin" ) func InitSysRouter(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware) *gin.RouterGroup { diff --git a/cmd/api/server.go b/cmd/api/server.go index b5769d6..0a274fe 100644 --- a/cmd/api/server.go +++ b/cmd/api/server.go @@ -134,8 +134,8 @@ func run() error { fmt.Printf("- Local: http://localhost:%d/ \r\n", config.ApplicationConfig.Port) fmt.Printf("- Network: http://%s:%d/ \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) fmt.Println(pkg.Green("Swagger run at:")) - fmt.Printf("- Local: http://localhost:%d/swagger/index.html \r\n", config.ApplicationConfig.Port) - fmt.Printf("- Network: http://%s:%d/swagger/index.html \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) + fmt.Printf("- Local: http://localhost:%d/swagger/admin/index.html \r\n", config.ApplicationConfig.Port) + fmt.Printf("- Network: http://%s:%d/swagger/admin/index.html \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) fmt.Printf("%s Enter Control + C Shutdown Server \r\n", pkg.GetCurrentTimeStr()) // 等待中断信号以优雅地关闭服务器(设置 5 秒的超时时间) quit := make(chan os.Signal) diff --git a/docs/swagger.json b/docs/admin/admin_docs.go similarity index 86% rename from docs/swagger.json rename to docs/admin/admin_docs.go index a6ec818..b2cf06e 100644 --- a/docs/swagger.json +++ b/docs/admin/admin_docs.go @@ -1,15 +1,20 @@ -{ +// Package admin GENERATED BY SWAG; DO NOT EDIT +// This file was generated by swaggo/swag +package admin + +import "github.com/swaggo/swag" + +const docTemplateadmin = `{ + "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { - "description": "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", - "title": "go-admin API", + "description": "{{escape .Description}}", + "title": "{{.Title}}", "contact": {}, - "license": { - "name": "MIT", - "url": "https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md" - }, - "version": "2.0.0" + "version": "{{.Version}}" }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", "paths": { "/api/v1/app-config": { "get": { @@ -78,80 +83,6 @@ } } }, - "/api/v1/db/columns/page": { - "get": { - "description": "数据库表列分页列表 / database table column page list", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据 / page list data", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, - "/api/v1/db/tables/page": { - "get": { - "description": "数据库表分页列表 / database table page list", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据 / page list data", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/dept": { "get": { "security": [ @@ -1241,47 +1172,6 @@ } } }, - "/api/v1/public/uploadFile": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "公共接口" - ], - "summary": "上传图片", - "parameters": [ - { - "type": "string", - "description": "type", - "name": "type", - "in": "query", - "required": true - }, - { - "type": "file", - "description": "file", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/api/v1/role": { "get": { "security": [ @@ -1501,28 +1391,6 @@ } } }, - "/api/v1/server-monitor": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "系统信息" - ], - "summary": "系统信息", - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/set-config": { "get": { "security": [ @@ -2434,165 +2302,6 @@ } } }, - "/api/v1/sys/tables/info": { - "put": { - "security": [ - { - "Bearer": [] - } - ], - "description": "修改表结构", - "consumes": [ - "application/json" - ], - "tags": [ - "工具 / 生成工具" - ], - "summary": "修改表结构", - "parameters": [ - { - "description": "body", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tools.SysTables" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - }, - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "添加表结构", - "consumes": [ - "application/json" - ], - "tags": [ - "工具 / 生成工具" - ], - "summary": "添加表结构", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tables", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sys/tables/info/{tableId}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "工具 / 生成工具" - ], - "summary": "获取配置", - "parameters": [ - { - "type": "integer", - "description": "configKey", - "name": "configKey", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - }, - "delete": { - "description": "删除表结构", - "tags": [ - "工具 / 生成工具" - ], - "summary": "删除表结构", - "parameters": [ - { - "type": "integer", - "description": "tableId", - "name": "tableId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sys/tables/page": { - "get": { - "description": "生成表分页列表", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/user/avatar": { "post": { "security": [ @@ -4072,277 +3781,22 @@ "type": "string" } } - }, - "tools.Params": { - "type": "object", - "properties": { - "treeCode": { - "type": "string" - }, - "treeName": { - "type": "string" - }, - "treeParentCode": { - "type": "string" - } - } - }, - "tools.SysColumns": { - "type": "object", - "properties": { - "columnComment": { - "type": "string" - }, - "columnId": { - "type": "integer" - }, - "columnName": { - "type": "string" - }, - "columnType": { - "type": "string" - }, - "createBy": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "dictType": { - "type": "string" - }, - "edit": { - "type": "boolean" - }, - "fkCol": { - "type": "array", - "items": { - "$ref": "#/definitions/tools.SysColumns" - } - }, - "fkLabelId": { - "type": "string" - }, - "fkLabelName": { - "type": "string" - }, - "fkTableName": { - "type": "string" - }, - "fkTableNameClass": { - "type": "string" - }, - "fkTableNamePackage": { - "type": "string" - }, - "goField": { - "type": "string" - }, - "goType": { - "type": "string" - }, - "htmlType": { - "type": "string" - }, - "increment": { - "type": "boolean" - }, - "insert": { - "type": "boolean" - }, - "isEdit": { - "type": "string" - }, - "isIncrement": { - "type": "string" - }, - "isInsert": { - "type": "string" - }, - "isList": { - "type": "string" - }, - "isPk": { - "type": "string" - }, - "isQuery": { - "type": "string" - }, - "isRequired": { - "type": "string" - }, - "jsonField": { - "type": "string" - }, - "list": { - "type": "string" - }, - "pk": { - "type": "boolean" - }, - "query": { - "type": "boolean" - }, - "queryType": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "sort": { - "type": "integer" - }, - "superColumn": { - "type": "boolean" - }, - "tableId": { - "type": "integer" - }, - "updateBy": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - }, - "usableColumn": { - "type": "boolean" - } - } - }, - "tools.SysTables": { - "type": "object", - "properties": { - "businessName": { - "type": "string" - }, - "className": { - "description": "类名", - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/definitions/tools.SysColumns" - } - }, - "createBy": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "crud": { - "type": "boolean" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "functionAuthor": { - "description": "功能作者", - "type": "string" - }, - "functionName": { - "description": "功能名称", - "type": "string" - }, - "isActions": { - "type": "integer" - }, - "isAuth": { - "type": "integer" - }, - "isDataScope": { - "type": "integer" - }, - "isLogicalDelete": { - "type": "string" - }, - "logicalDelete": { - "type": "boolean" - }, - "logicalDeleteColumn": { - "type": "string" - }, - "moduleFrontName": { - "description": "前端文件名", - "type": "string" - }, - "moduleName": { - "description": "go文件名", - "type": "string" - }, - "options": { - "type": "string" - }, - "packageName": { - "description": "包名", - "type": "string" - }, - "params": { - "$ref": "#/definitions/tools.Params" - }, - "pkColumn": { - "type": "string" - }, - "pkGoField": { - "type": "string" - }, - "pkJsonField": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tableComment": { - "description": "表备注", - "type": "string" - }, - "tableId": { - "description": "表编码", - "type": "integer" - }, - "tableName": { - "description": "表名称", - "type": "string" - }, - "tplCategory": { - "type": "string" - }, - "tree": { - "type": "boolean" - }, - "treeCode": { - "type": "string" - }, - "treeName": { - "type": "string" - }, - "treeParentCode": { - "type": "string" - }, - "updateBy": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - } - } - } - }, - "securityDefinitions": { - "Bearer": { - "type": "apiKey", - "name": "Authorization", - "in": "header" } } -} \ No newline at end of file +}` + +// SwaggerInfoadmin holds exported Swagger Info so clients can modify it +var SwaggerInfoadmin = &swag.Spec{ + Version: "", + Host: "", + BasePath: "", + Schemes: []string{}, + Title: "", + Description: "", + InfoInstanceName: "admin", + SwaggerTemplate: docTemplateadmin, +} + +func init() { + swag.Register(SwaggerInfoadmin.InstanceName(), SwaggerInfoadmin) +} diff --git a/docs/docs.go b/docs/admin/admin_swagger.json similarity index 86% rename from docs/docs.go rename to docs/admin/admin_swagger.json index 780b1d8..c43d903 100644 --- a/docs/docs.go +++ b/docs/admin/admin_swagger.json @@ -1,24 +1,8 @@ -// Package docs GENERATED BY SWAG; DO NOT EDIT -// This file was generated by swaggo/swag -package docs - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, +{ "swagger": "2.0", "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "contact": {}, - "license": { - "name": "MIT", - "url": "https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md" - }, - "version": "{{.Version}}" + "contact": {} }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", "paths": { "/api/v1/app-config": { "get": { @@ -87,80 +71,6 @@ const docTemplate = `{ } } }, - "/api/v1/db/columns/page": { - "get": { - "description": "数据库表列分页列表 / database table column page list", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据 / page list data", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, - "/api/v1/db/tables/page": { - "get": { - "description": "数据库表分页列表 / database table page list", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据 / page list data", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/dept": { "get": { "security": [ @@ -1250,47 +1160,6 @@ const docTemplate = `{ } } }, - "/api/v1/public/uploadFile": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "公共接口" - ], - "summary": "上传图片", - "parameters": [ - { - "type": "string", - "description": "type", - "name": "type", - "in": "query", - "required": true - }, - { - "type": "file", - "description": "file", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/api/v1/role": { "get": { "security": [ @@ -1510,28 +1379,6 @@ const docTemplate = `{ } } }, - "/api/v1/server-monitor": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "系统信息" - ], - "summary": "系统信息", - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/set-config": { "get": { "security": [ @@ -2443,165 +2290,6 @@ const docTemplate = `{ } } }, - "/api/v1/sys/tables/info": { - "put": { - "security": [ - { - "Bearer": [] - } - ], - "description": "修改表结构", - "consumes": [ - "application/json" - ], - "tags": [ - "工具 / 生成工具" - ], - "summary": "修改表结构", - "parameters": [ - { - "description": "body", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tools.SysTables" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - }, - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "添加表结构", - "consumes": [ - "application/json" - ], - "tags": [ - "工具 / 生成工具" - ], - "summary": "添加表结构", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tables", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sys/tables/info/{tableId}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "工具 / 生成工具" - ], - "summary": "获取配置", - "parameters": [ - { - "type": "integer", - "description": "configKey", - "name": "configKey", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - }, - "delete": { - "description": "删除表结构", - "tags": [ - "工具 / 生成工具" - ], - "summary": "删除表结构", - "parameters": [ - { - "type": "integer", - "description": "tableId", - "name": "tableId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sys/tables/page": { - "get": { - "description": "生成表分页列表", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/user/avatar": { "post": { "security": [ @@ -4081,293 +3769,6 @@ const docTemplate = `{ "type": "string" } } - }, - "tools.Params": { - "type": "object", - "properties": { - "treeCode": { - "type": "string" - }, - "treeName": { - "type": "string" - }, - "treeParentCode": { - "type": "string" - } - } - }, - "tools.SysColumns": { - "type": "object", - "properties": { - "columnComment": { - "type": "string" - }, - "columnId": { - "type": "integer" - }, - "columnName": { - "type": "string" - }, - "columnType": { - "type": "string" - }, - "createBy": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "dictType": { - "type": "string" - }, - "edit": { - "type": "boolean" - }, - "fkCol": { - "type": "array", - "items": { - "$ref": "#/definitions/tools.SysColumns" - } - }, - "fkLabelId": { - "type": "string" - }, - "fkLabelName": { - "type": "string" - }, - "fkTableName": { - "type": "string" - }, - "fkTableNameClass": { - "type": "string" - }, - "fkTableNamePackage": { - "type": "string" - }, - "goField": { - "type": "string" - }, - "goType": { - "type": "string" - }, - "htmlType": { - "type": "string" - }, - "increment": { - "type": "boolean" - }, - "insert": { - "type": "boolean" - }, - "isEdit": { - "type": "string" - }, - "isIncrement": { - "type": "string" - }, - "isInsert": { - "type": "string" - }, - "isList": { - "type": "string" - }, - "isPk": { - "type": "string" - }, - "isQuery": { - "type": "string" - }, - "isRequired": { - "type": "string" - }, - "jsonField": { - "type": "string" - }, - "list": { - "type": "string" - }, - "pk": { - "type": "boolean" - }, - "query": { - "type": "boolean" - }, - "queryType": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "sort": { - "type": "integer" - }, - "superColumn": { - "type": "boolean" - }, - "tableId": { - "type": "integer" - }, - "updateBy": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - }, - "usableColumn": { - "type": "boolean" - } - } - }, - "tools.SysTables": { - "type": "object", - "properties": { - "businessName": { - "type": "string" - }, - "className": { - "description": "类名", - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/definitions/tools.SysColumns" - } - }, - "createBy": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "crud": { - "type": "boolean" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "functionAuthor": { - "description": "功能作者", - "type": "string" - }, - "functionName": { - "description": "功能名称", - "type": "string" - }, - "isActions": { - "type": "integer" - }, - "isAuth": { - "type": "integer" - }, - "isDataScope": { - "type": "integer" - }, - "isLogicalDelete": { - "type": "string" - }, - "logicalDelete": { - "type": "boolean" - }, - "logicalDeleteColumn": { - "type": "string" - }, - "moduleFrontName": { - "description": "前端文件名", - "type": "string" - }, - "moduleName": { - "description": "go文件名", - "type": "string" - }, - "options": { - "type": "string" - }, - "packageName": { - "description": "包名", - "type": "string" - }, - "params": { - "$ref": "#/definitions/tools.Params" - }, - "pkColumn": { - "type": "string" - }, - "pkGoField": { - "type": "string" - }, - "pkJsonField": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tableComment": { - "description": "表备注", - "type": "string" - }, - "tableId": { - "description": "表编码", - "type": "integer" - }, - "tableName": { - "description": "表名称", - "type": "string" - }, - "tplCategory": { - "type": "string" - }, - "tree": { - "type": "boolean" - }, - "treeCode": { - "type": "string" - }, - "treeName": { - "type": "string" - }, - "treeParentCode": { - "type": "string" - }, - "updateBy": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - } - } - } - }, - "securityDefinitions": { - "Bearer": { - "type": "apiKey", - "name": "Authorization", - "in": "header" } } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "2.0.0", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "go-admin API", - Description: "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} +} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/admin/admin_swagger.yaml similarity index 86% rename from docs/swagger.yaml rename to docs/admin/admin_swagger.yaml index 95dee5a..7e5318b 100644 --- a/docs/swagger.yaml +++ b/docs/admin/admin_swagger.yaml @@ -876,194 +876,8 @@ definitions: status: type: string type: object - tools.Params: - properties: - treeCode: - type: string - treeName: - type: string - treeParentCode: - type: string - type: object - tools.SysColumns: - properties: - columnComment: - type: string - columnId: - type: integer - columnName: - type: string - columnType: - type: string - createBy: - type: integer - createdAt: - type: string - deletedAt: - type: string - dictType: - type: string - edit: - type: boolean - fkCol: - items: - $ref: '#/definitions/tools.SysColumns' - type: array - fkLabelId: - type: string - fkLabelName: - type: string - fkTableName: - type: string - fkTableNameClass: - type: string - fkTableNamePackage: - type: string - goField: - type: string - goType: - type: string - htmlType: - type: string - increment: - type: boolean - insert: - type: boolean - isEdit: - type: string - isIncrement: - type: string - isInsert: - type: string - isList: - type: string - isPk: - type: string - isQuery: - type: string - isRequired: - type: string - jsonField: - type: string - list: - type: string - pk: - type: boolean - query: - type: boolean - queryType: - type: string - remark: - type: string - required: - type: boolean - sort: - type: integer - superColumn: - type: boolean - tableId: - type: integer - updateBy: - type: integer - updatedAt: - type: string - usableColumn: - type: boolean - type: object - tools.SysTables: - properties: - businessName: - type: string - className: - description: 类名 - type: string - columns: - items: - $ref: '#/definitions/tools.SysColumns' - type: array - createBy: - type: integer - createdAt: - type: string - crud: - type: boolean - dataScope: - type: string - deletedAt: - type: string - functionAuthor: - description: 功能作者 - type: string - functionName: - description: 功能名称 - type: string - isActions: - type: integer - isAuth: - type: integer - isDataScope: - type: integer - isLogicalDelete: - type: string - logicalDelete: - type: boolean - logicalDeleteColumn: - type: string - moduleFrontName: - description: 前端文件名 - type: string - moduleName: - description: go文件名 - type: string - options: - type: string - packageName: - description: 包名 - type: string - params: - $ref: '#/definitions/tools.Params' - pkColumn: - type: string - pkGoField: - type: string - pkJsonField: - type: string - remark: - type: string - tableComment: - description: 表备注 - type: string - tableId: - description: 表编码 - type: integer - tableName: - description: 表名称 - type: string - tplCategory: - type: string - tree: - type: boolean - treeCode: - type: string - treeName: - type: string - treeParentCode: - type: string - updateBy: - type: integer - updatedAt: - type: string - type: object info: contact: {} - description: |- - 基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档 - 添加qq群: 521386980 进入技术交流群 请先star,谢谢! - license: - name: MIT - url: https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md - title: go-admin API - version: 2.0.0 paths: /api/v1/app-config: get: @@ -1103,54 +917,6 @@ paths: summary: 获取验证码 tags: - 登陆 - /api/v1/db/columns/page: - get: - description: 数据库表列分页列表 / database table column page list - parameters: - - description: tableName / 数据表名称 - in: query - name: tableName - type: string - - description: pageSize / 页条数 - in: query - name: pageSize - type: integer - - description: pageIndex / 页码 - in: query - name: pageIndex - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - summary: 分页列表数据 / page list data - tags: - - 工具 / 生成工具 - /api/v1/db/tables/page: - get: - description: 数据库表分页列表 / database table page list - parameters: - - description: tableName / 数据表名称 - in: query - name: tableName - type: string - - description: pageSize / 页条数 - in: query - name: pageSize - type: integer - - description: pageIndex / 页码 - in: query - name: pageIndex - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - summary: 分页列表数据 / page list data - tags: - - 工具 / 生成工具 /api/v1/dept: delete: description: 删除数据 @@ -1829,32 +1595,6 @@ paths: summary: 获取岗位信息 tags: - 岗位 - /api/v1/public/uploadFile: - post: - consumes: - - multipart/form-data - description: 获取JSON - parameters: - - description: type - in: query - name: type - required: true - type: string - - description: file - in: formData - name: file - required: true - type: file - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 上传图片 - tags: - - 公共接口 /api/v1/role: delete: description: 删除数据 @@ -1990,19 +1730,6 @@ paths: summary: 修改用户角色 tags: - 角色/Role - /api/v1/server-monitor: - get: - description: 获取JSON - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - security: - - Bearer: [] - summary: 系统信息 - tags: - - 系统信息 /api/v1/set-config: get: consumes: @@ -2550,106 +2277,6 @@ paths: summary: 修改用户数据 tags: - 用户 - /api/v1/sys/tables/info: - post: - consumes: - - application/json - description: 添加表结构 - parameters: - - description: tableName / 数据表名称 - in: query - name: tables - type: string - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 添加表结构 - tags: - - 工具 / 生成工具 - put: - consumes: - - application/json - description: 修改表结构 - parameters: - - description: body - in: body - name: data - required: true - schema: - $ref: '#/definitions/tools.SysTables' - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 修改表结构 - tags: - - 工具 / 生成工具 - /api/v1/sys/tables/info/{tableId}: - delete: - description: 删除表结构 - parameters: - - description: tableId - in: path - name: tableId - required: true - type: integer - responses: - "200": - description: '{"code": -1, "message": "删除失败"}' - schema: - type: string - summary: 删除表结构 - tags: - - 工具 / 生成工具 - get: - description: 获取JSON - parameters: - - description: configKey - in: path - name: configKey - required: true - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - security: - - Bearer: [] - summary: 获取配置 - tags: - - 工具 / 生成工具 - /api/v1/sys/tables/page: - get: - description: 生成表分页列表 - parameters: - - description: tableName / 数据表名称 - in: query - name: tableName - type: string - - description: pageSize / 页条数 - in: query - name: pageSize - type: integer - - description: pageIndex / 页码 - in: query - name: pageIndex - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - summary: 分页列表数据 - tags: - - 工具 / 生成工具 /api/v1/user/avatar: post: consumes: @@ -2763,9 +2390,4 @@ paths: security: - Bearer: [] summary: 退出登录 -securityDefinitions: - Bearer: - in: header - name: Authorization - type: apiKey swagger: "2.0" diff --git a/ssh/swag.sh b/ssh/swag.sh new file mode 100755 index 0000000..48139df --- /dev/null +++ b/ssh/swag.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +swag i -g init_router.go -dir app/admin/router --instanceName admin --parseDependency -o docs/admin