add conn log

This commit is contained in:
ljw
2024-10-18 15:05:58 +08:00
parent 488fedf784
commit e142cc00c6
20 changed files with 1253 additions and 169 deletions

View File

@@ -121,40 +121,6 @@ const docTemplateapi = `{
}
}
},
"/ab/add": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "标签",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"地址[Personal]"
],
"summary": "标签添加",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
}
},
"/ab/peer/add/{guid}": {
"post": {
"security": [
@@ -176,8 +142,8 @@ const docTemplateapi = `{
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
@@ -217,8 +183,8 @@ const docTemplateapi = `{
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
@@ -260,8 +226,8 @@ const docTemplateapi = `{
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
@@ -302,12 +268,22 @@ const docTemplateapi = `{
"summary": "地址列表",
"parameters": [
{
"description": "string valid",
"name": "string",
"in": "body",
"schema": {
"type": "string"
}
"type": "integer",
"description": "页码",
"name": "current",
"in": "query"
},
{
"type": "integer",
"description": "每页数量",
"name": "pageSize",
"in": "query"
},
{
"type": "string",
"description": "guid",
"name": "ab",
"in": "query"
}
],
"responses": {
@@ -434,12 +410,16 @@ const docTemplateapi = `{
"summary": "共享地址簿",
"parameters": [
{
"description": "string valid",
"name": "string",
"in": "body",
"schema": {
"type": "string"
}
"type": "integer",
"description": "页码",
"name": "current",
"in": "query"
},
{
"type": "integer",
"description": "每页数量",
"name": "pageSize",
"in": "query"
}
],
"responses": {
@@ -458,6 +438,49 @@ const docTemplateapi = `{
}
}
},
"/ab/tag/add/{guid}": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "标签",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"地址[Personal]"
],
"summary": "标签添加",
"parameters": [
{
"type": "string",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
}
},
"/ab/tag/rename/{guid}": {
"put": {
"security": [
@@ -476,6 +499,15 @@ const docTemplateapi = `{
"地址[Personal]"
],
"summary": "标签重命名",
"parameters": [
{
"type": "string",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
@@ -510,6 +542,15 @@ const docTemplateapi = `{
"地址[Personal]"
],
"summary": "标签修改颜色",
"parameters": [
{
"type": "string",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
@@ -544,6 +585,15 @@ const docTemplateapi = `{
"地址[Personal]"
],
"summary": "标签删除",
"parameters": [
{
"type": "string",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
@@ -581,8 +631,8 @@ const docTemplateapi = `{
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
@@ -637,6 +687,46 @@ const docTemplateapi = `{
}
}
},
"/audit/conn": {
"post": {
"description": "审计连接",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"审计"
],
"summary": "审计连接",
"parameters": [
{
"description": "审计连接",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.AuditConnForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/heartbeat": {
"post": {
"description": "心跳",
@@ -1137,6 +1227,38 @@ const docTemplateapi = `{
}
}
},
"api.AuditConnForm": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"conn_id": {
"type": "integer"
},
"id": {
"type": "string"
},
"ip": {
"type": "string"
},
"peer": {
"type": "array",
"items": {
"type": "string"
}
},
"session_id": {
"type": "number"
},
"type": {
"type": "integer"
},
"uuid": {
"type": "string"
}
}
},
"api.DeviceInfoInLogin": {
"type": "object",
"properties": {

View File

@@ -114,40 +114,6 @@
}
}
},
"/ab/add": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "标签",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"地址[Personal]"
],
"summary": "标签添加",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
}
},
"/ab/peer/add/{guid}": {
"post": {
"security": [
@@ -169,8 +135,8 @@
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
@@ -210,8 +176,8 @@
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
@@ -253,8 +219,8 @@
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
@@ -295,12 +261,22 @@
"summary": "地址列表",
"parameters": [
{
"description": "string valid",
"name": "string",
"in": "body",
"schema": {
"type": "string"
}
"type": "integer",
"description": "页码",
"name": "current",
"in": "query"
},
{
"type": "integer",
"description": "每页数量",
"name": "pageSize",
"in": "query"
},
{
"type": "string",
"description": "guid",
"name": "ab",
"in": "query"
}
],
"responses": {
@@ -427,12 +403,16 @@
"summary": "共享地址簿",
"parameters": [
{
"description": "string valid",
"name": "string",
"in": "body",
"schema": {
"type": "string"
}
"type": "integer",
"description": "页码",
"name": "current",
"in": "query"
},
{
"type": "integer",
"description": "每页数量",
"name": "pageSize",
"in": "query"
}
],
"responses": {
@@ -451,6 +431,49 @@
}
}
},
"/ab/tag/add/{guid}": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "标签",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"地址[Personal]"
],
"summary": "标签添加",
"parameters": [
{
"type": "string",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
}
},
"/ab/tag/rename/{guid}": {
"put": {
"security": [
@@ -469,6 +492,15 @@
"地址[Personal]"
],
"summary": "标签重命名",
"parameters": [
{
"type": "string",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
@@ -503,6 +535,15 @@
"地址[Personal]"
],
"summary": "标签修改颜色",
"parameters": [
{
"type": "string",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
@@ -537,6 +578,15 @@
"地址[Personal]"
],
"summary": "标签删除",
"parameters": [
{
"type": "string",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
@@ -574,8 +624,8 @@
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "guid",
"name": "guid",
"in": "path",
"required": true
}
@@ -630,6 +680,46 @@
}
}
},
"/audit/conn": {
"post": {
"description": "审计连接",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"审计"
],
"summary": "审计连接",
"parameters": [
{
"description": "审计连接",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.AuditConnForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/heartbeat": {
"post": {
"description": "心跳",
@@ -1130,6 +1220,38 @@
}
}
},
"api.AuditConnForm": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"conn_id": {
"type": "integer"
},
"id": {
"type": "string"
},
"ip": {
"type": "string"
},
"peer": {
"type": "array",
"items": {
"type": "string"
}
},
"session_id": {
"type": "number"
},
"type": {
"type": "integer"
},
"uuid": {
"type": "string"
}
}
},
"api.DeviceInfoInLogin": {
"type": "object",
"properties": {

View File

@@ -6,6 +6,27 @@ definitions:
example: '{"tags":["tag1","tag2","tag3"],"peers":[{"id":"abc","username":"abv-l","hostname":"","platform":"Windows","alias":"","tags":["tag1","tag2"],"hash":"hash"}],"tag_colors":"{\"tag1\":4288585374,\"tag2\":4278238420,\"tag3\":4291681337}"}'
type: string
type: object
api.AuditConnForm:
properties:
action:
type: string
conn_id:
type: integer
id:
type: string
ip:
type: string
peer:
items:
type: string
type: array
session_id:
type: number
type:
type: integer
uuid:
type: string
type: object
api.DeviceInfoInLogin:
properties:
name:
@@ -208,36 +229,15 @@ paths:
summary: 地址更新
tags:
- 地址
/ab/add:
post:
consumes:
- application/json
description: 标签
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/response.ErrorResponse'
security:
- BearerAuth: []
summary: 标签添加
tags:
- 地址[Personal]
/ab/peer/add/{guid}:
delete:
consumes:
- application/json
description: 删除地址
parameters:
- description: id
- description: guid
in: path
name: id
name: guid
required: true
type: string
produces:
@@ -261,9 +261,9 @@ paths:
- application/json
description: 添加地址
parameters:
- description: id
- description: guid
in: path
name: id
name: guid
required: true
type: string
produces:
@@ -288,9 +288,9 @@ paths:
- application/json
description: 更新地址
parameters:
- description: id
- description: guid
in: path
name: id
name: guid
required: true
type: string
produces:
@@ -315,11 +315,18 @@ paths:
- application/json
description: 地址
parameters:
- description: string valid
in: body
name: string
schema:
type: string
- description: 页码
in: query
name: current
type: integer
- description: 每页数量
in: query
name: pageSize
type: integer
- description: guid
in: query
name: ab
type: string
produces:
- application/json
responses:
@@ -396,11 +403,14 @@ paths:
- application/json
description: 共享
parameters:
- description: string valid
in: body
name: string
schema:
type: string
- description: 页码
in: query
name: current
type: integer
- description: 每页数量
in: query
name: pageSize
type: integer
produces:
- application/json
responses:
@@ -422,6 +432,12 @@ paths:
consumes:
- application/json
description: 标签
parameters:
- description: guid
in: path
name: guid
required: true
type: string
produces:
- application/json
responses:
@@ -438,11 +454,44 @@ paths:
summary: 标签删除
tags:
- 地址[Personal]
/ab/tag/add/{guid}:
post:
consumes:
- application/json
description: 标签
parameters:
- description: guid
in: path
name: guid
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/response.ErrorResponse'
security:
- BearerAuth: []
summary: 标签添加
tags:
- 地址[Personal]
/ab/tag/rename/{guid}:
put:
consumes:
- application/json
description: 标签
parameters:
- description: guid
in: path
name: guid
required: true
type: string
produces:
- application/json
responses:
@@ -464,6 +513,12 @@ paths:
consumes:
- application/json
description: 标签
parameters:
- description: guid
in: path
name: guid
required: true
type: string
produces:
- application/json
responses:
@@ -486,9 +541,9 @@ paths:
- application/json
description: 标签
parameters:
- description: id
- description: guid
in: path
name: id
name: guid
required: true
type: string
produces:
@@ -528,6 +583,32 @@ paths:
summary: 用户信息
tags:
- 用户
/audit/conn:
post:
consumes:
- application/json
description: 审计连接
parameters:
- description: 审计连接
in: body
name: body
required: true
schema:
$ref: '#/definitions/api.AuditConnForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/response.Response'
summary: 审计连接
tags:
- 审计
/heartbeat:
post:
consumes: