From 59038e27f89f51d2586956cbfd369ea21e32be15 Mon Sep 17 00:00:00 2001 From: lejianwen <84855512@qq.com> Date: Mon, 20 Jan 2025 19:35:47 +0800 Subject: [PATCH] docs: Up Swagger docs --- docs/admin/admin_docs.go | 274 +++++++++++++++++++++++++--------- docs/admin/admin_swagger.json | 274 +++++++++++++++++++++++++--------- docs/admin/admin_swagger.yaml | 169 +++++++++++++++------ docs/api/api_docs.go | 105 +++++-------- docs/api/api_swagger.json | 105 +++++-------- docs/api/api_swagger.yaml | 65 +++----- 6 files changed, 625 insertions(+), 367 deletions(-) diff --git a/docs/admin/admin_docs.go b/docs/admin/admin_docs.go index 546fa39..84272cd 100644 --- a/docs/admin/admin_docs.go +++ b/docs/admin/admin_docs.go @@ -981,40 +981,6 @@ const docTemplateadmin = `{ } } }, - "/admin/app-config": { - "get": { - "security": [ - { - "token": [] - } - ], - "description": "APP服务配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ADMIN" - ], - "summary": "APP服务配置", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.Response" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/admin/audit_conn/batchDelete": { "post": { "security": [ @@ -1881,7 +1847,7 @@ const docTemplateadmin = `{ } } }, - "/admin/login_log/delete": { + "/admin/login_log/batchDelete": { "post": { "security": [ { @@ -1926,6 +1892,51 @@ const docTemplateadmin = `{ } } }, + "/admin/login_log/delete": { + "post": { + "security": [ + { + "token": [] + } + ], + "description": "登录日志删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "登录日志" + ], + "summary": "登录日志删除", + "parameters": [ + { + "description": "登录日志信息", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.LoginLog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/admin/login_log/detail/{id}": { "get": { "security": [ @@ -2757,6 +2768,162 @@ const docTemplateadmin = `{ } } }, + "/admin/my/login_log/batchDelete": { + "post": { + "security": [ + { + "token": [] + } + ], + "description": "登录日志批量删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "我的登录日志" + ], + "summary": "登录日志批量删除", + "parameters": [ + { + "description": "登录日志", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.LoginLogIds" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, + "/admin/my/login_log/delete": { + "post": { + "security": [ + { + "token": [] + } + ], + "description": "登录日志删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "我的登录日志" + ], + "summary": "登录日志删除", + "parameters": [ + { + "description": "登录日志信息", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.LoginLog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, + "/admin/my/login_log/list": { + "get": { + "security": [ + { + "token": [] + } + ], + "description": "登录日志列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "我的登录日志" + ], + "summary": "登录日志列表", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "页大小", + "name": "page_size", + "in": "query" + }, + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.LoginLogList" + } + } + } + ] + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/admin/my/peer/list": { "get": { "security": [ @@ -3884,40 +4051,6 @@ const docTemplateadmin = `{ } } }, - "/admin/server-config": { - "get": { - "security": [ - { - "token": [] - } - ], - "description": "服务配置,给webclient提供api-server", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ADMIN" - ], - "summary": "RUSTDESK服务配置", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.Response" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/admin/share_record/batchDelete": { "post": { "security": [ @@ -5768,6 +5901,9 @@ const docTemplateadmin = `{ "ip": { "type": "string" }, + "is_deleted": { + "type": "integer" + }, "platform": { "description": "windows,linux,mac,android,ios", "type": "string" diff --git a/docs/admin/admin_swagger.json b/docs/admin/admin_swagger.json index 3ee5539..86605ed 100644 --- a/docs/admin/admin_swagger.json +++ b/docs/admin/admin_swagger.json @@ -974,40 +974,6 @@ } } }, - "/admin/app-config": { - "get": { - "security": [ - { - "token": [] - } - ], - "description": "APP服务配置", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ADMIN" - ], - "summary": "APP服务配置", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.Response" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/admin/audit_conn/batchDelete": { "post": { "security": [ @@ -1874,7 +1840,7 @@ } } }, - "/admin/login_log/delete": { + "/admin/login_log/batchDelete": { "post": { "security": [ { @@ -1919,6 +1885,51 @@ } } }, + "/admin/login_log/delete": { + "post": { + "security": [ + { + "token": [] + } + ], + "description": "登录日志删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "登录日志" + ], + "summary": "登录日志删除", + "parameters": [ + { + "description": "登录日志信息", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.LoginLog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/admin/login_log/detail/{id}": { "get": { "security": [ @@ -2750,6 +2761,162 @@ } } }, + "/admin/my/login_log/batchDelete": { + "post": { + "security": [ + { + "token": [] + } + ], + "description": "登录日志批量删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "我的登录日志" + ], + "summary": "登录日志批量删除", + "parameters": [ + { + "description": "登录日志", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.LoginLogIds" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, + "/admin/my/login_log/delete": { + "post": { + "security": [ + { + "token": [] + } + ], + "description": "登录日志删除", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "我的登录日志" + ], + "summary": "登录日志删除", + "parameters": [ + { + "description": "登录日志信息", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.LoginLog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, + "/admin/my/login_log/list": { + "get": { + "security": [ + { + "token": [] + } + ], + "description": "登录日志列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "我的登录日志" + ], + "summary": "登录日志列表", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "页大小", + "name": "page_size", + "in": "query" + }, + { + "type": "integer", + "description": "用户ID", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/response.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/model.LoginLogList" + } + } + } + ] + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/admin/my/peer/list": { "get": { "security": [ @@ -3877,40 +4044,6 @@ } } }, - "/admin/server-config": { - "get": { - "security": [ - { - "token": [] - } - ], - "description": "服务配置,给webclient提供api-server", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ADMIN" - ], - "summary": "RUSTDESK服务配置", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/response.Response" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/admin/share_record/batchDelete": { "post": { "security": [ @@ -5761,6 +5894,9 @@ "ip": { "type": "string" }, + "is_deleted": { + "type": "integer" + }, "platform": { "description": "windows,linux,mac,android,ios", "type": "string" diff --git a/docs/admin/admin_swagger.yaml b/docs/admin/admin_swagger.yaml index 9834ef8..894ce2a 100644 --- a/docs/admin/admin_swagger.yaml +++ b/docs/admin/admin_swagger.yaml @@ -531,6 +531,8 @@ definitions: type: integer ip: type: string + is_deleted: + type: integer platform: description: windows,linux,mac,android,ios type: string @@ -1347,27 +1349,6 @@ paths: summary: 地址簿规则编辑 tags: - 地址簿规则 - /admin/app-config: - get: - consumes: - - application/json - description: APP服务配置 - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/response.Response' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/response.Response' - security: - - token: [] - summary: APP服务配置 - tags: - - ADMIN /admin/audit_conn/batchDelete: post: consumes: @@ -1892,7 +1873,7 @@ paths: summary: 登录选项 tags: - 登录 - /admin/login_log/delete: + /admin/login_log/batchDelete: post: consumes: - application/json @@ -1920,6 +1901,34 @@ paths: summary: 登录日志批量删除 tags: - 登录日志 + /admin/login_log/delete: + post: + consumes: + - application/json + description: 登录日志删除 + parameters: + - description: 登录日志信息 + in: body + name: body + required: true + schema: + $ref: '#/definitions/model.LoginLog' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Response' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.Response' + security: + - token: [] + summary: 登录日志删除 + tags: + - 登录日志 /admin/login_log/detail/{id}: get: consumes: @@ -2413,6 +2422,101 @@ paths: summary: 地址簿规则编辑 tags: - 我的地址簿规则 + /admin/my/login_log/batchDelete: + post: + consumes: + - application/json + description: 登录日志批量删除 + parameters: + - description: 登录日志 + in: body + name: body + required: true + schema: + $ref: '#/definitions/admin.LoginLogIds' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Response' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.Response' + security: + - token: [] + summary: 登录日志批量删除 + tags: + - 我的登录日志 + /admin/my/login_log/delete: + post: + consumes: + - application/json + description: 登录日志删除 + parameters: + - description: 登录日志信息 + in: body + name: body + required: true + schema: + $ref: '#/definitions/model.LoginLog' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Response' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.Response' + security: + - token: [] + summary: 登录日志删除 + tags: + - 我的登录日志 + /admin/my/login_log/list: + get: + consumes: + - application/json + description: 登录日志列表 + parameters: + - description: 页码 + in: query + name: page + type: integer + - description: 页大小 + in: query + name: page_size + type: integer + - description: 用户ID + in: query + name: user_id + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/response.Response' + - properties: + data: + $ref: '#/definitions/model.LoginLogList' + type: object + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.Response' + security: + - token: [] + summary: 登录日志列表 + tags: + - 我的登录日志 /admin/my/peer/list: get: consumes: @@ -3088,27 +3192,6 @@ paths: summary: 设备编辑 tags: - 设备 - /admin/server-config: - get: - consumes: - - application/json - description: 服务配置,给webclient提供api-server - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/response.Response' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/response.Response' - security: - - token: [] - summary: RUSTDESK服务配置 - tags: - - ADMIN /admin/share_record/batchDelete: post: consumes: diff --git a/docs/api/api_docs.go b/docs/api/api_docs.go index 2e980a3..2f6859d 100644 --- a/docs/api/api_docs.go +++ b/docs/api/api_docs.go @@ -653,40 +653,6 @@ const docTemplateapi = `{ } } }, - "/api": { - "get": { - "security": [ - { - "token": [] - } - ], - "description": "用户信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "用户" - ], - "summary": "用户信息", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api.UserPayload" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/audit/conn": { "post": { "description": "审计连接", @@ -767,6 +733,40 @@ const docTemplateapi = `{ } } }, + "/currentUser": { + "get": { + "security": [ + { + "token": [] + } + ], + "description": "用户信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户" + ], + "summary": "用户信息", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/api.UserPayload" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/heartbeat": { "post": { "description": "心跳", @@ -1178,43 +1178,6 @@ const docTemplateapi = `{ } } }, - "/tags": { - "post": { - "security": [ - { - "BearerAuth": [] - } - ], - "description": "标签", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "标签", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Tag" - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/response.ErrorResponse" - } - } - } - } - }, "/users": { "get": { "security": [ diff --git a/docs/api/api_swagger.json b/docs/api/api_swagger.json index 8f32707..0d81993 100644 --- a/docs/api/api_swagger.json +++ b/docs/api/api_swagger.json @@ -646,40 +646,6 @@ } } }, - "/api": { - "get": { - "security": [ - { - "token": [] - } - ], - "description": "用户信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "用户" - ], - "summary": "用户信息", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/api.UserPayload" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/audit/conn": { "post": { "description": "审计连接", @@ -760,6 +726,40 @@ } } }, + "/currentUser": { + "get": { + "security": [ + { + "token": [] + } + ], + "description": "用户信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "用户" + ], + "summary": "用户信息", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/api.UserPayload" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/heartbeat": { "post": { "description": "心跳", @@ -1171,43 +1171,6 @@ } } }, - "/tags": { - "post": { - "security": [ - { - "BearerAuth": [] - } - ], - "description": "标签", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "地址" - ], - "summary": "标签", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Tag" - } - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/response.ErrorResponse" - } - } - } - } - }, "/users": { "get": { "security": [ diff --git a/docs/api/api_swagger.yaml b/docs/api/api_swagger.yaml index e84a22f..27bcaa2 100644 --- a/docs/api/api_swagger.yaml +++ b/docs/api/api_swagger.yaml @@ -598,27 +598,6 @@ paths: summary: 标签 tags: - 地址[Personal] - /api: - get: - consumes: - - application/json - description: 用户信息 - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/api.UserPayload' - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/response.Response' - security: - - token: [] - summary: 用户信息 - tags: - - 用户 /audit/conn: post: consumes: @@ -671,6 +650,27 @@ paths: summary: 审计文件 tags: - 审计 + /currentUser: + get: + consumes: + - application/json + description: 用户信息 + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/api.UserPayload' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.Response' + security: + - token: [] + summary: 用户信息 + tags: + - 用户 /heartbeat: post: consumes: @@ -936,29 +936,6 @@ paths: summary: 提交系统信息 tags: - 地址 - /tags: - post: - consumes: - - application/json - description: 标签 - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - $ref: '#/definitions/model.Tag' - type: array - "500": - description: Internal Server Error - schema: - $ref: '#/definitions/response.ErrorResponse' - security: - - BearerAuth: [] - summary: 标签 - tags: - - 地址 /users: get: consumes: