Commit Graph

57 Commits

Author SHA1 Message Date
peanut 7de91dbbb4 feat:新增 SESSION_STAGES_ACCUMULATOR 跨流中间步骤累积器
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 14:51:19 +08:00
peanut fc0f5b88c5 fix:修复小说保存与列表刷新
- ShortNovelServiceImpl:累积 novel_delta 事件,novel_done 未携带 full_text 时用累积内容兜底
- ScriptLibraryView:onMounted 主动拉取最新剧本,解决生成后列表不刷新问题
2026-07-26 14:45:51 +08:00
peanut c0df76566d fix: 列表查询移除隐性写操作 2026-07-26 11:50:53 +08:00
peanut 06605bfd0d fix: 修复小说生成保存链路(事务+originalQuery兜底+中间步骤累积) 2026-07-26 11:49:31 +08:00
peanut 6bf726d6a0 小程序对话页面优化 2026-07-22 21:36:11 +08:00
peanut 406f9b77b4 feat: 优化 SSE 转发逻辑,使用严格行读取和显式 flush 2026-07-21 23:28:00 +08:00
peanut 3d1cc24fc4 fix: SSE 流式转发从 RestTemplate 改用 OkHttp,支持真正的逐行流式读取,解决缓冲导致的一下子全出来问题 2026-07-21 22:48:52 +08:00
peanut b24e176579 feat: 标签顺序改为全部/短篇/中篇/长篇/收藏夹;增加SSE事件诊断日志定位novel_done未触发问题 2026-07-21 21:56:22 +08:00
peanut 3813f91b8d feat: 历史列表分类改为固定5标签(全部/中篇/短篇/长篇/收藏夹),移除状态筛选,后端保存length改为short 2026-07-21 21:15:31 +08:00
peanut 4884099b9b fix: 收藏 toggle 用原生 SQL 绕过逻辑删除,彻底解决重新收藏冲突 2026-07-19 23:59:54 +08:00
peanut c0245d37fb fix: 收藏 toggle 支持重新收藏(修复逻辑删除与 unique key 冲突) 2026-07-19 23:56:41 +08:00
peanut 3666c3d530 fix: 收藏 toggle 增加实体存在性和权限校验(IDOR 修复) 2026-07-19 23:42:53 +08:00
peanut dd11cfae73 feat: 人生事件和剧本收藏从 localStorage 切换为真实 API
- 后端:新增 t_event_favorite 表(UNIQUE KEY + MyBatis-Plus Entity)
- 后端:LifeEventController 新增 /favorite/toggle、/favorite/page、/favorite/check 三个真实端点
- 后端:EventFavoriteService 完整 CRUD,含 toggle/分页/批量查询/状态检查
- 后端:删除旧的 favorite-placeholder mock 端点
- 前端:life-event/detail.vue 从 localStorage 假收藏切换为真实 API + localStorage 缓存防闪烁
- 前端:ScriptLibraryView.vue 从 localFavorites 切换为 checkFavoriteScript 真实 API
- 前端:stores/app.js 新增 toggleEventFavorite / checkEventFavorite 方法
- 修复:审核发现的 UNIQUE 约束缺失、未使用 watch 导入、Controller 参数注解遗漏、Controller 委托 Service 构造 Response

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 23:23:40 +08:00
peanut 74fa304cd9 feat(script-favorite): add 3 favorite endpoints to EpicScriptController
- POST /epicScript/favorite/toggle: toggle favorite for a script
- GET /epicScript/favorite/page: paginated favorite list
- GET /epicScript/favorite/check: check if script is favorited
- Add ScriptFavoriteToggleRequest, ScriptFavoriteResponse, ScriptFavoriteService imports
- Inject ScriptFavoriteService via @Autowired
2026-07-19 21:43:46 +08:00
peanut 9d352f40a0 feat(script-favorite): add ScriptFavoriteServiceImpl
- toggleFavorite: upsert via logical-delete check + save, @Transactional
- getFavoritePage: paginate favorites then fetch EpicScript details
- getFavoritedScriptIds: batch IN query for checking multiple scripts
- isFavorited: count > 0 check for single script
- getFavoriteCount: total count for current user
- Uses UserContextHolder for userId, consistent with project pattern
2026-07-19 21:41:54 +08:00
peanut 674188f471 feat(script-favorite): add ScriptFavoriteService interface
- toggleFavorite: toggle favorite status for a script
- getFavoritePage: paginated list of user's favorite scripts
- getFavoritedScriptIds: batch check which scripts are favorited
- isFavorited: check single script favorite status
- getFavoriteCount: count user's total favorites
2026-07-19 21:41:28 +08:00
peanut 62ca1730b9 feat(script-favorite): add ScriptFavoriteResponse DTO
- Fields: scriptId, isFavorited, favoriteTime
- Used by toggle/check endpoints to return favorite status
2026-07-19 21:41:14 +08:00
peanut 0d27d1a072 feat(script-favorite): add ScriptFavoriteToggleRequest DTO
- Single field: scriptId with @NotBlank validation
- Uses javax.validation.constraints.NotBlank matching project convention
2026-07-19 21:41:02 +08:00
peanut d74d8b22c6 feat(script-favorite): add ScriptFavoriteMapper
- Extends BaseMapper<ScriptFavorite>
- Standard MyBatis-Plus mapper pattern matching project convention
2026-07-19 21:40:06 +08:00
peanut 489131a04b feat(script-favorite): add ScriptFavorite entity
- Extends BaseEntity for id, createTime, updateTime, isDeleted
- Maps to t_script_favorite table via MyBatis-Plus @TableName
- Fields: userId, scriptId
2026-07-19 21:39:47 +08:00
peanut 43ac037f5b feat(script-favorite): add t_script_favorite migration SQL
- Create t_script_favorite table with user_id, script_id
- Add unique key uk_user_script (user_id, script_id)
- Add indexes idx_user_id and idx_script_id
- Support logical delete via is_deleted flag
2026-07-19 21:39:27 +08:00
peanut 00f17d2f47 test(server): ShortNovelController 集成测试 2026-07-19 12:22:25 +08:00
peanut c06b04869b feat(server): 短篇小说 SSE 代理 Controller 2026-07-19 12:21:09 +08:00
peanut 02c58767bd fix(server): SSE 代理错误消息不再暴露原始异常信息给客户端 2026-07-19 12:18:54 +08:00
peanut 7018f5780a feat(server): 短篇小说服务 SSE 代理实现 2026-07-19 12:15:50 +08:00
peanut 031d824dd0 refactor(server): 抽取 saveNovelResult 方法供短篇小说服务复用 2026-07-19 12:08:54 +08:00
peanut 8f96239b56 style(server): 统一 ShortNovel 配置类和 DTO 的字段注释风格 2026-07-19 12:07:26 +08:00
peanut 21ce56c6da feat(server): 短篇小说外部服务配置类和请求 DTO 2026-07-19 12:02:17 +08:00
peanut 912fc42860 fix: 剧本查询时自动为历史剧本补建 conversation(兼容前端临时 ID) 2026-06-29 22:40:59 +08:00
peanut e3eb1afbb0 fix: listByConversation 在 conversation 不存在时返回空列表而非抛异常 2026-06-28 22:40:13 +08:00
peanut bd3ccbd757 test: 新增 EpicScriptDialogueService 未登录场景测试 2026-06-28 18:49:10 +08:00
peanut 3b9a8222de feat: 新增 ScriptChatController 统一流式接口 2026-06-28 18:16:07 +08:00
peanut 8537c27015 feat: MessageController 新增 listByConversation、versions、deleteVersion 2026-06-28 18:09:07 +08:00
peanut a66a78a0f3 feat: EpicScriptController 新增 createWithDialogue 和 switchVersion 2026-06-28 18:09:06 +08:00
peanut 57f1e311b6 feat: 实现 EpicScriptService.switchVersion
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 18:00:27 +08:00
peanut 8618b8b80f feat: EpicScriptService 新增 switchVersion 方法声明
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 18:00:22 +08:00
peanut b11a3463b2 feat: 实现剧本消息版本管理服务
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 17:42:11 +08:00
peanut e252dc5fd2 feat: 新增 ScriptMessageService 接口
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 17:42:05 +08:00
peanut 0520f30d84 feat: 新增 ScriptChatService 接口 2026-06-28 17:36:02 +08:00
peanut 752fd30686 fix: 修复剧本对话创建服务实现问题
- 添加系统欢迎语消息(messageOrder=1, sender=system)
- 调整用户消息顺序为 messageOrder=2
- 添加 AI 助手开场白消息(messageOrder=3, sender=assistant, type=script)
- 从 AI 生成结果中解析标题并更新到剧本实体
- 修复 messageCount 为 3 以匹配实际消息数量
- 删除不再需要的 buildTitle 方法
- 新增 buildSystemWelcome 方法构建系统欢迎语

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 17:24:47 +08:00
peanut 56369fdeb2 feat: 新增 EpicScriptDialogueService 接口
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 17:15:47 +08:00
peanut 88d586bab1 feat: MessageResponse 新增 scriptId、parentMessageId、versionNumber、metadata、status、timestamp 2026-06-28 17:08:31 +08:00
peanut 0149bac281 feat: EpicScriptResponse 新增 conversationId 和 currentVersionMessageId 2026-06-28 17:08:26 +08:00
peanut 42d1350aff feat: 新增 SwitchVersionRequest 2026-06-28 17:08:22 +08:00
peanut 43622be5b0 feat: 新增 ScriptChatStreamRequest 2026-06-28 17:08:18 +08:00
peanut 74183ccb30 feat: 新增 EpicScriptCreateWithDialogueResponse 2026-06-28 17:08:13 +08:00
peanut 06b2ee58e2 feat: 新增 EpicScriptCreateWithDialogueRequest 2026-06-28 17:08:09 +08:00
peanut 83c379d5d5 feat: Message 实体新增 scriptId 和 versionNumber 字段 2026-06-28 17:01:52 +08:00
peanut 15fce9eadf feat: Conversation 实体新增 scriptId 和 currentMessageId 字段 2026-06-28 16:56:58 +08:00
peanut 0ba2960c1b feat: EpicScript 实体新增 conversationId 和 currentVersionMessageId 字段 2026-06-28 16:56:57 +08:00