feat: v1.4.0 - 典型方案采纳、推荐方案列表、审计字段、导航优化

- 添加典型方案采纳功能 (POST /api/plans/<id>/adopt)
- 添加推荐方案列表 (GET /api/students/<id>/recommended-plans)
- PracticePlan 新增 created_by/updated_by/updated_at 审计字段
- 方案编辑/详情页导航优化 (bfcache 处理、pageshow 事件)
- 方案列表支持删除功能
- 学员列表'暂无方案/问题'样式统一
- 更新文档:问题文件已废弃(迁移到数据库)
- 更新部署脚本和验证清单
This commit is contained in:
hmo
2026-04-27 02:01:22 +08:00
parent 6abdd49c04
commit e50a9207b4
20 changed files with 873 additions and 88 deletions
+82 -3
View File
@@ -2,7 +2,7 @@
## 基础信息
- **Base URL**: `http://127.0.0.1:5000`
- **Base URL**: `http://127.0.0.1:5001`
- **Content-Type**: `application/json`
---
@@ -547,8 +547,11 @@ GET /api/plans/<plan_id>
"id": 1,
"student_id": 1,
"student_name": "张三",
"template_name": "默认模板",
"is_typical": false,
"created_at": "2026-04-17 10:30",
"updated_at": "2026-04-27 15:00",
"updated_by_name": "管理员",
"content": {
"student_name": "张三",
"practice_time": "30分钟",
@@ -561,6 +564,8 @@ GET /api/plans/<plan_id>
}
```
> **注意**: `updated_at` 和 `updated_by_name` 仅在方案被编辑过后才会有值。
---
### 获取学员方案列表
@@ -571,6 +576,82 @@ GET /api/students/<student_id>/plans
---
### 获取推荐方案列表
```
GET /api/students/<student_id>/recommended-plans
```
**参数**:
| 参数 | 类型 | 说明 |
|------|------|------|
| filter | string | 筛选条件:`all`(全部)或 `mine`(我的) |
**响应示例**:
```json
[
{
"id": 5,
"student_name": "李四",
"template_name": "默认模板",
"is_typical": true,
"created_at": "2026-04-20 10:00",
"problem_names": ["手小", "识谱慢"],
"can_adopt": true,
"adopted": false
}
]
```
---
### 采纳典型方案
```
POST /api/plans/<plan_id>/adopt
```
**请求体**:
```json
{
"student_id": 1
}
```
**响应**:
```json
{
"message": "方案已采纳",
"plan_id": 6
}
```
---
### 更新方案内容
```
PUT /api/plans/<plan_id>/content
```
**功能**: 编辑方案后保存内容
**请求体**:
```json
{
"content": "{\"ai_report\": \"...\", \"daily_schedule\": [...]}"
}
```
**响应**:
```json
{
"message": "保存成功"
}
```
---
### 设为典型方案
```
@@ -592,8 +673,6 @@ POST /api/plans/<plan_id>/typical
```
DELETE /api/plans/<plan_id>
```
}
```
### 导出PDF