mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-01 22:46:38 +08:00
48d414e197
swagger 移除 merchant swagger 改造首页内容为通用后台管理系统定位 - 修改首页标题从 'LINUX DO Credit' 改为 'Modern Platform' - 更新副标题为 '为二次开发而生' - 更新首页描述为通用平台的特点 - 更新首页特性标签为 '开箱即用、高度可扩展、工业级基建' - 修改展示卡片为技术栈和二次开发相关 - 更新开发者示例代码为通用的注册和 API Key 获取示例 - 更新页脚品牌名为 'Modern Platform' - 调整页脚导航链接为通用平台相关内容 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 去除遗留 裁剪 移除 /api/v1/user/pay-key 相关代码 - 删除后端 UpdatePayKey 处理器函数和 UpdatePayKeyRequest 结构体 - 删除 User 模型中的 PayKey 字段 - 删除 User.VerifyPayKey 方法 - 删除 EncryptPayKeyFailed 错误常量 - 删除 /api/v1/user/pay-key PUT 路由 - 删除 OAuth 返回中的 IsPayKey 字段 - 删除前端 UserService.updatePayKey 方法 - 删除前端所有支付密钥 UI 和逻辑 - 更新相关的导出和注释 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 去除遗留 api 修正 系统配置 前端裁剪 后端裁剪 init
369 lines
9.0 KiB
YAML
369 lines
9.0 KiB
YAML
definitions:
|
||
oauth.CallbackRequest:
|
||
properties:
|
||
code:
|
||
type: string
|
||
state:
|
||
type: string
|
||
type: object
|
||
system_config.CreateSystemConfigRequest:
|
||
properties:
|
||
description:
|
||
maxLength: 255
|
||
type: string
|
||
key:
|
||
maxLength: 64
|
||
type: string
|
||
type:
|
||
enum:
|
||
- system
|
||
- business
|
||
type: string
|
||
value:
|
||
maxLength: 255
|
||
type: string
|
||
required:
|
||
- key
|
||
- type
|
||
- value
|
||
type: object
|
||
system_config.UpdateSystemConfigRequest:
|
||
properties:
|
||
description:
|
||
maxLength: 255
|
||
type: string
|
||
value:
|
||
maxLength: 255
|
||
type: string
|
||
required:
|
||
- value
|
||
type: object
|
||
task.DispatchTaskRequest:
|
||
properties:
|
||
end_time:
|
||
type: string
|
||
start_time:
|
||
type: string
|
||
task_type:
|
||
type: string
|
||
user_id:
|
||
type: integer
|
||
required:
|
||
- task_type
|
||
type: object
|
||
user.updateUserStatusRequest:
|
||
properties:
|
||
is_active:
|
||
type: boolean
|
||
type: object
|
||
util.ResponseAny:
|
||
properties:
|
||
data: {}
|
||
error_msg:
|
||
example: ""
|
||
type: string
|
||
type: object
|
||
info:
|
||
contact: {}
|
||
title: LINUX DO Credit
|
||
version: 1.0.0
|
||
paths:
|
||
/api/v1/admin/system-configs:
|
||
get:
|
||
description: 返回所有系统配置列表,支持按配置类型(system/business)过滤,需要管理员权限
|
||
parameters:
|
||
- description: 配置类型(system/business)
|
||
in: query
|
||
name: type
|
||
type: string
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 获取系统配置列表
|
||
tags:
|
||
- admin
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 创建一条新的系统配置项,配置键不可重复,同时将新配置同步到 Redis,需要管理员权限
|
||
parameters:
|
||
- description: 创建请求参数
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/system_config.CreateSystemConfigRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 创建系统配置
|
||
tags:
|
||
- admin
|
||
/api/v1/admin/system-configs/{key}:
|
||
delete:
|
||
description: 根据配置键删除对应配置,同时从 Redis 中移除对应缓存,需要管理员权限
|
||
parameters:
|
||
- description: 配置键
|
||
in: path
|
||
name: key
|
||
required: true
|
||
type: string
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 删除系统配置
|
||
tags:
|
||
- admin
|
||
get:
|
||
description: 根据配置键获取对应的系统配置详情,需要管理员权限
|
||
parameters:
|
||
- description: 配置键
|
||
in: path
|
||
name: key
|
||
required: true
|
||
type: string
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 获取单个系统配置
|
||
tags:
|
||
- admin
|
||
put:
|
||
consumes:
|
||
- application/json
|
||
description: 根据配置键更新对应的配置内容,同时将更新同步到 Redis,需要管理员权限
|
||
parameters:
|
||
- description: 配置键
|
||
in: path
|
||
name: key
|
||
required: true
|
||
type: string
|
||
- description: 更新请求参数
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/system_config.UpdateSystemConfigRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 更新系统配置
|
||
tags:
|
||
- admin
|
||
/api/v1/admin/tasks/dispatch:
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 手动触发指定类型的异步任务,支持指定时间范围和用户,需要管理员权限
|
||
parameters:
|
||
- description: 任务请求参数
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/task.DispatchTaskRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 下发异步任务
|
||
tags:
|
||
- admin
|
||
/api/v1/admin/tasks/types:
|
||
get:
|
||
description: 返回系统支持的所有可调度任务类型列表,需要管理员权限
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 获取支持的任务类型
|
||
tags:
|
||
- admin
|
||
/api/v1/admin/users:
|
||
get:
|
||
description: 分页返回用户列表,支持按用户 ID 和用户名筛选,需要管理员权限
|
||
parameters:
|
||
- in: query
|
||
minimum: 1
|
||
name: page
|
||
type: integer
|
||
- in: query
|
||
maximum: 100
|
||
minimum: 1
|
||
name: page_size
|
||
type: integer
|
||
- in: query
|
||
name: user_id
|
||
type: integer
|
||
- in: query
|
||
name: username
|
||
type: string
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 获取用户列表
|
||
tags:
|
||
- admin
|
||
/api/v1/admin/users/{id}/status:
|
||
put:
|
||
consumes:
|
||
- application/json
|
||
description: 启用或禁用指定用户,管理员账号无法被禁用,需要管理员权限
|
||
parameters:
|
||
- description: 用户ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
type: integer
|
||
- description: 状态参数
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/user.updateUserStatusRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 更新用户状态
|
||
tags:
|
||
- admin
|
||
/api/v1/config/public:
|
||
get:
|
||
consumes:
|
||
- application/json
|
||
description: 返回对前端公开的系统配置信息,如允许上传的文件类型、站点名称、是否开放注册等
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 获取公共配置
|
||
tags:
|
||
- config
|
||
/api/v1/health:
|
||
get:
|
||
description: 检查服务是否正常运行
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 健康检查
|
||
tags:
|
||
- health
|
||
/api/v1/oauth/callback:
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: 接收前端传回的 state 和 code,完成 OAuth/OIDC 认证并建立用户会话
|
||
parameters:
|
||
- description: 回调请求参数
|
||
in: body
|
||
name: request
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/oauth.CallbackRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: OAuth 回调
|
||
tags:
|
||
- oauth
|
||
/api/v1/oauth/login:
|
||
get:
|
||
description: 生成 OAuth 登录 URL,前端跳转至该地址完成授权
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 获取登录地址
|
||
tags:
|
||
- oauth
|
||
/api/v1/oauth/logout:
|
||
get:
|
||
description: 清除当前用户的登录会话,完成退出
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 退出登录
|
||
tags:
|
||
- oauth
|
||
/api/v1/oauth/user-info:
|
||
get:
|
||
description: 返回当前登录用户的基本信息及余额数据,需要登录
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/util.ResponseAny'
|
||
summary: 获取当前登录用户信息
|
||
tags:
|
||
- oauth
|
||
/f/{id}:
|
||
get:
|
||
parameters:
|
||
- description: Upload ID
|
||
in: path
|
||
name: id
|
||
required: true
|
||
type: string
|
||
produces:
|
||
- application/octet-stream
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
tags:
|
||
- upload
|
||
swagger: "2.0"
|