mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 14:06:36 +08:00
3811 lines
133 KiB
Go
3811 lines
133 KiB
Go
// 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": "LINUX DO Credit",
|
||
"url": "https://linux.do"
|
||
},
|
||
"license": {
|
||
"name": "Apache 2.0",
|
||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||
},
|
||
"version": "{{.Version}}"
|
||
},
|
||
"host": "{{.Host}}",
|
||
"basePath": "{{.BasePath}}",
|
||
"paths": {
|
||
"/api/cap/challenge": {
|
||
"post": {
|
||
"description": "客户端获取 PoW 难题和签名的 JWT Token,并在后台计算。",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"cap"
|
||
],
|
||
"summary": "生成人机验证难题",
|
||
"parameters": [
|
||
{
|
||
"description": "可选范围限制参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"schema": {
|
||
"$ref": "#/definitions/cap.challengeRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功返回 PoW 难题",
|
||
"schema": {
|
||
"$ref": "#/definitions/cap.ChallengeResponse"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部服务错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/cap.RedeemResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/cap/redeem": {
|
||
"post": {
|
||
"description": "提交 PoW 解答进行核销,成功后返回一次性 X-Cap-Token 凭证",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"cap"
|
||
],
|
||
"summary": "校验人机验证解答",
|
||
"parameters": [
|
||
{
|
||
"description": "难题 Token 与解答 solutions 数组",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/cap.redeemRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "核销成功,返回 X-Cap-Token",
|
||
"schema": {
|
||
"$ref": "#/definitions/cap.RedeemResponse"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误或核销失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/cap.RedeemResponse"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部服务错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/cap.RedeemResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/auth-sources": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "返回所有已配置的 OAuth/OIDC 认证源列表,包括已启用和未启用的,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "获取认证源列表",
|
||
"responses": {
|
||
"200": {
|
||
"description": "认证源列表",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/model.AuthSource"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "创建一个新的 OAuth/OIDC 认证源配置,认证源名称必须唯一且符合命名规范,需要管理员权限",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "创建认证源",
|
||
"parameters": [
|
||
{
|
||
"description": "创建认证源参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/auth_source.AuthSourceRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "创建成功,返回认证源信息",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/model.AuthSource"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误或验证失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/auth-sources/{id}": {
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "更新指定 ID 的认证源配置。若 client_secret 字段为空,则保留原有密钥不变,需要管理员权限",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "更新认证源",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "认证源 ID 或名称",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "更新认证源参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/auth_source.AuthSourceRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "更新成功,返回更新后的认证源信息",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/model.AuthSource"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误或验证失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "删除指定认证源及其关联的所有外部帐号绑定记录,警告:删除后相关用户将无法通过该源登录,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "删除认证源",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "认证源 ID 或名称",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "删除成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "ID 无效或删除失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/auth-sources/{id}/toggle": {
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "启用或禁用指定认证源。尝试启用时将验证 Client ID 和 Client Secret 是否已配置,需要管理员权限",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "切换认证源启用状态",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "认证源 ID 或名称",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "启用状态",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/auth_source.ToggleAuthSourceRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "切换成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "验证失败或认证源不存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/status": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "获取后端服务运行状态、Goroutine、内存指标等详细统计数据,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "获取系统状态信息",
|
||
"responses": {
|
||
"200": {
|
||
"description": "获取成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/status.SystemStatusResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/system-configs": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "返回所有系统配置列表,支持按配置类型(system/business)过滤,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "获取系统配置列表",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "配置类型(system/business)",
|
||
"name": "type",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "系统配置列表",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/model.SystemConfig"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "创建一条新的系统配置项,配置键不可重复,同时将新配置同步到 Redis,需要管理员权限",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "创建系统配置",
|
||
"parameters": [
|
||
{
|
||
"description": "创建请求参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/system_config.CreateSystemConfigRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "创建成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误或配置键已存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/system-configs/smtp/test": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "使用传入的配置进行 SMTP 邮件发送测试,支持使用 ****** 占位符使用保存的数据库密码",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "测试 SMTP 邮件发送",
|
||
"parameters": [
|
||
{
|
||
"description": "测试请求参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/system_config.TestSMTPRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "测试执行完毕",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/system_config.TestSMTPResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/system-configs/{key}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "根据配置键获取对应的系统配置详情,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "获取单个系统配置",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "配置键",
|
||
"name": "key",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "系统配置详情",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/model.SystemConfig"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "配置不存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "根据配置键更新对应的配置内容,同时将更新同步到 Redis,需要管理员权限",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "更新系统配置",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "配置键",
|
||
"name": "key",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "更新请求参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/system_config.UpdateSystemConfigRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "更新成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "配置不存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "根据配置键删除对应配置,同时从 Redis 中移除对应缓存,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "删除系统配置",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "配置键",
|
||
"name": "key",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "删除成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "配置不存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/tasks/dispatch": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "手动触发指定类型的异步任务,支持指定时间范围和用户,需要管理员权限",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "下发异步任务",
|
||
"parameters": [
|
||
{
|
||
"description": "任务请求参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/task.DispatchTaskRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "任务已入队",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "任务类型不存在或参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "任务入队失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/tasks/executions": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "分页查询任务执行记录,支持按状态和任务类型筛选,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "查询任务执行记录",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "状态筛选 (pending/running/succeeded/failed)",
|
||
"name": "status",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "任务类型筛选",
|
||
"name": "task_type",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"default": 1,
|
||
"description": "页码",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"default": 20,
|
||
"description": "每页条数",
|
||
"name": "page_size",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "任务执行记录列表",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/tasks/executions/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "根据 ID 查询任务执行记录详情,包含完整执行日志,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "查询任务执行详情",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "任务执行记录 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "任务执行详情",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/model.TaskExecution"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "记录不存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/tasks/executions/{id}/retry": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "重新下发一条失败的任务,创建新的执行记录,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "重试失败任务",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "任务执行记录 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "新任务的 TaskID",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "任务不支持重试或参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "记录不存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "重试失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/tasks/types": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "返回系统支持的所有可调度任务类型列表,包括任务名称、描述、是否支持时间范围等元数据,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "获取支持的任务类型",
|
||
"responses": {
|
||
"200": {
|
||
"description": "任务类型列表",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/task.TaskMeta"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/users": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "分页返回用户列表,支持按用户 ID 和用户名筛选,需要管理员权限",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "获取用户列表",
|
||
"parameters": [
|
||
{
|
||
"minimum": 1,
|
||
"type": "integer",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"maximum": 100,
|
||
"minimum": 1,
|
||
"type": "integer",
|
||
"name": "page_size",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "user_id",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"name": "username",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "用户列表",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/user.listUsersResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "创建一个本地密码登录的新用户,需要管理员权限",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "创建用户",
|
||
"parameters": [
|
||
{
|
||
"description": "创建用户参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/user.createUserRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "创建成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/user.user"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误或用户名已存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/admin/users/{id}/status": {
|
||
"put": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "启用或禁用指定用户,管理员账号无法被禁用,需要管理员权限",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"admin"
|
||
],
|
||
"summary": "更新用户状态",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "用户 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "状态参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/user.updateUserStatusRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "更新成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无管理员权限或尝试禁用管理员",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "用户不存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/config/public": {
|
||
"get": {
|
||
"description": "返回对前端公开的系统配置信息,如允许上传的文件类型、站点名称、是否开放注册等",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"config"
|
||
],
|
||
"summary": "获取公共配置",
|
||
"responses": {
|
||
"200": {
|
||
"description": "OK",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/health": {
|
||
"get": {
|
||
"description": "检查服务是否正常运行,可用于负载均衡存活探测",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"health"
|
||
],
|
||
"summary": "健康检查",
|
||
"responses": {
|
||
"200": {
|
||
"description": "服务正常",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/oauth/callback": {
|
||
"post": {
|
||
"description": "接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立会话。支持登录(login)和账号绑定(bind)两种场景。",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"oauth"
|
||
],
|
||
"summary": "OAuth 回调处理",
|
||
"parameters": [
|
||
{
|
||
"description": "回调请求参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/oauth.CallbackRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "登录或绑定成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/oauth.OAuthCallbackResult"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "state 无效、参数错误或认证源错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "绑定场景未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "OAuth 认证失败或内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/oauth/external-accounts": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "返回当前登录用户已绑定的所有外部 OAuth 帐号信息,需要登录",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"oauth"
|
||
],
|
||
"summary": "获取外部帐号列表",
|
||
"responses": {
|
||
"200": {
|
||
"description": "外部帐号列表",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/model.ExternalAccountView"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/oauth/external-accounts/{id}/delete": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "解除当前登录用户与指定外部帐号的绑定关系,需要登录",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"oauth"
|
||
],
|
||
"summary": "解除外部帐号绑定",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "外部帐号绑定记录 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "解除绑定成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "ID 无效或解除失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/oauth/login": {
|
||
"get": {
|
||
"description": "根据指定认证源生成 OAuth 授权 URL,前端跳转到该 URL 完成 OAuth 登录授权。source 参数为空时使用第一个启用的认证源。",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"oauth"
|
||
],
|
||
"summary": "获取登录授权地址",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "认证源名称,为空使用第一个启用的认证源",
|
||
"name": "source",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "授权 URL",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/oauth.OAuthAuthorizeResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "认证源不存在或未配置",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Redis 异常或构造 URL 失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/oauth/logout": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "清除当前用户的登录会话,完成退出。清除 Cookie 中的 Session 数据。",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"oauth"
|
||
],
|
||
"summary": "退出登录",
|
||
"responses": {
|
||
"200": {
|
||
"description": "退出成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Session 清除失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/oauth/sources": {
|
||
"get": {
|
||
"description": "返回当前系统已启用的所有 OAuth 登录源,前端展示登录按钮列表时调用",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"oauth"
|
||
],
|
||
"summary": "获取可用登录源",
|
||
"responses": {
|
||
"200": {
|
||
"description": "登录源列表",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/oauth.AuthSourceView"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/oauth/user-info": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "返回当前登录用户的基本信息及余额数据,需要登录。包括用户 ID、用户名、信任等级、各类余额信息等。",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"oauth"
|
||
],
|
||
"summary": "获取当前登录用户信息",
|
||
"responses": {
|
||
"200": {
|
||
"description": "用户信息",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/oauth.BasicUserInfo"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/oauth/{source}/authorize": {
|
||
"get": {
|
||
"description": "根据指定认证源名称发起 OAuth 授权,支持 purpose 参数用于区分登录和账号绑定场景。认证源必须已启用。",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"oauth"
|
||
],
|
||
"summary": "发起指定认证源授权",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "认证源名称",
|
||
"name": "source",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "授权目的:login(登录)或 bind(绑定账号),默认 login",
|
||
"name": "purpose",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "授权 URL",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/oauth.OAuthAuthorizeResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "认证源不存在或未启用",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Redis 异常或构造 URL 失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/upload": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "支持各种类型的通用文件上传,支持自动文件类型检测、哈希计算与“秒传”去重",
|
||
"consumes": [
|
||
"multipart/form-data"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"upload"
|
||
],
|
||
"summary": "上传文件",
|
||
"parameters": [
|
||
{
|
||
"type": "file",
|
||
"description": "要上传的文件",
|
||
"name": "file",
|
||
"in": "formData",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "业务分类 (例如: avatar, attachment, doc,默认为 generic)",
|
||
"name": "type",
|
||
"in": "formData"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "额外的 JSON 格式元数据",
|
||
"name": "metadata",
|
||
"in": "formData"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "上传成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/model.Upload"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "请求参数错误或文件受限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/upload/download/batch": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "传入多个文件 ID,后台实时将其打包压缩为 ZIP 流并输出,自动处理文件名重复冲突",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/octet-stream"
|
||
],
|
||
"tags": [
|
||
"upload"
|
||
],
|
||
"summary": "批量打包下载",
|
||
"parameters": [
|
||
{
|
||
"description": "包含文件 ID 数组的请求体",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/upload.batchDownloadRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功下载打包后的 ZIP",
|
||
"schema": {
|
||
"type": "file"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "打包失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/upload/download/{id}": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "根据文件 ID 获取文件,以附件形式 (Attachment) 强制开启客户端浏览器下载",
|
||
"produces": [
|
||
"application/octet-stream"
|
||
],
|
||
"tags": [
|
||
"upload"
|
||
],
|
||
"summary": "下载单文件",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "文件 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功下载文件",
|
||
"schema": {
|
||
"type": "file"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "文件不存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "服务内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/upload/my": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "分页获取当前登录用户上传的文件,支持文件名关键词、业务类型、扩展名过滤",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"upload"
|
||
],
|
||
"summary": "获取我的文件列表",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "页码(默认 1)",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"description": "每页数量(默认 20,最大 100)",
|
||
"name": "page_size",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "文件名关键词(模糊匹配)",
|
||
"name": "keyword",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "业务分类过滤",
|
||
"name": "type",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "扩展名过滤",
|
||
"name": "extension",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "查询成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/upload.listMyFilesResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/upload/{id}": {
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "将文件状态置为 deleted(软删除),不会立即清理底层存储对象",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"upload"
|
||
],
|
||
"summary": "删除文件",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "文件 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "删除成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"403": {
|
||
"description": "无权操作",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "文件不存在",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/user/access-tokens": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "返回当前登录用户的所有 active access tokens(脱敏后)",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "获取当前用户的 AccessToken 列表",
|
||
"responses": {
|
||
"200": {
|
||
"description": "令牌列表",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/model.AccessToken"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "未登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "为当前用户新建一个 API 访问令牌,仅在此接口返回一次明文令牌值,请妥善保存。",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "创建一个新的 AccessToken",
|
||
"parameters": [
|
||
{
|
||
"description": "令牌名称",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/user.createTokenRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "新建令牌成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/user.tokenResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误或超限",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/user/access-tokens/{id}": {
|
||
"delete": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "撤销并删除一个属于当前用户的 API 访问令牌",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "删除一个 AccessToken",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "令牌ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "删除成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/user/access-tokens/{id}/rotate": {
|
||
"post": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "轮换(重新生成)一个属于当前用户的 API 访问令牌的密钥,旧令牌将立即失效",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "轮换一个 AccessToken",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "令牌ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "令牌轮换成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/user.tokenResponse"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/user/change-password": {
|
||
"post": {
|
||
"description": "修改当前登录用户的密码。修改成功后,如果是首次明文登录的升级提示,则清除修改密码的提示状态。",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "修改用户密码",
|
||
"parameters": [
|
||
{
|
||
"description": "修改密码请求参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/user.changePasswordRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "修改密码成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "原密码错误或新密码不符合要求",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "请先登录",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/user/login": {
|
||
"post": {
|
||
"description": "使用用户名和密码登录,登录成功后建立 Session。若管理员已关闭密码登录功能则返回错误。",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "用户密码登录",
|
||
"parameters": [
|
||
{
|
||
"description": "登录请求参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/user.loginRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "登录成功,返回用户信息",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/oauth.BasicUserInfo"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "用户名或密码错误、帐号已禁用等",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "服务内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/user/logout": {
|
||
"get": {
|
||
"security": [
|
||
{
|
||
"SessionCookie": []
|
||
}
|
||
],
|
||
"description": "清除用户登录 Session,完成退出",
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "用户退出登录",
|
||
"responses": {
|
||
"200": {
|
||
"description": "退出成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Session 清除失败",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/user/register": {
|
||
"post": {
|
||
"description": "使用用户名和密码注册新账号,注册成功后自动登录并建立 Session。密码长度不能少于 8 位。",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "用户注册",
|
||
"parameters": [
|
||
{
|
||
"description": "注册请求参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/user.registerRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "注册并登录成功,返回用户信息",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"$ref": "#/definitions/oauth.BasicUserInfo"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误、用户名已存在或注册已关闭",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "服务内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v1/user/send-email-code": {
|
||
"post": {
|
||
"description": "向指定邮箱发送验证码(用于注册场景)",
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"user"
|
||
],
|
||
"summary": "发送邮箱验证码",
|
||
"parameters": [
|
||
{
|
||
"description": "发送验证码请求参数",
|
||
"name": "request",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/user.sendEmailCodeRequest"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "发送成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "参数错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/f/{id}": {
|
||
"get": {
|
||
"description": "根据文件 ID 获取并提供已上传的临时或正式文件,若配置了缓存则优先走本地缓存,否则从 S3 等后端存储读取并流式返回",
|
||
"produces": [
|
||
"application/octet-stream"
|
||
],
|
||
"tags": [
|
||
"upload"
|
||
],
|
||
"summary": "获取已上传文件",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "文件 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功获取文件内容",
|
||
"schema": {
|
||
"type": "file"
|
||
}
|
||
},
|
||
"400": {
|
||
"description": "文件 ID 格式错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"404": {
|
||
"description": "文件未找到",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "服务内部错误",
|
||
"schema": {
|
||
"$ref": "#/definitions/util.ResponseAny"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"definitions": {
|
||
"auth_source.AuthSourceRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"client_id": {
|
||
"type": "string"
|
||
},
|
||
"client_secret": {
|
||
"type": "string"
|
||
},
|
||
"display_name": {
|
||
"type": "string"
|
||
},
|
||
"icon_url": {
|
||
"type": "string"
|
||
},
|
||
"is_active": {
|
||
"type": "boolean"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"openid_discovery_url": {
|
||
"type": "string"
|
||
},
|
||
"scopes": {
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"auth_source.ToggleAuthSourceRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"is_active": {
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
},
|
||
"cap.ChallengeResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"challenge": {
|
||
"type": "object",
|
||
"properties": {
|
||
"c": {
|
||
"type": "integer"
|
||
},
|
||
"d": {
|
||
"type": "integer"
|
||
},
|
||
"s": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"expires": {
|
||
"description": "ms timestamp",
|
||
"type": "integer"
|
||
},
|
||
"token": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"cap.RedeemResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"error": {
|
||
"type": "string"
|
||
},
|
||
"expires": {
|
||
"type": "integer"
|
||
},
|
||
"success": {
|
||
"type": "boolean"
|
||
},
|
||
"token": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"cap.challengeRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"scope": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"cap.redeemRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"solutions",
|
||
"token"
|
||
],
|
||
"properties": {
|
||
"scope": {
|
||
"type": "string"
|
||
},
|
||
"solutions": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"token": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"model.AccessToken": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"last_used_at": {
|
||
"type": "string"
|
||
},
|
||
"masked_token": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"user_id": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"model.AuthSource": {
|
||
"type": "object",
|
||
"properties": {
|
||
"client_id": {
|
||
"type": "string"
|
||
},
|
||
"client_secret_configured": {
|
||
"type": "boolean"
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"display_name": {
|
||
"type": "string"
|
||
},
|
||
"icon_url": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"is_active": {
|
||
"type": "boolean"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"openid_discovery_url": {
|
||
"type": "string"
|
||
},
|
||
"scopes": {
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"model.ExternalAccountView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"auth_source_id": {
|
||
"type": "integer"
|
||
},
|
||
"auth_source_label": {
|
||
"type": "string"
|
||
},
|
||
"auth_source_name": {
|
||
"type": "string"
|
||
},
|
||
"auth_source_type": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"email": {
|
||
"type": "string"
|
||
},
|
||
"external_username": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"model.SystemConfig": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"description": {
|
||
"type": "string"
|
||
},
|
||
"key": {
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"model.TaskExecution": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"duration": {
|
||
"type": "integer"
|
||
},
|
||
"error_message": {
|
||
"type": "string"
|
||
},
|
||
"finished_at": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "string",
|
||
"example": "0"
|
||
},
|
||
"log": {
|
||
"type": "string"
|
||
},
|
||
"max_retry": {
|
||
"type": "integer"
|
||
},
|
||
"payload": {
|
||
"type": "string"
|
||
},
|
||
"result": {
|
||
"type": "string"
|
||
},
|
||
"retry_count": {
|
||
"type": "integer"
|
||
},
|
||
"retryable": {
|
||
"type": "boolean"
|
||
},
|
||
"started_at": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"$ref": "#/definitions/model.TaskExecutionStatus"
|
||
},
|
||
"task_id": {
|
||
"type": "string"
|
||
},
|
||
"task_name": {
|
||
"type": "string"
|
||
},
|
||
"task_type": {
|
||
"type": "string"
|
||
},
|
||
"triggered_by": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"model.TaskExecutionStatus": {
|
||
"type": "string",
|
||
"enum": [
|
||
"pending",
|
||
"running",
|
||
"succeeded",
|
||
"failed"
|
||
],
|
||
"x-enum-varnames": [
|
||
"TaskExecutionStatusPending",
|
||
"TaskExecutionStatusRunning",
|
||
"TaskExecutionStatusSucceeded",
|
||
"TaskExecutionStatusFailed"
|
||
]
|
||
},
|
||
"model.Upload": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"extension": {
|
||
"description": "文件后缀名 (不含点,如 png, pdf)",
|
||
"type": "string"
|
||
},
|
||
"file_name": {
|
||
"description": "原始文件名 (例如: image.png)",
|
||
"type": "string"
|
||
},
|
||
"file_path": {
|
||
"description": "文件相对路径 / S3 Key",
|
||
"type": "string"
|
||
},
|
||
"file_size": {
|
||
"description": "文件大小(字节)",
|
||
"type": "integer"
|
||
},
|
||
"hash": {
|
||
"description": "文件哈希 (SHA-256/MD5,可用于排重)",
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "string",
|
||
"example": "0"
|
||
},
|
||
"metadata": {
|
||
"description": "业务扩展元数据",
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/model.UploadMetadata"
|
||
}
|
||
]
|
||
},
|
||
"mime_type": {
|
||
"description": "媒体类型 (MIME, 如 image/png)",
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"description": "状态",
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/model.UploadStatus"
|
||
}
|
||
]
|
||
},
|
||
"storage_driver": {
|
||
"description": "存储引擎驱动 (如 local, s3, oss)",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"description": "业务标识类型 (如 avatar, doc, attachment)",
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"user_id": {
|
||
"type": "string",
|
||
"example": "0"
|
||
}
|
||
}
|
||
},
|
||
"model.UploadMetadata": {
|
||
"type": "object",
|
||
"properties": {
|
||
"bucket": {
|
||
"description": "存储桶名称 (适用于 S3 等)",
|
||
"type": "string"
|
||
},
|
||
"client_ip": {
|
||
"description": "上传者 IP",
|
||
"type": "string"
|
||
},
|
||
"duration": {
|
||
"description": "音视频时长 (s)",
|
||
"type": "number"
|
||
},
|
||
"extra": {
|
||
"description": "其它任意业务自定义元数据",
|
||
"type": "object",
|
||
"additionalProperties": {}
|
||
},
|
||
"height": {
|
||
"description": "图像/视频高度 (px)",
|
||
"type": "integer"
|
||
},
|
||
"original_mime": {
|
||
"description": "原始 MIME 类型",
|
||
"type": "string"
|
||
},
|
||
"user_agent": {
|
||
"description": "上传者的 UA",
|
||
"type": "string"
|
||
},
|
||
"width": {
|
||
"description": "图像/视频宽度 (px)",
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"model.UploadStatus": {
|
||
"type": "string",
|
||
"enum": [
|
||
"pending",
|
||
"used",
|
||
"deleted"
|
||
],
|
||
"x-enum-comments": {
|
||
"UploadStatusDeleted": "已删除",
|
||
"UploadStatusPending": "待使用",
|
||
"UploadStatusUsed": "已使用"
|
||
},
|
||
"x-enum-varnames": [
|
||
"UploadStatusPending",
|
||
"UploadStatusUsed",
|
||
"UploadStatusDeleted"
|
||
]
|
||
},
|
||
"oauth.AuthSourceView": {
|
||
"type": "object",
|
||
"properties": {
|
||
"client_secret_configured": {
|
||
"type": "boolean"
|
||
},
|
||
"display_name": {
|
||
"type": "string"
|
||
},
|
||
"icon_url": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"is_active": {
|
||
"type": "boolean"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"oauth.BasicUserInfo": {
|
||
"type": "object",
|
||
"properties": {
|
||
"avatar_url": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"is_admin": {
|
||
"type": "boolean"
|
||
},
|
||
"need_change_password": {
|
||
"type": "boolean"
|
||
},
|
||
"nickname": {
|
||
"type": "string"
|
||
},
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"oauth.CallbackRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"code",
|
||
"state"
|
||
],
|
||
"properties": {
|
||
"code": {
|
||
"type": "string"
|
||
},
|
||
"state": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"oauth.OAuthAuthorizeResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"authorize_url": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"oauth.OAuthCallbackResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"status": {
|
||
"type": "string"
|
||
},
|
||
"user": {
|
||
"$ref": "#/definitions/oauth.BasicUserInfo"
|
||
}
|
||
}
|
||
},
|
||
"status.SystemStatusResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"alloc": {
|
||
"type": "string"
|
||
},
|
||
"buck_hash_sys": {
|
||
"type": "string"
|
||
},
|
||
"frees": {
|
||
"type": "integer"
|
||
},
|
||
"gc_sys": {
|
||
"type": "string"
|
||
},
|
||
"heap_alloc": {
|
||
"type": "string"
|
||
},
|
||
"heap_idle": {
|
||
"type": "string"
|
||
},
|
||
"heap_inuse": {
|
||
"type": "string"
|
||
},
|
||
"heap_objects": {
|
||
"type": "integer"
|
||
},
|
||
"heap_released": {
|
||
"type": "string"
|
||
},
|
||
"heap_sys": {
|
||
"type": "string"
|
||
},
|
||
"last_gc_time": {
|
||
"type": "string"
|
||
},
|
||
"last_pause": {
|
||
"type": "string"
|
||
},
|
||
"lookups": {
|
||
"type": "integer"
|
||
},
|
||
"mallocs": {
|
||
"type": "integer"
|
||
},
|
||
"mcache_inuse": {
|
||
"type": "string"
|
||
},
|
||
"mcache_sys": {
|
||
"type": "string"
|
||
},
|
||
"mspan_inuse": {
|
||
"type": "string"
|
||
},
|
||
"mspan_sys": {
|
||
"type": "string"
|
||
},
|
||
"next_gc": {
|
||
"type": "string"
|
||
},
|
||
"num_gc": {
|
||
"type": "integer"
|
||
},
|
||
"num_goroutine": {
|
||
"type": "integer"
|
||
},
|
||
"other_sys": {
|
||
"type": "string"
|
||
},
|
||
"pause_total_ns": {
|
||
"type": "string"
|
||
},
|
||
"stack_inuse": {
|
||
"type": "string"
|
||
},
|
||
"stack_sys": {
|
||
"type": "string"
|
||
},
|
||
"sys": {
|
||
"type": "string"
|
||
},
|
||
"total_alloc": {
|
||
"type": "string"
|
||
},
|
||
"uptime": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"system_config.CreateSystemConfigRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"key",
|
||
"type",
|
||
"value"
|
||
],
|
||
"properties": {
|
||
"description": {
|
||
"type": "string",
|
||
"maxLength": 255
|
||
},
|
||
"key": {
|
||
"type": "string",
|
||
"maxLength": 64
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"enum": [
|
||
"system",
|
||
"business"
|
||
]
|
||
},
|
||
"value": {
|
||
"type": "string",
|
||
"maxLength": 255
|
||
}
|
||
}
|
||
},
|
||
"system_config.TestSMTPRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"smtp_host",
|
||
"smtp_password",
|
||
"smtp_port",
|
||
"smtp_username",
|
||
"to"
|
||
],
|
||
"properties": {
|
||
"smtp_host": {
|
||
"type": "string",
|
||
"maxLength": 255
|
||
},
|
||
"smtp_password": {
|
||
"type": "string",
|
||
"maxLength": 255
|
||
},
|
||
"smtp_port": {
|
||
"type": "integer"
|
||
},
|
||
"smtp_username": {
|
||
"type": "string",
|
||
"maxLength": 255
|
||
},
|
||
"to": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"system_config.TestSMTPResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"error": {
|
||
"type": "string"
|
||
},
|
||
"log": {
|
||
"type": "string"
|
||
},
|
||
"success": {
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
},
|
||
"system_config.UpdateSystemConfigRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"value"
|
||
],
|
||
"properties": {
|
||
"description": {
|
||
"type": "string",
|
||
"maxLength": 255
|
||
},
|
||
"value": {
|
||
"type": "string",
|
||
"maxLength": 255
|
||
}
|
||
}
|
||
},
|
||
"task.DispatchTaskRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"task_type"
|
||
],
|
||
"properties": {
|
||
"end_time": {
|
||
"type": "string"
|
||
},
|
||
"payload": {
|
||
"type": "string"
|
||
},
|
||
"start_time": {
|
||
"type": "string"
|
||
},
|
||
"task_type": {
|
||
"type": "string"
|
||
},
|
||
"user_id": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"task.TaskMeta": {
|
||
"type": "object",
|
||
"properties": {
|
||
"asynqTask": {
|
||
"type": "string"
|
||
},
|
||
"description": {
|
||
"type": "string"
|
||
},
|
||
"maxRetry": {
|
||
"type": "integer"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"params": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/task.TaskParam"
|
||
}
|
||
},
|
||
"queue": {
|
||
"type": "string"
|
||
},
|
||
"retryable": {
|
||
"description": "是否支持手动重试",
|
||
"type": "boolean"
|
||
},
|
||
"supportsTime": {
|
||
"type": "boolean"
|
||
},
|
||
"type": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"task.TaskParam": {
|
||
"type": "object",
|
||
"properties": {
|
||
"Description": {
|
||
"description": "描述",
|
||
"type": "string"
|
||
},
|
||
"Label": {
|
||
"description": "显示名称",
|
||
"type": "string"
|
||
},
|
||
"Name": {
|
||
"description": "参数键名",
|
||
"type": "string"
|
||
},
|
||
"Placeholder": {
|
||
"description": "占位符",
|
||
"type": "string"
|
||
},
|
||
"Required": {
|
||
"description": "是否必填",
|
||
"type": "boolean"
|
||
},
|
||
"Type": {
|
||
"description": "类型:string, text, number",
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"upload.batchDownloadRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"ids"
|
||
],
|
||
"properties": {
|
||
"ids": {
|
||
"type": "array",
|
||
"minItems": 1,
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"upload.listMyFilesResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/model.Upload"
|
||
}
|
||
},
|
||
"page": {
|
||
"type": "integer"
|
||
},
|
||
"page_size": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"user.changePasswordRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"new_password": {
|
||
"type": "string"
|
||
},
|
||
"old_password": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"user.createTokenRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"name": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"user.createUserRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"password",
|
||
"username"
|
||
],
|
||
"properties": {
|
||
"is_active": {
|
||
"type": "boolean"
|
||
},
|
||
"is_admin": {
|
||
"type": "boolean"
|
||
},
|
||
"nickname": {
|
||
"type": "string",
|
||
"maxLength": 64
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"maxLength": 64,
|
||
"minLength": 8
|
||
},
|
||
"username": {
|
||
"type": "string",
|
||
"maxLength": 64,
|
||
"minLength": 3
|
||
}
|
||
}
|
||
},
|
||
"user.listUsersResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"total": {
|
||
"type": "integer"
|
||
},
|
||
"users": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/user.user"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"user.loginRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "string"
|
||
},
|
||
"password": {
|
||
"type": "string"
|
||
},
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"user.registerRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "string"
|
||
},
|
||
"display_name": {
|
||
"type": "string"
|
||
},
|
||
"email": {
|
||
"type": "string"
|
||
},
|
||
"nickname": {
|
||
"type": "string"
|
||
},
|
||
"password": {
|
||
"type": "string"
|
||
},
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"user.sendEmailCodeRequest": {
|
||
"type": "object",
|
||
"required": [
|
||
"email",
|
||
"scene"
|
||
],
|
||
"properties": {
|
||
"email": {
|
||
"type": "string"
|
||
},
|
||
"scene": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"user.tokenResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"record": {
|
||
"$ref": "#/definitions/model.AccessToken"
|
||
},
|
||
"token": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"user.updateUserStatusRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"is_active": {
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
},
|
||
"user.user": {
|
||
"type": "object",
|
||
"properties": {
|
||
"avatar_url": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"is_active": {
|
||
"type": "boolean"
|
||
},
|
||
"is_admin": {
|
||
"type": "boolean"
|
||
},
|
||
"last_login_at": {
|
||
"type": "string"
|
||
},
|
||
"nickname": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"util.ResponseAny": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {},
|
||
"error_msg": {
|
||
"type": "string",
|
||
"example": ""
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"securityDefinitions": {
|
||
"SessionCookie": {
|
||
"type": "apiKey",
|
||
"name": "session",
|
||
"in": "cookie"
|
||
}
|
||
}
|
||
}`
|
||
|
||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||
var SwaggerInfo = &swag.Spec{
|
||
Version: "1.0.0",
|
||
Host: "",
|
||
BasePath: "/",
|
||
Schemes: []string{},
|
||
Title: "LINUX DO Credit",
|
||
Description: "LINUX DO Credit 平台后端 API,提供用户认证、商户 API Key 管理、系统配置等功能。",
|
||
InfoInstanceName: "swagger",
|
||
SwaggerTemplate: docTemplate,
|
||
LeftDelim: "{{",
|
||
RightDelim: "}}",
|
||
}
|
||
|
||
func init() {
|
||
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
||
}
|