From 8e9744e7d58a99191a7fb9814d80f889036c9a1b Mon Sep 17 00:00:00 2001 From: LyricTian Date: Fri, 22 Oct 2021 20:39:45 +0800 Subject: [PATCH] Update swagger --- .../middleware/{mw_trace.go => trace.mw.go} | 0 internal/app/swagger/docs.go | 68 +++++++++---------- internal/app/swagger/swagger.json | 68 +++++++++---------- internal/app/swagger/swagger.yaml | 68 +++++++++---------- 4 files changed, 96 insertions(+), 108 deletions(-) rename internal/app/middleware/{mw_trace.go => trace.mw.go} (100%) diff --git a/internal/app/middleware/mw_trace.go b/internal/app/middleware/trace.mw.go similarity index 100% rename from internal/app/middleware/mw_trace.go rename to internal/app/middleware/trace.mw.go diff --git a/internal/app/swagger/docs.go b/internal/app/swagger/docs.go index 94890182..dcf18f16 100644 --- a/internal/app/swagger/docs.go +++ b/internal/app/swagger/docs.go @@ -35,7 +35,7 @@ var doc = `{ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "查询数据", "parameters": [ @@ -129,7 +129,7 @@ var doc = `{ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "创建数据", "parameters": [ @@ -179,7 +179,7 @@ var doc = `{ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "查询菜单树", "parameters": [ @@ -241,7 +241,7 @@ var doc = `{ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "查询指定数据", "parameters": [ @@ -281,7 +281,7 @@ var doc = `{ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "更新数据", "parameters": [ @@ -336,7 +336,7 @@ var doc = `{ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "删除数据", "parameters": [ @@ -378,7 +378,7 @@ var doc = `{ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "禁用数据", "parameters": [ @@ -420,7 +420,7 @@ var doc = `{ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "启用数据", "parameters": [ @@ -462,7 +462,7 @@ var doc = `{ } ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "查询当前用户菜单树", "responses": { @@ -510,7 +510,7 @@ var doc = `{ } ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "更新个人密码", "parameters": [ @@ -554,7 +554,7 @@ var doc = `{ } ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "获取当前用户信息", "responses": { @@ -582,7 +582,7 @@ var doc = `{ "/api/v1/pub/login": { "post": { "tags": [ - "登录管理" + "LoginAPI" ], "summary": "用户登录", "parameters": [ @@ -624,7 +624,7 @@ var doc = `{ "image/png" ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "响应图形验证码", "parameters": [ @@ -664,7 +664,7 @@ var doc = `{ "/api/v1/pub/login/captchaid": { "get": { "tags": [ - "登录管理" + "LoginAPI" ], "summary": "获取验证码信息", "responses": { @@ -680,7 +680,7 @@ var doc = `{ "/api/v1/pub/login/exit": { "post": { "tags": [ - "登录管理" + "LoginAPI" ], "summary": "用户登出", "responses": { @@ -701,7 +701,7 @@ var doc = `{ } ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "刷新令牌", "responses": { @@ -734,7 +734,7 @@ var doc = `{ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "查询数据", "parameters": [ @@ -810,7 +810,7 @@ var doc = `{ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "创建数据", "parameters": [ @@ -860,7 +860,7 @@ var doc = `{ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "查询选择数据", "parameters": [ @@ -922,7 +922,7 @@ var doc = `{ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "查询指定数据", "parameters": [ @@ -968,7 +968,7 @@ var doc = `{ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "更新数据", "parameters": [ @@ -1023,7 +1023,7 @@ var doc = `{ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "删除数据", "parameters": [ @@ -1065,7 +1065,7 @@ var doc = `{ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "禁用数据", "parameters": [ @@ -1107,7 +1107,7 @@ var doc = `{ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "启用数据", "parameters": [ @@ -1149,7 +1149,7 @@ var doc = `{ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "查询数据", "parameters": [ @@ -1231,7 +1231,7 @@ var doc = `{ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "创建数据", "parameters": [ @@ -1281,7 +1281,7 @@ var doc = `{ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "查询指定数据", "parameters": [ @@ -1321,7 +1321,7 @@ var doc = `{ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "更新数据", "parameters": [ @@ -1376,7 +1376,7 @@ var doc = `{ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "删除数据", "parameters": [ @@ -1418,7 +1418,7 @@ var doc = `{ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "禁用数据", "parameters": [ @@ -1460,7 +1460,7 @@ var doc = `{ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "启用数据", "parameters": [ @@ -1500,11 +1500,9 @@ var doc = `{ "type": "object", "properties": { "code": { - "description": "错误码", "type": "integer" }, "message": { - "description": "错误信息", "type": "string" } } @@ -1513,7 +1511,6 @@ var doc = `{ "type": "object", "properties": { "error": { - "description": "错误项", "$ref": "#/definitions/schema.ErrorItem" } } @@ -1582,7 +1579,7 @@ var doc = `{ "type": "string" }, "expires_at": { - "description": "令牌到期时间戳", + "description": "过期时间戳", "type": "integer" }, "token_type": { @@ -1879,7 +1876,6 @@ var doc = `{ "type": "object", "properties": { "status": { - "description": "状态(OK)", "type": "string" } } diff --git a/internal/app/swagger/swagger.json b/internal/app/swagger/swagger.json index 95be70b6..3f824b57 100644 --- a/internal/app/swagger/swagger.json +++ b/internal/app/swagger/swagger.json @@ -23,7 +23,7 @@ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "查询数据", "parameters": [ @@ -117,7 +117,7 @@ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "创建数据", "parameters": [ @@ -167,7 +167,7 @@ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "查询菜单树", "parameters": [ @@ -229,7 +229,7 @@ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "查询指定数据", "parameters": [ @@ -269,7 +269,7 @@ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "更新数据", "parameters": [ @@ -324,7 +324,7 @@ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "删除数据", "parameters": [ @@ -366,7 +366,7 @@ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "禁用数据", "parameters": [ @@ -408,7 +408,7 @@ } ], "tags": [ - "菜单管理" + "MenuAPI" ], "summary": "启用数据", "parameters": [ @@ -450,7 +450,7 @@ } ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "查询当前用户菜单树", "responses": { @@ -498,7 +498,7 @@ } ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "更新个人密码", "parameters": [ @@ -542,7 +542,7 @@ } ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "获取当前用户信息", "responses": { @@ -570,7 +570,7 @@ "/api/v1/pub/login": { "post": { "tags": [ - "登录管理" + "LoginAPI" ], "summary": "用户登录", "parameters": [ @@ -612,7 +612,7 @@ "image/png" ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "响应图形验证码", "parameters": [ @@ -652,7 +652,7 @@ "/api/v1/pub/login/captchaid": { "get": { "tags": [ - "登录管理" + "LoginAPI" ], "summary": "获取验证码信息", "responses": { @@ -668,7 +668,7 @@ "/api/v1/pub/login/exit": { "post": { "tags": [ - "登录管理" + "LoginAPI" ], "summary": "用户登出", "responses": { @@ -689,7 +689,7 @@ } ], "tags": [ - "登录管理" + "LoginAPI" ], "summary": "刷新令牌", "responses": { @@ -722,7 +722,7 @@ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "查询数据", "parameters": [ @@ -798,7 +798,7 @@ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "创建数据", "parameters": [ @@ -848,7 +848,7 @@ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "查询选择数据", "parameters": [ @@ -910,7 +910,7 @@ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "查询指定数据", "parameters": [ @@ -956,7 +956,7 @@ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "更新数据", "parameters": [ @@ -1011,7 +1011,7 @@ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "删除数据", "parameters": [ @@ -1053,7 +1053,7 @@ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "禁用数据", "parameters": [ @@ -1095,7 +1095,7 @@ } ], "tags": [ - "角色管理" + "RoleAPI" ], "summary": "启用数据", "parameters": [ @@ -1137,7 +1137,7 @@ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "查询数据", "parameters": [ @@ -1219,7 +1219,7 @@ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "创建数据", "parameters": [ @@ -1269,7 +1269,7 @@ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "查询指定数据", "parameters": [ @@ -1309,7 +1309,7 @@ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "更新数据", "parameters": [ @@ -1364,7 +1364,7 @@ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "删除数据", "parameters": [ @@ -1406,7 +1406,7 @@ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "禁用数据", "parameters": [ @@ -1448,7 +1448,7 @@ } ], "tags": [ - "用户管理" + "UserAPI" ], "summary": "启用数据", "parameters": [ @@ -1488,11 +1488,9 @@ "type": "object", "properties": { "code": { - "description": "错误码", "type": "integer" }, "message": { - "description": "错误信息", "type": "string" } } @@ -1501,7 +1499,6 @@ "type": "object", "properties": { "error": { - "description": "错误项", "$ref": "#/definitions/schema.ErrorItem" } } @@ -1570,7 +1567,7 @@ "type": "string" }, "expires_at": { - "description": "令牌到期时间戳", + "description": "过期时间戳", "type": "integer" }, "token_type": { @@ -1867,7 +1864,6 @@ "type": "object", "properties": { "status": { - "description": "状态(OK)", "type": "string" } } diff --git a/internal/app/swagger/swagger.yaml b/internal/app/swagger/swagger.yaml index c86db219..41ff5f23 100644 --- a/internal/app/swagger/swagger.yaml +++ b/internal/app/swagger/swagger.yaml @@ -3,17 +3,14 @@ definitions: schema.ErrorItem: properties: code: - description: 错误码 type: integer message: - description: 错误信息 type: string type: object schema.ErrorResult: properties: error: $ref: '#/definitions/schema.ErrorItem' - description: 错误项 type: object schema.IDResult: properties: @@ -60,7 +57,7 @@ definitions: description: 访问令牌 type: string expires_at: - description: 令牌到期时间戳 + description: 过期时间戳 type: integer token_type: description: 令牌类型 @@ -279,7 +276,6 @@ definitions: schema.StatusResult: properties: status: - description: 状态(OK) type: string type: object schema.UpdatePasswordParam: @@ -465,7 +461,7 @@ paths: - ApiKeyAuth: [] summary: 查询数据 tags: - - 菜单管理 + - MenuAPI post: parameters: - description: 创建数据 @@ -495,7 +491,7 @@ paths: - ApiKeyAuth: [] summary: 创建数据 tags: - - 菜单管理 + - MenuAPI /api/v1/menus.tree: get: parameters: @@ -531,7 +527,7 @@ paths: - ApiKeyAuth: [] summary: 查询菜单树 tags: - - 菜单管理 + - MenuAPI /api/v1/menus/{id}: delete: parameters: @@ -557,7 +553,7 @@ paths: - ApiKeyAuth: [] summary: 删除数据 tags: - - 菜单管理 + - MenuAPI get: parameters: - description: 唯一标识 @@ -582,7 +578,7 @@ paths: - ApiKeyAuth: [] summary: 查询指定数据 tags: - - 菜单管理 + - MenuAPI put: parameters: - description: 唯一标识 @@ -617,7 +613,7 @@ paths: - ApiKeyAuth: [] summary: 更新数据 tags: - - 菜单管理 + - MenuAPI /api/v1/menus/{id}/disable: patch: parameters: @@ -643,7 +639,7 @@ paths: - ApiKeyAuth: [] summary: 禁用数据 tags: - - 菜单管理 + - MenuAPI /api/v1/menus/{id}/enable: patch: parameters: @@ -669,7 +665,7 @@ paths: - ApiKeyAuth: [] summary: 启用数据 tags: - - 菜单管理 + - MenuAPI /api/v1/pub/current/menutree: get: responses: @@ -696,7 +692,7 @@ paths: - ApiKeyAuth: [] summary: 查询当前用户菜单树 tags: - - 登录管理 + - LoginAPI /api/v1/pub/current/password: put: parameters: @@ -723,7 +719,7 @@ paths: - ApiKeyAuth: [] summary: 更新个人密码 tags: - - 登录管理 + - LoginAPI /api/v1/pub/current/user: get: responses: @@ -743,7 +739,7 @@ paths: - ApiKeyAuth: [] summary: 获取当前用户信息 tags: - - 登录管理 + - LoginAPI /api/v1/pub/login: post: parameters: @@ -768,7 +764,7 @@ paths: $ref: '#/definitions/schema.ErrorResult' summary: 用户登录 tags: - - 登录管理 + - LoginAPI /api/v1/pub/login/captcha: get: parameters: @@ -796,7 +792,7 @@ paths: $ref: '#/definitions/schema.ErrorResult' summary: 响应图形验证码 tags: - - 登录管理 + - LoginAPI /api/v1/pub/login/captchaid: get: responses: @@ -806,7 +802,7 @@ paths: $ref: '#/definitions/schema.LoginCaptcha' summary: 获取验证码信息 tags: - - 登录管理 + - LoginAPI /api/v1/pub/login/exit: post: responses: @@ -816,7 +812,7 @@ paths: $ref: '#/definitions/schema.StatusResult' summary: 用户登出 tags: - - 登录管理 + - LoginAPI /api/v1/pub/refresh-token: post: responses: @@ -836,7 +832,7 @@ paths: - ApiKeyAuth: [] summary: 刷新令牌 tags: - - 登录管理 + - LoginAPI /api/v1/roles: get: parameters: @@ -884,7 +880,7 @@ paths: - ApiKeyAuth: [] summary: 查询数据 tags: - - 角色管理 + - RoleAPI post: parameters: - description: 创建数据 @@ -914,7 +910,7 @@ paths: - ApiKeyAuth: [] summary: 创建数据 tags: - - 角色管理 + - RoleAPI /api/v1/roles.select: get: parameters: @@ -950,7 +946,7 @@ paths: - ApiKeyAuth: [] summary: 查询选择数据 tags: - - 角色管理 + - RoleAPI /api/v1/roles/{id}: delete: parameters: @@ -976,7 +972,7 @@ paths: - ApiKeyAuth: [] summary: 删除数据 tags: - - 角色管理 + - RoleAPI get: parameters: - description: 唯一标识 @@ -1005,7 +1001,7 @@ paths: - ApiKeyAuth: [] summary: 查询指定数据 tags: - - 角色管理 + - RoleAPI put: parameters: - description: 唯一标识 @@ -1040,7 +1036,7 @@ paths: - ApiKeyAuth: [] summary: 更新数据 tags: - - 角色管理 + - RoleAPI /api/v1/roles/{id}/disable: patch: parameters: @@ -1066,7 +1062,7 @@ paths: - ApiKeyAuth: [] summary: 禁用数据 tags: - - 角色管理 + - RoleAPI /api/v1/roles/{id}/enable: patch: parameters: @@ -1092,7 +1088,7 @@ paths: - ApiKeyAuth: [] summary: 启用数据 tags: - - 角色管理 + - RoleAPI /api/v1/users: get: parameters: @@ -1144,7 +1140,7 @@ paths: - ApiKeyAuth: [] summary: 查询数据 tags: - - 用户管理 + - UserAPI post: parameters: - description: 创建数据 @@ -1174,7 +1170,7 @@ paths: - ApiKeyAuth: [] summary: 创建数据 tags: - - 用户管理 + - UserAPI /api/v1/users/{id}: delete: parameters: @@ -1200,7 +1196,7 @@ paths: - ApiKeyAuth: [] summary: 删除数据 tags: - - 用户管理 + - UserAPI get: parameters: - description: 唯一标识 @@ -1225,7 +1221,7 @@ paths: - ApiKeyAuth: [] summary: 查询指定数据 tags: - - 用户管理 + - UserAPI put: parameters: - description: 唯一标识 @@ -1260,7 +1256,7 @@ paths: - ApiKeyAuth: [] summary: 更新数据 tags: - - 用户管理 + - UserAPI /api/v1/users/{id}/disable: patch: parameters: @@ -1286,7 +1282,7 @@ paths: - ApiKeyAuth: [] summary: 禁用数据 tags: - - 用户管理 + - UserAPI /api/v1/users/{id}/enable: patch: parameters: @@ -1312,7 +1308,7 @@ paths: - ApiKeyAuth: [] summary: 启用数据 tags: - - 用户管理 + - UserAPI schemes: - http - https