feature(1.2.8): 新增 websocket 模块

- import gorilla/websocket
- 新增 实用工具箱->WebSocket 栏目
This commit is contained in:
新亮
2021-09-20 19:18:15 +08:00
parent 77e8d58298
commit 17be120c06
31 changed files with 848 additions and 19 deletions

View File

@@ -177,9 +177,9 @@ var doc = `{
},
"/api/admin/login": {
"post": {
"description": "管理员登",
"description": "管理员登",
"consumes": [
"application/json"
"multipart/form-data"
],
"produces": [
"application/json"
@@ -187,12 +187,28 @@ var doc = `{
"tags": [
"API.admin"
],
"summary": "管理员登",
"summary": "管理员登",
"parameters": [
{
"type": "string",
"description": "用户名",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "密码",
"name": "password",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin_handler.logoutResponse"
"$ref": "#/definitions/admin_handler.loginResponse"
}
},
"400": {
@@ -1102,6 +1118,42 @@ var doc = `{
}
}
}
},
"patch": {
"description": "手动执行单条任务",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.cron"
],
"summary": "手动执行单条任务",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cron_handler.detailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/cron/used": {
@@ -1907,6 +1959,44 @@ var doc = `{
}
}
}
},
"/api/tool/send_message": {
"post": {
"description": "发送消息",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "发送消息",
"parameters": [
{
"type": "string",
"description": "消息内容",
"name": "message",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool_handler.sendMessageResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
}
},
"definitions": {
@@ -2794,6 +2884,15 @@ var doc = `{
}
}
},
"tool_handler.sendMessageResponse": {
"type": "object",
"properties": {
"status": {
"description": "状态",
"type": "string"
}
}
},
"tool_handler.tableColumn": {
"type": "object",
"properties": {

View File

@@ -160,9 +160,9 @@
},
"/api/admin/login": {
"post": {
"description": "管理员登",
"description": "管理员登",
"consumes": [
"application/json"
"multipart/form-data"
],
"produces": [
"application/json"
@@ -170,12 +170,28 @@
"tags": [
"API.admin"
],
"summary": "管理员登",
"summary": "管理员登",
"parameters": [
{
"type": "string",
"description": "用户名",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "密码",
"name": "password",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin_handler.logoutResponse"
"$ref": "#/definitions/admin_handler.loginResponse"
}
},
"400": {
@@ -1085,6 +1101,42 @@
}
}
}
},
"patch": {
"description": "手动执行单条任务",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.cron"
],
"summary": "手动执行单条任务",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cron_handler.detailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/cron/used": {
@@ -1890,6 +1942,44 @@
}
}
}
},
"/api/tool/send_message": {
"post": {
"description": "发送消息",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "发送消息",
"parameters": [
{
"type": "string",
"description": "消息内容",
"name": "message",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool_handler.sendMessageResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
}
},
"definitions": {
@@ -2777,6 +2867,15 @@
}
}
},
"tool_handler.sendMessageResponse": {
"type": "object",
"properties": {
"status": {
"description": "状态",
"type": "string"
}
}
},
"tool_handler.tableColumn": {
"type": "object",
"properties": {

View File

@@ -615,6 +615,12 @@ definitions:
type: object
type: array
type: object
tool_handler.sendMessageResponse:
properties:
status:
description: 状态
type: string
type: object
tool_handler.tableColumn:
properties:
column_comment:
@@ -776,20 +782,31 @@ paths:
/api/admin/login:
post:
consumes:
- application/json
description: 管理员登
- multipart/form-data
description: 管理员登
parameters:
- description: 用户名
in: formData
name: username
required: true
type: string
- description: 密码
in: formData
name: password
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/admin_handler.logoutResponse'
$ref: '#/definitions/admin_handler.loginResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/code.Failure'
summary: 管理员登
summary: 管理员登
tags:
- API.admin
/api/admin/menu:
@@ -1368,6 +1385,30 @@ paths:
summary: 获取单条任务详情
tags:
- API.cron
patch:
consumes:
- application/json
description: 手动执行单条任务
parameters:
- description: hashId
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/cron_handler.detailResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/code.Failure'
summary: 手动执行单条任务
tags:
- API.cron
/api/cron/{id}:
post:
consumes:
@@ -1904,4 +1945,29 @@ paths:
summary: HashIds 加密
tags:
- API.tool
/api/tool/send_message:
post:
consumes:
- multipart/form-data
description: 发送消息
parameters:
- description: 消息内容
in: formData
name: message
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/tool_handler.sendMessageResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/code.Failure'
summary: 发送消息
tags:
- API.tool
swagger: "2.0"