From 1490ed7541102965ccba8ae9fd3ebc4c81ca264c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=96?= Date: Wed, 2 Apr 2025 10:10:00 +0800 Subject: [PATCH] =?UTF-8?q?dev:=E4=BF=AE=E5=A4=8D=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=89=8D=E7=BC=80=20(#8292)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/host_tool.go | 16 ++++++++-------- backend/app/api/v1/ssh.go | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/backend/app/api/v1/host_tool.go b/backend/app/api/v1/host_tool.go index c71e8950d..4279eef9b 100644 --- a/backend/app/api/v1/host_tool.go +++ b/backend/app/api/v1/host_tool.go @@ -14,7 +14,7 @@ import ( // @Success 200 {object} response.HostToolRes // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/tool [post] +// @Router /hosts/tool [post] func (b *BaseApi) GetToolStatus(c *gin.Context) { var req request.HostToolReq if err := helper.CheckBindAndValidate(&req, c); err != nil { @@ -36,7 +36,7 @@ func (b *BaseApi) GetToolStatus(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/tool/create [post] +// @Router /hosts/tool/create [post] // @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"创建 [type] 配置","formatEN":"create [type] config"} func (b *BaseApi) InitToolConfig(c *gin.Context) { var req request.HostToolCreate @@ -58,7 +58,7 @@ func (b *BaseApi) InitToolConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/tool/operate [post] +// @Router /hosts/tool/operate [post] // @x-panel-log {"bodyKeys":["operate","type"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] [type] ","formatEN":"[operate] [type]"} func (b *BaseApi) OperateTool(c *gin.Context) { var req request.HostToolReq @@ -80,7 +80,7 @@ func (b *BaseApi) OperateTool(c *gin.Context) { // @Success 200 {object} response.HostToolConfig // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/tool/config [post] +// @Router /hosts/tool/config [post] // @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 主机工具配置文件 ","formatEN":"[operate] tool config"} func (b *BaseApi) OperateToolConfig(c *gin.Context) { var req request.HostToolConfig @@ -103,7 +103,7 @@ func (b *BaseApi) OperateToolConfig(c *gin.Context) { // @Success 200 {string} logContent // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/tool/log [post] +// @Router /hosts/tool/log [post] func (b *BaseApi) GetToolLog(c *gin.Context) { var req request.HostToolLogReq if err := helper.CheckBindAndValidate(&req, c); err != nil { @@ -125,7 +125,7 @@ func (b *BaseApi) GetToolLog(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/tool/supervisor/process [post] +// @Router /hosts/tool/supervisor/process [post] // @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] 守护进程 ","formatEN":"[operate] process"} func (b *BaseApi) OperateProcess(c *gin.Context) { var req request.SupervisorProcessConfig @@ -147,7 +147,7 @@ func (b *BaseApi) OperateProcess(c *gin.Context) { // @Success 200 {object} response.SupervisorProcessConfig // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/tool/supervisor/process [get] +// @Router /hosts/tool/supervisor/process [get] func (b *BaseApi) GetProcess(c *gin.Context) { configs, err := hostToolService.GetSupervisorProcessConfig() if err != nil { @@ -164,7 +164,7 @@ func (b *BaseApi) GetProcess(c *gin.Context) { // @Success 200 {string} content // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/tool/supervisor/process/file [post] +// @Router /hosts/tool/supervisor/process/file [post] // @x-panel-log {"bodyKeys":["operate"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operate] Supervisor 进程文件 ","formatEN":"[operate] Supervisor Process Config file"} func (b *BaseApi) GetProcessFile(c *gin.Context) { var req request.SupervisorProcessFileReq diff --git a/backend/app/api/v1/ssh.go b/backend/app/api/v1/ssh.go index 690eed82f..742cf895f 100644 --- a/backend/app/api/v1/ssh.go +++ b/backend/app/api/v1/ssh.go @@ -12,7 +12,7 @@ import ( // @Success 200 {object} dto.SSHInfo // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/ssh/search [post] +// @Router /hosts/ssh/search [post] func (b *BaseApi) GetSSHInfo(c *gin.Context) { info, err := sshService.GetSSHInfo() if err != nil { @@ -29,7 +29,7 @@ func (b *BaseApi) GetSSHInfo(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/ssh/operate [post] +// @Router /hosts/ssh/operate [post] // @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] SSH ","formatEN":"[operation] SSH"} func (b *BaseApi) OperateSSH(c *gin.Context) { var req dto.Operate @@ -51,7 +51,7 @@ func (b *BaseApi) OperateSSH(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/ssh/update [post] +// @Router /hosts/ssh/update [post] // @x-panel-log {"bodyKeys":["key","value"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 SSH 配置 [key] => [value]","formatEN":"update SSH setting [key] => [value]"} func (b *BaseApi) UpdateSSH(c *gin.Context) { var req dto.SSHUpdate @@ -73,7 +73,7 @@ func (b *BaseApi) UpdateSSH(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/conffile/update [post] +// @Router /hosts/conffile/update [post] // @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"修改 SSH 配置文件","formatEN":"update SSH conf"} func (b *BaseApi) UpdateSSHByfile(c *gin.Context) { var req dto.SSHConf @@ -95,7 +95,7 @@ func (b *BaseApi) UpdateSSHByfile(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/ssh/generate [post] +// @Router /hosts/ssh/generate [post] // @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"生成 SSH 密钥 ","formatEN":"generate SSH secret"} func (b *BaseApi) GenerateSSH(c *gin.Context) { var req dto.GenerateSSH @@ -117,7 +117,7 @@ func (b *BaseApi) GenerateSSH(c *gin.Context) { // @Success 200 {string} data // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/ssh/secret [post] +// @Router /hosts/ssh/secret [post] func (b *BaseApi) LoadSSHSecret(c *gin.Context) { var req dto.GenerateLoad if err := helper.CheckBindAndValidate(&req, c); err != nil { @@ -139,7 +139,7 @@ func (b *BaseApi) LoadSSHSecret(c *gin.Context) { // @Success 200 {object} dto.SSHLog // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/ssh/log [post] +// @Router /hosts/ssh/log [post] func (b *BaseApi) LoadSSHLogs(c *gin.Context) { var req dto.SearchSSHLog if err := helper.CheckBindAndValidate(&req, c); err != nil { @@ -159,7 +159,7 @@ func (b *BaseApi) LoadSSHLogs(c *gin.Context) { // @Success 200 {string} data // @Security ApiKeyAuth // @Security Timestamp -// @Router /host/ssh/conf [get] +// @Router /hosts/ssh/conf [get] func (b *BaseApi) LoadSSHConf(c *gin.Context) { data, err := sshService.LoadSSHConf() if err != nil {