mirror of
https://github.com/veops/oneterm.git
synced 2025-10-06 15:57:04 +08:00
feat(backend): add quick commands and preference API
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Package docs Code generated by swaggo/swag at 2024-10-22 11:20:22.5424987 +0800 CST m=+3.225823701. DO NOT EDIT
|
||||
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
||||
package docs
|
||||
|
||||
import "github.com/swaggo/swag"
|
||||
@@ -1550,6 +1550,73 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/preference": {
|
||||
"get": {
|
||||
"description": "Get terminal preferences for the current user",
|
||||
"tags": [
|
||||
"Preference"
|
||||
],
|
||||
"summary": "Get user preferences",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/controller.HttpResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/model.UserPreference"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"description": "Update terminal preferences for the current user",
|
||||
"tags": [
|
||||
"Preference"
|
||||
],
|
||||
"summary": "Update user preferences",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "User preferences",
|
||||
"name": "preference",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.UserPreference"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/controller.HttpResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/model.UserPreference"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/public_key": {
|
||||
"get": {
|
||||
"tags": [
|
||||
@@ -1705,6 +1772,165 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/quick_command": {
|
||||
"get": {
|
||||
"description": "Get all quick commands available to the user",
|
||||
"tags": [
|
||||
"QuickCommand"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "page index",
|
||||
"name": "page_index",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "page size",
|
||||
"name": "page_size",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name or command",
|
||||
"name": "search",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "command id",
|
||||
"name": "id",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "command name",
|
||||
"name": "name",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/controller.HttpResponse"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/controller.ListData"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"list": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/model.QuickCommand"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"description": "Create a new quick command",
|
||||
"tags": [
|
||||
"QuickCommand"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Quick command data",
|
||||
"name": "quick_command",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.QuickCommand"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/controller.HttpResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/quick_command/{id}": {
|
||||
"put": {
|
||||
"description": "Update an existing quick command by ID",
|
||||
"tags": [
|
||||
"QuickCommand"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Quick command ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Updated quick command data",
|
||||
"name": "quick_command",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.QuickCommand"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/controller.HttpResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"description": "Delete a quick command by ID",
|
||||
"tags": [
|
||||
"QuickCommand"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Quick command ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/controller.HttpResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/session": {
|
||||
"get": {
|
||||
"tags": [
|
||||
@@ -2457,7 +2683,7 @@ const docTemplate = `{
|
||||
"list": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/model.StatAsset"
|
||||
"$ref": "#/definitions/model.StatRankOfUser"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2835,6 +3061,10 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"model.JSON": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"model.Map-int-model_Slice-int": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
@@ -2940,6 +3170,40 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"model.QuickCommand": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"command": {
|
||||
"description": "Actual command to execute",
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"creator_id": {
|
||||
"description": "Creator ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"description": {
|
||||
"description": "Command description",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"is_global": {
|
||||
"description": "Whether it's a global command",
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"description": "Command name",
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"model.Range": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -3208,6 +3472,70 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"model.StatRankOfUser": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"last_time": {
|
||||
"type": "string"
|
||||
},
|
||||
"uid": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"model.UserPreference": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"cursor_style": {
|
||||
"description": "Cursor style (block, bar, underline)",
|
||||
"type": "string"
|
||||
},
|
||||
"font_family": {
|
||||
"description": "Font family",
|
||||
"type": "string"
|
||||
},
|
||||
"font_size": {
|
||||
"description": "Font size",
|
||||
"type": "integer"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"letter_spacing": {
|
||||
"description": "Letter spacing",
|
||||
"type": "number"
|
||||
},
|
||||
"line_height": {
|
||||
"description": "Line height",
|
||||
"type": "number"
|
||||
},
|
||||
"settings": {
|
||||
"description": "Additional settings in JSON format",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/model.JSON"
|
||||
}
|
||||
]
|
||||
},
|
||||
"theme": {
|
||||
"description": "Theme name",
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_id": {
|
||||
"description": "User ID with unique index",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"model.VncConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
Reference in New Issue
Block a user