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"