// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": { "name": "耗子科技", "email": "i@haozi.net" }, "license": { "name": "GNU Affero General Public License v3" }, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/panel/cert/algorithms": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板证书管理支持的算法列表", "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取算法列表", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/caProviders": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板证书管理支持的 CA 提供商", "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取 CA 提供商", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/certs": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板证书管理的证书列表", "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取证书列表", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/commonrequests.Paginate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "post": { "security": [ { "BearerToken": [] } ], "description": "添加证书到面板证书管理", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "添加证书", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.CertStore" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/certs/{id}": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板证书管理的证书", "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取证书", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/controllers.SuccessResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/models.Cert" } } } ] } } } }, "put": { "security": [ { "BearerToken": [] } ], "description": "更新面板证书管理的证书", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "更新证书", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true }, { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.CertUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "delete": { "security": [ { "BearerToken": [] } ], "description": "删除面板证书管理的证书", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "删除证书", "parameters": [ { "type": "integer", "description": "证书 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/dns": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板证书管理的 DNS 接口列表", "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取 DNS 接口列表", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/commonrequests.Paginate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "post": { "security": [ { "BearerToken": [] } ], "description": "添加 DNS 接口到面板证书管理", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "添加 DNS 接口", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.DNSStore" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/dns/{id}": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板证书管理的 DNS 接口", "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取 DNS 接口", "parameters": [ { "type": "integer", "description": "DNS 接口 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/controllers.SuccessResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/models.CertDNS" } } } ] } } } }, "put": { "security": [ { "BearerToken": [] } ], "description": "更新面板证书管理的 DNS 接口", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "更新 DNS 接口", "parameters": [ { "type": "integer", "description": "DNS 接口 ID", "name": "id", "in": "path", "required": true }, { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.DNSUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "delete": { "security": [ { "BearerToken": [] } ], "description": "删除面板证书管理的 DNS 接口", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "删除 DNS 接口", "parameters": [ { "type": "integer", "description": "DNS 接口 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/dnsProviders": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板证书管理支持的 DNS 提供商", "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取 DNS 提供商", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/manualDNS": { "post": { "security": [ { "BearerToken": [] } ], "description": "获取签发证书所需的 DNS 记录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取手动 DNS 记录", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Obtain" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/controllers.SuccessResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "$ref": "#/definitions/acme.Resolve" } } } } ] } } } } }, "/panel/cert/obtain": { "post": { "security": [ { "BearerToken": [] } ], "description": "签发面板证书管理的证书", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "签发证书", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Obtain" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/renew": { "post": { "security": [ { "BearerToken": [] } ], "description": "续签面板证书管理的证书", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "续签证书", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Renew" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/users": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板证书管理的 ACME 用户列表", "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取用户列表", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/commonrequests.Paginate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "post": { "security": [ { "BearerToken": [] } ], "description": "添加 ACME 用户到面板证书管理", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "添加 ACME 用户", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.UserStore" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/cert/users/{id}": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板证书管理的 ACME 用户", "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "获取 ACME 用户", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/controllers.SuccessResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/models.CertUser" } } } ] } } } }, "put": { "security": [ { "BearerToken": [] } ], "description": "更新面板证书管理的 ACME 用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "更新 ACME 用户", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true }, { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.UserUpdate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "delete": { "security": [ { "BearerToken": [] } ], "description": "删除面板证书管理的 ACME 用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "证书管理" ], "summary": "删除 ACME 用户", "parameters": [ { "type": "integer", "description": "用户 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/archive": { "post": { "security": [ { "BearerToken": [] } ], "description": "压缩文件/目录到给定路径", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "压缩文件/目录", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Archive" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/content": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取给定路径的文件内容", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "获取文件内容", "parameters": [ { "type": "string", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/copy": { "post": { "security": [ { "BearerToken": [] } ], "description": "复制文件/目录到给定路径", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "复制文件/目录", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Copy" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/create": { "post": { "security": [ { "BearerToken": [] } ], "description": "创建文件/目录到给定路径", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "创建文件/目录", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.NotExist" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/delete": { "post": { "security": [ { "BearerToken": [] } ], "description": "删除给定路径的文件/目录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "删除文件/目录", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Exist" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/download": { "get": { "security": [ { "BearerToken": [] } ], "description": "下载给定路径的文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "下载文件", "parameters": [ { "type": "string", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/info": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取给定路径的文件/目录信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "获取文件/目录信息", "parameters": [ { "type": "string", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/list": { "get": { "description": "获取给定路径的文件/目录列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "获取文件/目录列表", "parameters": [ { "type": "string", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/move": { "post": { "security": [ { "BearerToken": [] } ], "description": "移动文件/目录到给定路径,等效于重命名", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "移动文件/目录", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Move" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/permission": { "post": { "security": [ { "BearerToken": [] } ], "description": "修改给定路径的文件/目录权限", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "修改文件/目录权限", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Permission" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/remoteDownload": { "post": { "security": [ { "BearerToken": [] } ], "description": "下载远程文件到给定路径", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "下载远程文件", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.NotExist" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/save": { "post": { "security": [ { "BearerToken": [] } ], "description": "保存给定路径的文件内容", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "保存文件内容", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Exist" } }, { "description": "content", "name": "content", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/search": { "post": { "description": "通过关键词搜索给定路径的文件/目录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "搜索文件/目录", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Search" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/unArchive": { "post": { "security": [ { "BearerToken": [] } ], "description": "解压文件/目录到给定路径", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "解压文件/目录", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.UnArchive" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/file/upload": { "post": { "security": [ { "BearerToken": [] } ], "description": "上传文件到给定路径", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "文件管理" ], "summary": "上传文件", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.NotExist" } }, { "type": "file", "description": "file", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/setting/list": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取面板设置列表", "produces": [ "application/json" ], "tags": [ "面板设置" ], "summary": "设置列表", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/setting/update": { "post": { "security": [ { "BearerToken": [] } ], "description": "更新面板设置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "面板设置" ], "summary": "更新设置", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/panel_app_http_requests_setting.Update" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/user/info": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取当前登录用户信息", "produces": [ "application/json" ], "tags": [ "用户鉴权" ], "summary": "用户信息", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/user/login": { "post": { "description": "通过用户名和密码获取访问令牌", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户鉴权" ], "summary": "登录", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Login" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } }, "403": { "description": "用户名或密码错误", "schema": { "$ref": "#/definitions/controllers.ErrorResponse" } }, "500": { "description": "系统内部错误", "schema": { "$ref": "#/definitions/controllers.ErrorResponse" } } } } }, "/panel/website/backupList": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取网站的备份列表", "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "获取备份列表", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/commonrequests.Paginate" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/controllers.SuccessResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/internal.BackupFile" } } } } ] } } } } }, "/panel/website/defaultConfig": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取默认首页和停止页配置", "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "获取默认配置", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/controllers.SuccessResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "string" } } } } ] } } } }, "post": { "security": [ { "BearerToken": [] } ], "description": "保存默认首页和停止页配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "保存默认配置", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "type": "object", "additionalProperties": { "type": "string" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/website/deleteBackup": { "delete": { "security": [ { "BearerToken": [] } ], "description": "删除网站的备份", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "删除备份", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.DeleteBackup" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/website/uploadBackup": { "put": { "security": [ { "BearerToken": [] } ], "description": "上传网站的备份", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "上传备份", "parameters": [ { "type": "file", "description": "备份文件", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/websites": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取网站管理的网站列表", "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "获取网站列表", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/commonrequests.Paginate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "post": { "security": [ { "BearerToken": [] } ], "description": "添加网站到网站管理", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "添加网站", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Add" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/websites/{id}": { "delete": { "security": [ { "BearerToken": [] } ], "description": "删除网站管理的网站", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "删除网站", "parameters": [ { "type": "integer", "description": "网站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/websites/{id}/config": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取网站的配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "获取配置", "parameters": [ { "type": "integer", "description": "网站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/controllers.SuccessResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/internal.PanelWebsite" } } } ] } } } }, "post": { "security": [ { "BearerToken": [] } ], "description": "保存网站的配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "保存配置", "parameters": [ { "type": "integer", "description": "网站 ID", "name": "id", "in": "path", "required": true }, { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.SaveConfig" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/websites/{id}/createBackup": { "post": { "security": [ { "BearerToken": [] } ], "description": "创建网站的备份", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "创建备份", "parameters": [ { "type": "integer", "description": "网站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/websites/{id}/log": { "delete": { "security": [ { "BearerToken": [] } ], "description": "清空网站的日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "清空日志", "parameters": [ { "type": "integer", "description": "网站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/websites/{id}/resetConfig": { "post": { "security": [ { "BearerToken": [] } ], "description": "重置网站的配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "重置配置", "parameters": [ { "type": "integer", "description": "网站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/websites/{id}/restoreBackup": { "post": { "security": [ { "BearerToken": [] } ], "description": "还原网站的备份", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "还原备份", "parameters": [ { "type": "integer", "description": "网站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/websites/{id}/status": { "post": { "security": [ { "BearerToken": [] } ], "description": "启用或停用网站", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "状态", "parameters": [ { "type": "integer", "description": "网站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/panel/websites/{id}/updateRemark": { "post": { "security": [ { "BearerToken": [] } ], "description": "更新网站的备注", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "网站管理" ], "summary": "更新备注", "parameters": [ { "type": "integer", "description": "网站 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/plugins/rsync/config": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取 Rsync 配置", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "获取配置", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "post": { "security": [ { "BearerToken": [] } ], "description": "更新 Rsync 配置", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "更新配置", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.UpdateConfig" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/plugins/rsync/modules": { "get": { "security": [ { "BearerToken": [] } ], "description": "列出所有 Rsync 模块", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "列出模块", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/commonrequests.Paginate" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "post": { "security": [ { "BearerToken": [] } ], "description": "添加 Rsync 模块", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "添加模块", "parameters": [ { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/requests.Create" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/plugins/rsync/modules/{name}": { "post": { "security": [ { "BearerToken": [] } ], "description": "更新 Rsync 模块", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "更新模块", "parameters": [ { "type": "string", "description": "模块名称", "name": "name", "in": "path", "required": true }, { "description": "request", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/panel_app_http_requests_plugins_rsync.Update" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } }, "delete": { "security": [ { "BearerToken": [] } ], "description": "删除 Rsync 模块", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "删除模块", "parameters": [ { "type": "string", "description": "模块名称", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/plugins/rsync/restart": { "post": { "security": [ { "BearerToken": [] } ], "description": "重启 Rsync 服务", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "重启服务", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/plugins/rsync/start": { "post": { "security": [ { "BearerToken": [] } ], "description": "启动 Rsync 服务", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "启动服务", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/plugins/rsync/status": { "get": { "security": [ { "BearerToken": [] } ], "description": "获取 Rsync 服务状态", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "服务状态", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/plugins/rsync/stop": { "post": { "security": [ { "BearerToken": [] } ], "description": "停止 Rsync 服务", "produces": [ "application/json" ], "tags": [ "插件-Rsync" ], "summary": "停止服务", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controllers.SuccessResponse" } } } } }, "/swagger": { "get": { "description": "Swagger UI", "tags": [ "Swagger" ], "summary": "Swagger UI", "responses": { "200": { "description": "OK" }, "500": { "description": "Internal Server Error" } } } } }, "definitions": { "acme.DNSParam": { "type": "object", "properties": { "access_key": { "type": "string" }, "api_key": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "secret_key": { "type": "string" }, "token": { "type": "string" } } }, "acme.Resolve": { "type": "object", "properties": { "err": { "type": "string" }, "key": { "type": "string" }, "value": { "type": "string" } } }, "commonrequests.Paginate": { "type": "object", "properties": { "limit": { "type": "integer" }, "page": { "type": "integer" } } }, "controllers.ErrorResponse": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" } } }, "controllers.SuccessResponse": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "message": { "type": "string" } } }, "internal.BackupFile": { "type": "object", "properties": { "name": { "type": "string" }, "size": { "type": "string" } } }, "internal.PanelWebsite": { "type": "object", "properties": { "db": { "type": "boolean" }, "db_name": { "type": "string" }, "db_password": { "type": "string" }, "db_type": { "type": "string" }, "db_user": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "path": { "type": "string" }, "php": { "type": "integer" }, "ports": { "type": "array", "items": { "type": "integer" } }, "remark": { "type": "string" }, "ssl": { "type": "boolean" }, "status": { "type": "boolean" } } }, "models.Cert": { "type": "object", "properties": { "auto_renew": { "description": "自动续签", "type": "boolean" }, "cert": { "description": "证书内容", "type": "string" }, "cert_url": { "description": "证书 URL (续签时使用)", "type": "string" }, "created_at": { "type": "string" }, "dns": { "$ref": "#/definitions/models.CertDNS" }, "dns_id": { "description": "关联的 DNS ID", "type": "integer" }, "domains": { "type": "array", "items": { "type": "string" } }, "id": { "type": "integer" }, "key": { "description": "私钥内容", "type": "string" }, "type": { "description": "证书类型 (P256, P384, 2048, 4096)", "type": "string" }, "updated_at": { "type": "string" }, "user": { "$ref": "#/definitions/models.CertUser" }, "user_id": { "description": "关联的 ACME 用户 ID", "type": "integer" }, "website": { "$ref": "#/definitions/models.Website" }, "website_id": { "description": "关联的网站 ID", "type": "integer" } } }, "models.CertDNS": { "type": "object", "properties": { "created_at": { "type": "string" }, "dns_param": { "$ref": "#/definitions/acme.DNSParam" }, "id": { "type": "integer" }, "name": { "description": "备注名称", "type": "string" }, "type": { "description": "DNS 提供商 (dnspod, aliyun, cloudflare)", "type": "string" }, "updated_at": { "type": "string" } } }, "models.CertUser": { "type": "object", "properties": { "ca": { "description": "CA 提供商 (letsencrypt, zerossl, sslcom, google, buypass)", "type": "string" }, "created_at": { "type": "string" }, "email": { "type": "string" }, "hmac_encoded": { "type": "string" }, "id": { "type": "integer" }, "key_type": { "type": "string" }, "kid": { "type": "string" }, "private_key": { "type": "string" }, "updated_at": { "type": "string" } } }, "models.Website": { "type": "object", "properties": { "cert": { "$ref": "#/definitions/models.Cert" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "path": { "type": "string" }, "php": { "type": "integer" }, "remark": { "type": "string" }, "ssl": { "type": "boolean" }, "status": { "type": "boolean" }, "updated_at": { "type": "string" } } }, "panel_app_http_requests_plugins_rsync.Update": { "type": "object", "properties": { "auth_user": { "type": "string" }, "comment": { "type": "string" }, "hosts_allow": { "type": "string" }, "name": { "type": "string" }, "path": { "type": "string" }, "secret": { "type": "string" } } }, "panel_app_http_requests_setting.Update": { "type": "object", "properties": { "backup_path": { "type": "string" }, "email": { "type": "string" }, "entrance": { "type": "string" }, "name": { "type": "string" }, "password": { "type": "string" }, "port": { "type": "integer" }, "username": { "type": "string" }, "website_path": { "type": "string" } } }, "requests.Add": { "type": "object", "properties": { "db": { "type": "boolean" }, "db_name": { "type": "string" }, "db_password": { "type": "string" }, "db_type": { "type": "string" }, "db_user": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "path": { "type": "string" }, "php": { "type": "integer" }, "ports": { "type": "array", "items": { "type": "integer" } } } }, "requests.Archive": { "type": "object", "properties": { "file": { "type": "string" }, "paths": { "type": "array", "items": { "type": "string" } } } }, "requests.CertStore": { "type": "object", "properties": { "auto_renew": { "type": "boolean" }, "dns_id": { "type": "integer" }, "domains": { "type": "array", "items": { "type": "string" } }, "type": { "type": "string" }, "user_id": { "type": "integer" }, "website_id": { "type": "integer" } } }, "requests.CertUpdate": { "type": "object", "properties": { "auto_renew": { "type": "boolean" }, "dns_id": { "type": "integer" }, "domains": { "type": "array", "items": { "type": "string" } }, "id": { "type": "integer" }, "type": { "type": "string" }, "user_id": { "type": "integer" }, "website_id": { "type": "integer" } } }, "requests.Copy": { "type": "object", "properties": { "new": { "type": "string" }, "old": { "type": "string" } } }, "requests.Create": { "type": "object", "properties": { "auth_user": { "type": "string" }, "comment": { "type": "string" }, "hosts_allow": { "type": "string" }, "name": { "type": "string" }, "path": { "type": "string" }, "secret": { "type": "string" } } }, "requests.DNSStore": { "type": "object", "properties": { "data": { "$ref": "#/definitions/acme.DNSParam" }, "name": { "type": "string" }, "type": { "type": "string" } } }, "requests.DNSUpdate": { "type": "object", "properties": { "data": { "$ref": "#/definitions/acme.DNSParam" }, "id": { "type": "integer" }, "name": { "type": "string" }, "type": { "type": "string" } } }, "requests.DeleteBackup": { "type": "object", "properties": { "name": { "type": "string" } } }, "requests.Exist": { "type": "object", "properties": { "path": { "type": "string" } } }, "requests.Login": { "type": "object", "properties": { "password": { "type": "string" }, "username": { "type": "string" } } }, "requests.Move": { "type": "object", "properties": { "new": { "type": "string" }, "old": { "type": "string" } } }, "requests.NotExist": { "type": "object", "properties": { "path": { "type": "string" } } }, "requests.Obtain": { "type": "object", "properties": { "id": { "type": "integer" } } }, "requests.Permission": { "type": "object", "properties": { "group": { "type": "string" }, "mode": { "type": "integer" }, "owner": { "type": "string" }, "path": { "type": "string" } } }, "requests.Renew": { "type": "object", "properties": { "id": { "type": "integer" } } }, "requests.SaveConfig": { "type": "object", "properties": { "domains": { "type": "array", "items": { "type": "string" } }, "hsts": { "type": "boolean" }, "http_redirect": { "type": "boolean" }, "id": { "type": "integer" }, "index": { "type": "string" }, "open_basedir": { "type": "boolean" }, "path": { "type": "string" }, "php": { "type": "integer" }, "ports": { "type": "array", "items": { "type": "integer" } }, "raw": { "type": "string" }, "rewrite": { "type": "string" }, "root": { "type": "string" }, "ssl": { "type": "boolean" }, "ssl_certificate": { "type": "string" }, "ssl_certificate_key": { "type": "string" }, "waf": { "type": "boolean" }, "waf_cache": { "type": "string" }, "waf_cc_deny": { "type": "string" }, "waf_mode": { "type": "string" } } }, "requests.Search": { "type": "object", "properties": { "keyword": { "type": "string" }, "path": { "type": "string" } } }, "requests.UnArchive": { "type": "object", "properties": { "file": { "type": "string" }, "path": { "type": "string" } } }, "requests.UpdateConfig": { "type": "object", "properties": { "config": { "type": "string" } } }, "requests.UserStore": { "type": "object", "properties": { "ca": { "type": "string" }, "email": { "type": "string" }, "hmac_encoded": { "type": "string" }, "key_type": { "type": "string" }, "kid": { "type": "string" } } }, "requests.UserUpdate": { "type": "object", "properties": { "ca": { "type": "string" }, "email": { "type": "string" }, "hmac_encoded": { "type": "string" }, "id": { "type": "integer" }, "key_type": { "type": "string" }, "kid": { "type": "string" } } } }, "securityDefinitions": { "BearerToken": { "type": "apiKey", "name": "Authorization", "in": "header" } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "2", Host: "", BasePath: "/api", Schemes: []string{}, Title: "耗子 Linux 面板 API", Description: "耗子 Linux 面板的 API 信息", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }