[WIP] Add new endpoints for managing stories#9
Merged
Conversation
IfeyChan702
marked this pull request as ready for review
February 12, 2026 09:48
Copilot stopped work on behalf of
IfeyChan702 due to an error
February 12, 2026 09:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flutter Story and Character Feature Implementation
Original prompt
背景
当前 main 分支的 Spring Boot 后端已经有完整的 Story(故事)和 Character(主角)API 实现,包括:
后端已有的 Story API (
/api/story/)POST /api/story/generate- 通过图片生成故事(上传图片 base64 + 主角ID)GET /api/story/list- 获取故事列表(支持 characterId 和 isFavorite 筛选)GET /api/story/{id}- 获取故事详情PUT /api/story/{id}- 更新故事(title, content)DELETE /api/story/{id}- 删除故事POST /api/story/{id}/favorite- 收藏故事DELETE /api/story/{id}/favorite- 取消收藏POST /api/story/{id}/share- 生成分享链接GET /api/story/shared/{shareToken}- 通过分享链接查看故事后端已有的 Character API (
/api/character/)后端已有的 Search API (
/api/search/)POST /api/search/stories- 搜索故事POST /api/search/characters- 搜索主角POST /api/search/all- 全局搜索(故事+主角)后端故事生成流程
GenerateStoryRequest: 包含 image (base64/url), imageType, characterId, titleGenerateStoryResponse: 包含 success, story, identifiedObjects, errorMessage, processingTimeanalyzeImage()识别图片物品,然后用generateStoryFromObjects()生成故事需要做的事情
在
flutter_app/目录下更新 Flutter 代码,添加 Story 和 Character 相关的完整前端实现。不要删除或修改现有的 Note、RAG、Review 等功能代码,只做增量添加。1. 更新
flutter_app/lib/utils/constants.dart添加以下 API endpoint 常量:
2. 添加新的 Models
在
flutter_app/lib/models/下添加:story_model.dart- 故事数据模型character_model.dart- 主角数据模型generate_story_request_model.dart- 生成故事请求模型generate_story_response_model.dart- 生成故事响应模型3. 更新
flutter_app/lib/services/api_service.dart在 ApiService 类中添加以下方法(不要修改现有方法):