Task 2: 完成 Repository 层测试 - 实现 CaseLibraryRepositoryTest (6 个测试) - 实现 ApiDocumentRepositoryTest (7 个测试) - 所有 Repository 测试通过 (19/19) Task 3: 完成 Redis 会话管理 - 创建 SessionContext 和 ToolCall 数据类 - 创建 SessionManager 接口 - 实现 RedisSessionManager (基于 Redis 的会话管理) - 创建 SessionConfiguration (Redis 序列化配置) - 实现 RedisSessionManagerTest (8 个测试全部通过) 测试结果: - ApiDocumentRepositoryTest: 7/7 通过 - CaseLibraryRepositoryTest: 6/6 通过 - DiagnosisRecordRepositoryTest: 6/6 通过 - RedisSessionManagerTest: 8/8 通过 - 总计: 27/27 测试通过 功能特性: - 会话创建、查询、更新、删除 - 会话过期时间管理 - 工具调用记录追踪 - 会话状态管理 - 基于 Redis 的分布式会话存储 Progress: 20/33 tasks completed (61%)
53 lines
2.3 KiB
Markdown
53 lines
2.3 KiB
Markdown
# Phase 1 Infrastructure - Tasks
|
|
|
|
## 1. 数据库与依赖
|
|
|
|
- [x] 1.1 添加依赖到 pom.xml (spring-boot-starter-data-jpa, mysql-connector-j, flyway-core, spring-boot-starter-data-redis)
|
|
- [x] 1.2 创建 Flyway 迁移脚本 V001__create_diagnosis_record.sql
|
|
- [x] 1.3 创建 Flyway 迁移脚本 V002__create_case_library.sql
|
|
- [x] 1.4 创建 Flyway 迁移脚本 V003__create_api_document.sql
|
|
- [x] 1.5 配置 MySQL + Redis + Flyway (application.yml)
|
|
|
|
## 2. JPA 实体与 Repository
|
|
|
|
- [x] 2.1 创建 JPA 实体类 DiagnosisRecord
|
|
- [x] 2.2 创建 JPA 实体类 CaseLibrary
|
|
- [x] 2.3 创建 JPA 实体类 ApiDocument
|
|
- [x] 2.4 创建 DiagnosisRecordRepository 接口
|
|
- [x] 2.5 创建 CaseLibraryRepository 接口
|
|
- [x] 2.6 创建 ApiDocumentRepository 接口
|
|
- [x] 2.7 Repository 单元测试 (DiagnosisRecordRepositoryTest)
|
|
- [x] 2.8 Repository 单元测试 (CaseLibraryRepositoryTest)
|
|
- [x] 2.9 Repository 单元测试 (ApiDocumentRepositoryTest)
|
|
|
|
## 3. 会话管理
|
|
|
|
- [x] 3.1 创建 SessionManager 接口
|
|
- [x] 3.2 创建 SessionContext 数据类
|
|
- [x] 3.3 创建 ToolCall 数据类
|
|
- [x] 3.4 创建 RedisSessionManager 实现
|
|
- [x] 3.5 创建 SessionConfiguration 配置类
|
|
- [x] 3.6 Redis 会话管理单元测试 (RedisSessionManagerTest)
|
|
|
|
## 4. 代码结构重构
|
|
|
|
- [ ] 4.1 包名重构 (org.example → com.superbiz.agent)
|
|
- [ ] 4.2 分层结构优化 (controller/service/repository/domain/tool/config/exception)
|
|
- [ ] 4.3 创建 DTO 类 (DiagnosisRequest, DiagnosisResponse, DocumentUploadRequest, DocumentQueryResponse, Result)
|
|
|
|
## 5. 文档管理服务
|
|
|
|
- [ ] 5.1 创建 TextExtractor 服务 (支持 .txt, .md, .docx, .pdf)
|
|
- [ ] 5.2 文档分块服务 (DocumentChunkService, chunk_size=500, overlap=50)
|
|
- [ ] 5.3 文档上传接口 (DocumentController#upload, DocumentService#uploadDocument)
|
|
- [ ] 5.4 文档查询接口 (DocumentController#query, DocumentService#queryDocuments)
|
|
- [ ] 5.5 文档删除接口 (DocumentController#delete, DocumentService#deleteDocument)
|
|
- [ ] 5.6 混合检索工具 (DocumentSearchTool: 精确匹配 + 语义检索 + RRF 融合)
|
|
- [ ] 5.7 文档管理集成测试 (DocumentIntegrationTest)
|
|
|
|
## 6. 全局完善
|
|
|
|
- [ ] 6.1 统一异常处理 (GlobalExceptionHandler, SessionNotFoundException, DocumentProcessException)
|
|
- [ ] 6.2 Docker Compose 配置 (MySQL + Redis + Milvus)
|
|
- [ ] 6.3 更新 README.md (Phase 1 安装说明与本地开发指南)
|