Files
2026Technology-Competition/docs/_MASTER_PLAN.md
T

79 lines
3.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Master 骨架搭建 · 执行计划
## 目录结构
```
<仓库根目录> ← Git 仓库根目录
├── backend/ ← 后端 Maven 多模块
│ ├── pom.xml ← 父 POM
│ ├── ims-common/ ← 公共模块(DTO、工具类)
│ ├── ims-api/ ← API 模块(Controller 定义)
│ ├── ims-service/ ← 业务模块(Entity、Repository、Security
│ └── ims-web/ ← Web 启动模块
├── frontend/ ← 前端 Vite + React + Ant Design
├── docs/ ← 设计文档
├── docker-compose.yml ← PostgreSQL 16 + pgvector + Redis 7 + MinIO
└── _MASTER_PLAN.md
```
## 阶段 1:数据库 + Docker Compose
| # | 任务 | 产出 |
|---|------|------|
| 1.1 | docker-compose.ymlPostgreSQL 16pgvector+ Redis 7 + MinIO + 初始化脚本 | 1 个 yml + 1 个 init SQL |
| 1.2 | Flyway V1.0:基础表(departments, users, roles, permissions, user_roles, role_permissions | 1 个 SQL |
| 1.3 | Flyway V1.1:核心业务表(issues, issue_logs, attachments, notifications, task_executions | 1 个 SQL |
| 1.4 | Flyway V1.2AI 分析表(ai_analysis, ai_feedback | 1 个 SQL |
| 1.5 | Flyway V1.3Agent 表(agent_plans, agent_memories, tool_executions | 1 个 SQL |
| 1.6 | Flyway V1.4:知识库表(knowledge_documents, knowledge_chunks, knowledge_search_logs | 1 个 SQL |
| 1.7 | Flyway V1.5Prompt 模板表(prompt_templates, prompt_template_versions, prompt_render_logs | 1 个 SQL |
| 1.8 | Flyway V1.6:种子数据(admin 账号 + 6 个预设角色 + 权限数据) | 1 个 SQL |
## 阶段 2:后端 POM + 配置
| # | 任务 | 产出 |
|---|------|------|
| 2.1 | 父 POM + 4 子模块 pom.xml,统一管理依赖 | 5 个 pom.xml |
| 2.2 | application.yml + application-dev.yml + application-prod.yml | 3 个 yml |
## 阶段 3:后端 Java 基础设施
| # | 任务 | 产出 |
|---|------|------|
| 3.1 | ims-commonApiResponse、PageResult、ResultCode、BusinessException | 4 个 Java 类 |
| 3.2 | JwtUtil(生成/校验 access_token + refresh_token | 1 个 Java 类 |
| 3.3 | 启动类、Jackson 配置、全局异常处理、CORS 配置 | 4 个 Java 类 |
| 3.4 | 全部 21 张表的 JPA Entity | 21 个 Java 类 |
| 3.5 | 全部 Repository 接口 | 21 个 Java 类 |
| 3.6 | 请求/响应 DTO(按模块分包:auth/issue/agent/knowledge/prompt/system | ~30 个 Java 类 |
## 阶段 4:后端 Security + Controller
| # | 任务 | 产出 |
|---|------|------|
| 4.1 | SecurityConfig + JwtAuthFilter + UserDetailsServiceImpl | 3 个 Java 类 |
| 4.2 | 数据权限 AOP@DataScope 注解 + 切面(空实现骨架) | 2 个 Java 类 |
| 4.3 | AuthController(真实实现,POST /auth/login 返回 JWT | 1 个 Controller |
| 4.4 | 其余 10 个 Controller 空实现(return ApiResponse.success(null) | 10 个 Controller |
## 阶段 5:前端项目
| # | 任务 | 产出 |
|---|------|------|
| 5.1 | npm create vite → React + TypeScript,安装依赖 | 脚手架 |
| 5.2 | Ant Design 主题 + axios 封装 + Redux store | 4 个文件 |
| 5.3 | 登录页(表单 + API 调用 + token 存储 + 跳转) | 1 个页面 |
| 5.4 | 全局 Layout(侧边栏 + 顶栏 + Outlet | 1 个 Layout 组件 |
| 5.5 | 路由表(懒加载 + 路由守卫 + 侧边栏联动) | routes.tsx |
| 5.6 | 13 个空页面壳(显示"待实现"占位) | 13 个页面组件 |
## 验证标准
```bash
docker-compose up -d
cd backend/ims-web && mvn spring-boot:run
cd frontend && npm run dev
```
浏览器 http://localhost:5173 → 登录页 → 种子账号登录 → 侧边栏可点 → 各页面"待实现"