44 lines
2.2 KiB
Markdown
44 lines
2.2 KiB
Markdown
|
|
# 主题色 & 思考流 — 重复修改审查
|
|||
|
|
|
|||
|
|
## 1. 主题色 (theme_color)
|
|||
|
|
|
|||
|
|
| 位置 | 作用 | 是否重复 |
|
|||
|
|
|------|------|----------|
|
|||
|
|
| **backend/src/controllers/courseController.ts** | 管理后台创建课程后,`create` 不含 themeColor,随后 `update` 写入 `generateThemeColor(course.id)` | 同一流程内只写一次,无重复 |
|
|||
|
|
| **backend/src/services/taskService.ts** | 用户/AI 创建课程后,同样 create 再 update 写入 theme_color | 与 courseController 是**不同入口**(后台 vs 用户),不是同一逻辑改两遍 |
|
|||
|
|
|
|||
|
|
**结论:主题色没有“改重复”。** 两处对应两种创建路径,各自只设置一次。
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 2. 思考流 (thinking flow)
|
|||
|
|
|
|||
|
|
### 2.1 文案重复(同一份长文案存在两处)
|
|||
|
|
|
|||
|
|
| 位置 | 内容 |
|
|||
|
|
|------|------|
|
|||
|
|
| **backend/src/controllers/aiCourseController.ts** | `getThinkingFlow` 里返回的长文案(多段) |
|
|||
|
|
| **ios/.../AICourseModels.swift** | `AICourseConstants.defaultThinkingFlowText`(多段) |
|
|||
|
|
|
|||
|
|
两处文案内容一致。当前前端只用本地常量,不再请求接口,但**后端仍保留同一份文案**。以后若改文案需要改两处,属于重复维护。
|
|||
|
|
|
|||
|
|
### 2.2 前端未使用的代码(相对“改重复”的冗余)
|
|||
|
|
|
|||
|
|
| 位置 | 说明 |
|
|||
|
|
|------|------|
|
|||
|
|
| **AICourseService.getThinkingFlow()** | 仍调用 `/api/ai/thinking-flow` 并带 5 分钟缓存,但 **CreationHubView 已不调用**,直接用 `AICourseConstants.defaultThinkingFlowText` |
|
|||
|
|
| **CreateCourseInputView** | 已标记废弃,`thinkingFlowText` 初始为 `""`,未发现调用 `getThinkingFlow` |
|
|||
|
|
|
|||
|
|
即:思考流接口和缓存逻辑还在,但当前创建流程已不用,相当于死代码。
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 3. 总结
|
|||
|
|
|
|||
|
|
- **主题色**:没有在同一流程里重复设置;courseController 与 taskService 是不同入口,逻辑未改重复。
|
|||
|
|
- **思考流**:
|
|||
|
|
- 有**文案重复**(后端 + iOS 各一份相同长文案)。
|
|||
|
|
- 有**前端冗余**:`getThinkingFlow` 与缓存未被 CreationHubView 使用。
|
|||
|
|
|
|||
|
|
若需要,我可以**只在前端**做收敛(例如删除或标注不再使用 getThinkingFlow 的调用、在注释中说明文案以后只维护 AICourseConstants 一处),**不改后端**。
|