docs: 交叉检查修复文档疏漏与不一致

- 修复 api.md 修改密码接口混入注册场景的 409 错误
- 补充 api.md WebSocket 示例缺失的 quality_supervisor running 消息
- 补充 api.md 注册接口格式校验错误响应、缓存接口详细说明
- 补充 frontend.md Task 接口缺失的 error 字段
- 补充 frontend.md 错误处理章节(API 错误、WebSocket 断连、加载状态)
- frontend.md 风格键表改为引用 style-keys.md,消除重复
- async-tasks.md 去重/文件存储改为引用 database.md,消除重复
- backend.md ER 图改为引用 database.md,消除重复
- 补充 backend.md 目录结构中缺失的 auth/project handler 和 user model
- 补充 backend.md 缓存层设计说明
- 补充 database.md GEN2D_SERVER_PORT 环境变量和迁移文件归属说明
- 补充 multi-agent-pipeline.md 到 backend.md 和 async-tasks.md 的交叉引用
- 补充 async-tasks.md 超时控制说明
This commit is contained in:
2026-05-24 10:47:00 +08:00
parent 5a6bcaffaf
commit f4c1a10403
6 changed files with 102 additions and 37 deletions
+44 -5
View File
@@ -93,6 +93,16 @@ Token 通过登录接口获取,过期时间由 `GEN2D_JWT_EXPIRE` 控制(默
}
```
错误响应:
| 场景 | code | message |
|------|------|---------|
| 用户名格式不合法(非 3-64 字符或含特殊字符) | 400 | 用户名格式不合法 |
| 密码长度不足 | 400 | 密码长度不能少于 8 位 |
| 邮箱格式不合法 | 400 | 邮箱格式不正确 |
| 用户名已存在 | 409 | 用户名已被注册 |
| 邮箱已存在 | 409 | 邮箱已被注册 |
### POST /api/v1/auth/login
```json
@@ -160,8 +170,6 @@ Token 通过登录接口获取,过期时间由 `GEN2D_JWT_EXPIRE` 控制(默
| 场景 | code | message |
|------|------|---------|
| 原密码错误 | 400 | 原密码不正确 |
| 用户名已存在 | 409 | 用户名已被注册 |
| 邮箱已存在 | 409 | 邮箱已被注册 |
## 工程管理
@@ -477,6 +485,7 @@ interface PipelineProgress {
{"stage":"prompt_builder","status":"completed","progress":100}
{"stage":"asset_generator","status":"running","progress":0}
{"stage":"asset_generator","status":"completed","progress":100}
{"stage":"quality_supervisor","status":"running","progress":0}
{"stage":"quality_supervisor","status":"completed","progress":100}
{"stage":"format_adapter","status":"running","progress":0}
{"stage":"format_adapter","status":"completed","progress":100,"result":{"assets":[...]}}
@@ -495,9 +504,39 @@ interface PipelineProgress {
## 缓存管理
需认证。
需认证。用于管理应用层去重缓存(详见 [数据存储 — 去重策略](database.md#去重策略)),主要用于调试和运维场景。
| 状态 | 方法 | 路径 | 说明 |
|------|------|------|------|
| [ ] | DELETE | `/api/v1/cache/:key` | 清除特定缓存 |
| [ ] | POST | `/api/v1/cache/clear` | 批量清除缓存 |
| [ ] | DELETE | `/api/v1/cache/:key` | 清除特定去重缓存条目 |
| [ ] | POST | `/api/v1/cache/clear` | 批量清除所有去重缓存 |
### DELETE /api/v1/cache/:key
清除指定去重键的缓存条目。`:key` 为 `hash(prompt + assetType + params)` 生成的去重键,仅在需要手动解除去重锁定时使用。
响应:
```json
{
"code": 0,
"message": "ok",
"data": null
}
```
### POST /api/v1/cache/clear
清除所有去重缓存条目,不影响正在执行的任务。
响应:
```json
{
"code": 0,
"message": "ok",
"data": {
"cleared": 5
}
}
```