CasaOS/docs/docs.go
2021-09-26 10:35:02 +08:00

2902 lines
85 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import (
"bytes"
"encoding/json"
"strings"
"github.com/alecthomas/template"
"github.com/swaggo/swag"
)
var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"title": "{{.Title}}",
"contact": {
"name": "lauren.pan",
"url": "https://www.zimaboard.com",
"email": "lauren.pan@icewhale.org"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/app/appinfo/{id}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "应用详情",
"parameters": [
{
"type": "integer",
"description": "id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/category": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "获取远程分类列表",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/check/{port}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "检查端口是否可用",
"parameters": [
{
"type": "integer",
"description": "端口号",
"name": "port",
"in": "path",
"required": true
},
{
"type": "string",
"description": "端口类型 udp/tcp",
"name": "type",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/getport": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "获取一个可用端口",
"parameters": [
{
"type": "string",
"description": "端口类型 udp/tcp",
"name": "type",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/info/{id}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "获取容器详情",
"parameters": [
{
"type": "string",
"description": "appid",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/install/config": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "获取安装所需要的数据",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/install/{id}": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "安装app(该接口需要post json数据)",
"parameters": [
{
"type": "integer",
"description": "id",
"name": "id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "主端口",
"name": "port",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "tcp端口",
"name": "tcp",
"in": "formData"
},
{
"type": "string",
"description": "udp端口",
"name": "udp",
"in": "formData"
},
{
"type": "string",
"description": "环境变量",
"name": "env",
"in": "formData"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "获取远程列表",
"parameters": [
{
"type": "integer",
"description": "页码",
"name": "index",
"in": "query"
},
{
"type": "integer",
"description": "每页数量",
"name": "size",
"in": "query"
},
{
"type": "integer",
"description": "分类id",
"name": "category_id",
"in": "query"
},
{
"type": "string",
"description": "rank,new",
"name": "type",
"in": "query"
},
{
"type": "string",
"description": "search key",
"name": "key",
"in": "query"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/logs/{id}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "查看容器日志",
"parameters": [
{
"type": "string",
"description": "appid",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/mylist": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "我的应用列表",
"parameters": [
{
"type": "integer",
"description": "index",
"name": "index",
"in": "query"
},
{
"type": "integer",
"description": "size",
"name": "size",
"in": "query"
},
{
"type": "boolean",
"description": "是否是首页应用",
"name": "position",
"in": "query"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/rely/{id}/info": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "获取依赖数据",
"parameters": [
{
"type": "string",
"description": "rely id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/speed/{id}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "获取安装进度",
"parameters": [
{
"type": "string",
"description": "容器id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/state/{id}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "获取容器状态",
"parameters": [
{
"type": "string",
"description": "容器id",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "type=1",
"name": "type",
"in": "query"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
},
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "修改app状态",
"parameters": [
{
"type": "string",
"description": "appid",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "是否停止 strat stop restart",
"name": "state",
"in": "query"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/uninstall/{id}": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "卸载app",
"parameters": [
{
"type": "string",
"description": "容器id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/update/{id}/info": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "获取可更新数据",
"parameters": [
{
"type": "string",
"description": "appid",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/app/update/{id}/setting": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"app"
],
"summary": "更新设置",
"parameters": [
{
"type": "string",
"description": "容器id",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "cpu权重",
"name": "shares",
"in": "formData"
},
{
"type": "string",
"description": "内存大小MB",
"name": "mem",
"in": "formData"
},
{
"type": "string",
"description": "重启策略",
"name": "restart",
"in": "formData"
},
{
"type": "string",
"description": "应用名称",
"name": "label",
"in": "formData"
},
{
"type": "boolean",
"description": "是否放到首页",
"name": "position",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/ddns/delete/{id}": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ddns"
],
"summary": "删除ddns",
"parameters": [
{
"type": "integer",
"description": "ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/ddns/getlist": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ddns"
],
"summary": "获取可以设置的ddns列表",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/ddns/ip": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ddns"
],
"summary": "获取ip,仅做展示使用",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/ddns/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ddns"
],
"summary": "获取已设置的列表",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/ddns/ping/{api_host}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ddns"
],
"summary": "测试网址是否可以ping通",
"parameters": [
{
"type": "integer",
"description": "api地址",
"name": "api_host",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/ddns/set": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"ddns"
],
"summary": "添加新的ddns按给定模型返回内容",
"parameters": [
{
"type": "string",
"description": "类型",
"name": "type",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "host",
"name": "host",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/disk/addpart": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"disk"
],
"summary": "添加分区",
"parameters": [
{
"type": "string",
"description": "磁盘路径 例如/dev/sda",
"name": "path",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "需要分区容量大小(MB)",
"name": "size",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "磁盘符号",
"name": "num",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/disk/delpart": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"disk"
],
"summary": "删除分区",
"parameters": [
{
"type": "string",
"description": "磁盘路径 例如/dev/sda1",
"name": "path",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/disk/format": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"disk"
],
"summary": "磁盘详情",
"parameters": [
{
"type": "string",
"description": "磁盘路径 例如/dev/sda1",
"name": "path",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/disk/info": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"disk"
],
"summary": "磁盘详情",
"parameters": [
{
"type": "string",
"description": "要获取的磁盘详情 例如/dev/sda",
"name": "path",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/disk/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"disk"
],
"summary": "获取磁盘列表",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/disk/lists": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"disk"
],
"summary": "获取磁盘列表",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/disk/type": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"disk"
],
"summary": "获取支持的格式",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/file/dirpath": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"file"
],
"summary": "获取目录列表",
"parameters": [
{
"type": "string",
"description": "路径",
"name": "path",
"in": "query"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/file/download": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"file"
],
"summary": "下载文件",
"parameters": [
{
"type": "string",
"description": "路径",
"name": "path",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/file/mkdir": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"file"
],
"summary": "上传文件",
"parameters": [
{
"type": "string",
"description": "路径",
"name": "path",
"in": "formData"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/file/read": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"file"
],
"summary": "读取文件",
"parameters": [
{
"type": "string",
"description": "路径",
"name": "path",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/file/rename": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"file"
],
"summary": "重命名目录或文件",
"parameters": [
{
"type": "string",
"description": "旧的路径",
"name": "oldpath",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "新路径",
"name": "newpath",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/notify/read/{id}": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"notify"
],
"summary": "标记notify已读",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/notify/ws": {},
"/share/add": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"share"
],
"summary": "添加文件共享",
"parameters": [
{
"type": "string",
"description": "要分享的文件路径",
"name": "path",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "名称",
"name": "name",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "描述",
"name": "comment",
"in": "formData",
"required": true
},
{
"type": "boolean",
"description": "是否只读",
"name": "read_only",
"in": "formData"
},
{
"type": "boolean",
"description": "是否可写",
"name": "writeable",
"in": "formData"
},
{
"type": "boolean",
"description": "是否可浏览",
"name": "browseable",
"in": "formData"
},
{
"type": "string",
"description": "用户",
"name": "user",
"in": "formData"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/share/del/{id}": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"share"
],
"summary": "删除分享",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/share/info/{id}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"share"
],
"summary": "分享详情",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/share/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"share"
],
"summary": "获取列表",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/share/update/{id}": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"share"
],
"summary": "更新分享详情",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "要分享的文件路径",
"name": "path",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "名称",
"name": "name",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "描述",
"name": "comment",
"in": "formData",
"required": true
},
{
"type": "boolean",
"description": "是否只读",
"name": "read_only",
"in": "formData"
},
{
"type": "boolean",
"description": "是否可写",
"name": "writeable",
"in": "formData"
},
{
"type": "boolean",
"description": "是否可浏览",
"name": "browseable",
"in": "formData"
},
{
"type": "string",
"description": "用户",
"name": "user",
"in": "formData"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/shortcuts/add": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"shortcuts"
],
"summary": "添加shortcuts",
"parameters": [
{
"type": "string",
"description": "title",
"name": "title",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "url",
"name": "url",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/shortcuts/del/{id}": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"shortcuts"
],
"summary": "删除shortcuts",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/shortcuts/edit": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"shortcuts"
],
"summary": "编辑shortcuts",
"parameters": [
{
"type": "string",
"description": "title",
"name": "title",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "url",
"name": "url",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/shortcuts/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"shortcuts"
],
"summary": "获取短链列表",
"parameters": [
{
"type": "string",
"description": "User name",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "password",
"name": "pwd",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/sys/chackversion": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"sys"
],
"summary": "系统信息",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/task/completion/{id}": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"task"
],
"summary": "标记task已完成",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/task/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"task"
],
"summary": "获取task列表",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/user/changhead": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "修改配置文件",
"parameters": [
{
"type": "file",
"description": "用户头像",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/user/changuserinfo": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "修改用户信息",
"parameters": [
{
"type": "string",
"description": "User Name",
"name": "username",
"in": "formData"
},
{
"type": "string",
"description": "Email",
"name": "email",
"in": "formData"
},
{
"type": "string",
"description": "Description",
"name": "description",
"in": "formData"
},
{
"type": "string",
"description": "Password",
"name": "pwd",
"in": "formData"
},
{
"type": "string",
"description": "Old password",
"name": "oldpwd",
"in": "formData"
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/user/changusername": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "修改用户名",
"parameters": [
{
"type": "string",
"description": "User name",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Old user name",
"name": "oldname",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/user/changuserpwd": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "修改密码",
"parameters": [
{
"type": "string",
"description": "Password",
"name": "pwd",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "Old password",
"name": "oldpwd",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/user/info": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"mapplication/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "获取用户详情",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/user/login": {
"post": {
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "登录",
"parameters": [
{
"type": "string",
"description": "User name",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "password",
"name": "pwd",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/user/setusernamepwd": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "设置用户名和密码",
"parameters": [
{
"type": "string",
"description": "User name",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "password",
"name": "pwd",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/create": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "create new network",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/edit/{id}": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "修改网络",
"parameters": [
{
"type": "string",
"description": "network id",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "json数据",
"name": "json",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/info/{id}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "获取zerotier网络详情",
"parameters": [
{
"type": "string",
"description": "network id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/islogin": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "是否需要登录zerotier",
"responses": {
"200": {
"description": "false:需要登录true:不需要登录",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/join/{id}": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "加入网络",
"parameters": [
{
"type": "string",
"description": "network id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/joined/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "获取已加入的网络",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/leave/{id}": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "获取zerotier网络列表",
"parameters": [
{
"type": "string",
"description": "network id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/list": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "获取zerotier网络列表",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/login": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "登录zerotier获取token",
"parameters": [
{
"type": "string",
"description": "User name",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "password",
"name": "pwd",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/member/{id}": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "网络列表",
"parameters": [
{
"type": "string",
"description": "network id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/member/{id}/del/{mId}": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "删除网络中的用户",
"parameters": [
{
"type": "string",
"description": "network id",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "member_id",
"name": "mId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/member/{id}/edit/{mId}": {
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "修改网络用户信息",
"parameters": [
{
"type": "string",
"description": "network id",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "mId",
"name": "mId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "json数据",
"name": "json",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/network/{id}/del": {
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "删除网络",
"parameters": [
{
"type": "string",
"description": "network id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zerotier/register": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"zerotier"
],
"summary": "注册zerotier",
"parameters": [
{
"type": "string",
"description": "first name",
"name": "firstName",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "password",
"name": "pwd",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "email",
"name": "email",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "last name",
"name": "lastName",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zima/getcpuinfo": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zima"
],
"summary": "获取cpu信息",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zima/getdiskinfo": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zima"
],
"summary": "获取硬盘信息",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zima/getinfo": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zima"
],
"summary": "获取信息",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zima/getmeminfo": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zima"
],
"summary": "获取内存信息",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zima/getnetinfo": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zima"
],
"summary": "获取网络信息",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
},
"/zima/sysinfo": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"zima"
],
"summary": "获取信息系统信息",
"responses": {
"200": {
"description": "ok",
"schema": {
"type": "string"
}
}
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`
type swaggerInfo struct {
Version string
Host string
BasePath string
Schemes []string
Title string
Description string
}
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
Version: "1.0.0",
Host: "192.168.2.114:8089",
BasePath: "/v1",
Schemes: []string{},
Title: "Oasis API",
Description: "Oasis v1版本api",
}
type s struct{}
func (s *s) ReadDoc() string {
sInfo := SwaggerInfo
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
t, err := template.New("swagger_info").Funcs(template.FuncMap{
"marshal": func(v interface{}) string {
a, _ := json.Marshal(v)
return string(a)
},
}).Parse(doc)
if err != nil {
return doc
}
var tpl bytes.Buffer
if err := t.Execute(&tpl, sInfo); err != nil {
return doc
}
return tpl.String()
}
func init() {
swag.Register(swag.Name, &s{})
}