From ebe5bc4c3a7c7d23ab31a8bd3c73c54f5e635e41 Mon Sep 17 00:00:00 2001 From: ljw <84855512@qq.com> Date: Tue, 15 Oct 2024 14:51:19 +0800 Subject: [PATCH] fix docs --- docs/admin/admin_docs.go | 120 +++++++++++++++++++++++++++++++++- docs/admin/admin_swagger.json | 120 +++++++++++++++++++++++++++++++++- docs/admin/admin_swagger.yaml | 78 +++++++++++++++++++++- docs/api/api_docs.go | 34 ++++++++-- docs/api/api_swagger.json | 34 ++++++++-- docs/api/api_swagger.yaml | 21 +++++- http/controller/admin/peer.go | 2 + 7 files changed, 394 insertions(+), 15 deletions(-) diff --git a/docs/admin/admin_docs.go b/docs/admin/admin_docs.go index 0fa498e..0313e44 100644 --- a/docs/admin/admin_docs.go +++ b/docs/admin/admin_docs.go @@ -244,6 +244,51 @@ const docTemplateadmin = `{ } } }, + "/admin/address_book/share": { + "post": { + "security": [ + { + "token": [] + } + ], + "description": "地址簿分享", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址簿" + ], + "summary": "地址簿分享", + "parameters": [ + { + "description": "地址簿信息", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.ShareByWebClientForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/admin/address_book/update": { "post": { "security": [ @@ -301,6 +346,40 @@ 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/file/oss_token": { "get": { "security": [ @@ -1371,6 +1450,18 @@ const docTemplateadmin = `{ "description": "时间", "name": "time_ago", "in": "query" + }, + { + "type": "string", + "description": "ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "主机名", + "name": "hostname", + "in": "query" } ], "responses": { @@ -1475,7 +1566,7 @@ const docTemplateadmin = `{ "tags": [ "ADMIN" ], - "summary": "服务配置", + "summary": "RUSTDESK服务配置", "responses": { "200": { "description": "OK", @@ -2456,6 +2547,33 @@ const docTemplateadmin = `{ } } }, + "admin.ShareByWebClientForm": { + "type": "object", + "required": [ + "id", + "password", + "password_type" + ], + "properties": { + "expire": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "password": { + "type": "string" + }, + "password_type": { + "description": "只能是once,fixed", + "type": "string", + "enum": [ + "once", + "fixed" + ] + } + } + }, "admin.TagForm": { "type": "object", "required": [ diff --git a/docs/admin/admin_swagger.json b/docs/admin/admin_swagger.json index 1b7cb6b..25b829a 100644 --- a/docs/admin/admin_swagger.json +++ b/docs/admin/admin_swagger.json @@ -237,6 +237,51 @@ } } }, + "/admin/address_book/share": { + "post": { + "security": [ + { + "token": [] + } + ], + "description": "地址簿分享", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "地址簿" + ], + "summary": "地址簿分享", + "parameters": [ + { + "description": "地址簿信息", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/admin.ShareByWebClientForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/admin/address_book/update": { "post": { "security": [ @@ -294,6 +339,40 @@ } } }, + "/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/file/oss_token": { "get": { "security": [ @@ -1364,6 +1443,18 @@ "description": "时间", "name": "time_ago", "in": "query" + }, + { + "type": "string", + "description": "ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "主机名", + "name": "hostname", + "in": "query" } ], "responses": { @@ -1468,7 +1559,7 @@ "tags": [ "ADMIN" ], - "summary": "服务配置", + "summary": "RUSTDESK服务配置", "responses": { "200": { "description": "OK", @@ -2449,6 +2540,33 @@ } } }, + "admin.ShareByWebClientForm": { + "type": "object", + "required": [ + "id", + "password", + "password_type" + ], + "properties": { + "expire": { + "type": "integer" + }, + "id": { + "type": "string" + }, + "password": { + "type": "string" + }, + "password_type": { + "description": "只能是once,fixed", + "type": "string", + "enum": [ + "once", + "fixed" + ] + } + } + }, "admin.TagForm": { "type": "object", "required": [ diff --git a/docs/admin/admin_swagger.yaml b/docs/admin/admin_swagger.yaml index bbd8766..7e31628 100644 --- a/docs/admin/admin_swagger.yaml +++ b/docs/admin/admin_swagger.yaml @@ -141,6 +141,25 @@ definitions: version: type: string type: object + admin.ShareByWebClientForm: + properties: + expire: + type: integer + id: + type: string + password: + type: string + password_type: + description: 只能是once,fixed + enum: + - once + - fixed + type: string + required: + - id + - password + - password_type + type: object admin.TagForm: properties: color: @@ -618,6 +637,34 @@ paths: summary: 地址簿列表 tags: - 地址簿 + /admin/address_book/share: + post: + consumes: + - application/json + description: 地址簿分享 + parameters: + - description: 地址簿信息 + in: body + name: body + required: true + schema: + $ref: '#/definitions/admin.ShareByWebClientForm' + 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/address_book/update: post: consumes: @@ -651,6 +698,27 @@ 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/file/oss_token: get: consumes: @@ -1283,6 +1351,14 @@ paths: in: query name: time_ago type: integer + - description: ID + in: query + name: id + type: string + - description: 主机名 + in: query + name: hostname + type: string produces: - application/json responses: @@ -1355,7 +1431,7 @@ paths: $ref: '#/definitions/response.Response' security: - token: [] - summary: 服务配置 + summary: RUSTDESK服务配置 tags: - ADMIN /admin/tag/create: diff --git a/docs/api/api_docs.go b/docs/api/api_docs.go index 8eeacb0..43e44af 100644 --- a/docs/api/api_docs.go +++ b/docs/api/api_docs.go @@ -945,13 +945,37 @@ const docTemplateapi = `{ } } }, + "/shared-peer": { + "post": { + "description": "分享的peer", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WEBCLIENT" + ], + "summary": "分享的peer", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/sysinfo": { "post": { - "security": [ - { - "BearerAuth": [] - } - ], "description": "提交系统信息", "consumes": [ "application/json" diff --git a/docs/api/api_swagger.json b/docs/api/api_swagger.json index e775ebd..399f009 100644 --- a/docs/api/api_swagger.json +++ b/docs/api/api_swagger.json @@ -938,13 +938,37 @@ } } }, + "/shared-peer": { + "post": { + "description": "分享的peer", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "WEBCLIENT" + ], + "summary": "分享的peer", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.Response" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/sysinfo": { "post": { - "security": [ - { - "BearerAuth": [] - } - ], "description": "提交系统信息", "consumes": [ "application/json" diff --git a/docs/api/api_swagger.yaml b/docs/api/api_swagger.yaml index 2136e96..f2efd10 100644 --- a/docs/api/api_swagger.yaml +++ b/docs/api/api_swagger.yaml @@ -727,6 +727,25 @@ paths: summary: 服务配置 tags: - WEBCLIENT + /shared-peer: + post: + consumes: + - application/json + description: 分享的peer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.Response' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.Response' + summary: 分享的peer + tags: + - WEBCLIENT /sysinfo: post: consumes: @@ -750,8 +769,6 @@ paths: description: Internal Server Error schema: $ref: '#/definitions/response.ErrorResponse' - security: - - BearerAuth: [] summary: 提交系统信息 tags: - 地址 diff --git a/http/controller/admin/peer.go b/http/controller/admin/peer.go index cfdd5a8..ba0c850 100644 --- a/http/controller/admin/peer.go +++ b/http/controller/admin/peer.go @@ -77,6 +77,8 @@ func (ct *Peer) Create(c *gin.Context) { // @Param page query int false "页码" // @Param page_size query int false "页大小" // @Param time_ago query int false "时间" +// @Param id query string false "ID" +// @Param hostname query string false "主机名" // @Success 200 {object} response.Response{data=model.PeerList} // @Failure 500 {object} response.Response // @Router /admin/peer/list [get]