- 删除 V1 前端页面 (CalendarView, BudgetView, statisticsV1) - 移除 V1 路由配置 (/calendar, /budget, /) - 清理路由守卫中的 V1 版本切换逻辑 - 移除设置页面中的版本切换功能 - 更新底部导航和登录重定向到 V2 路由 - 移除 App.vue 中 V1 页面的缓存配置 - 删除后端 TransactionRecordController.GetDailyStatisticsAsync (Obsolete) - 删除 TransactionStatisticsController.GetBalanceStatisticsAsync - 保留 V2 仍在使用的共享 API (GetUncoveredCategories, GetArchiveSummary, GetDailyStatistics) - 保留 V2 使用的全局事件监听机制 - 所有测试通过 (210/210) Breaking Change: V1 API 端点和路由将不可用
83 lines
3.8 KiB
Markdown
83 lines
3.8 KiB
Markdown
## Why
|
||
|
||
随着系统 V2 版本的功能已经稳定运行,V1 版本的日历、统计、预算三大模块已成为历史遗留代码,增加了代码库的维护成本和认知负担。移除这些旧版本代码可以简化系统架构,降低未来重构的风险,同时减少不必要的测试和文档维护工作。
|
||
|
||
## What Changes
|
||
|
||
### **BREAKING** 移除前端 V1 页面
|
||
- 删除 `Web/src/views/CalendarView.vue` (日历视图)
|
||
- 删除 `Web/src/views/BudgetView.vue` (预算管理页面)
|
||
- 删除 `Web/src/views/statisticsV1/Index.vue` (统计 V1 页面)
|
||
- 移除相关路由配置 (`/calendar`, `/budget`, `/` 的 V1 路由)
|
||
|
||
### **BREAKING** 移除前端 API 客户端 (仅 V1 专用部分)
|
||
- 清理 `Web/src/api/transactionRecord.js` 中 V1 专用方法 (`GetDailyStatistics` 调用)
|
||
- 清理 `Web/src/api/budget.js` 中 V1 专用方法 (`GetUncoveredCategories`, `GetArchiveSummary`)
|
||
- 清理 `Web/src/api/statistics.js` 中 V1 专用方法 (`GetBalanceStatistics`)
|
||
|
||
### **BREAKING** 移除后端 Controller 接口 (仅 V1 专用部分)
|
||
- `TransactionRecordController.GetDailyStatisticsAsync` (已标记 Obsolete,仅 CalendarView 使用)
|
||
- `BudgetController.GetUncoveredCategoriesAsync` (仅 BudgetView 使用)
|
||
- `BudgetController.GetArchiveSummaryAsync` (仅 BudgetView 使用)
|
||
- `TransactionStatisticsController.GetBalanceStatisticsAsync` (仅 statisticsV1 使用)
|
||
|
||
### 移除后端 Service/Application 层 (仅 V1 专用部分)
|
||
- `BudgetApplication` 中移除 `GetUncoveredCategoriesAsync`, `GetArchiveSummaryAsync`
|
||
- `BudgetService` 中移除 `GetUncoveredCategoriesAsync`, `GetArchiveSummaryAsync`
|
||
- `TransactionStatisticsApplication` 中移除 `GetBalanceStatisticsAsync`
|
||
- `TransactionStatisticsService` 中移除 `GetBalanceStatisticsAsync`
|
||
|
||
### 清理共享组件的 V1 特定逻辑
|
||
- 检查 `TransactionList`, `TransactionDetail`, `PopupContainer` 等组件是否包含 V1 特定逻辑
|
||
- 移除全局事件监听 (`transaction-deleted`, `transactions-changed`) 如果仅 V1 使用
|
||
|
||
### 更新路由守卫和版本控制逻辑
|
||
- 移除 `Web/src/router/index.js` 中的 V1 路由配置
|
||
- 简化 `useVersionStore` 中的版本切换逻辑(移除 V1 相关分支)
|
||
|
||
## Capabilities
|
||
|
||
### New Capabilities
|
||
|
||
(无新增能力)
|
||
|
||
### Modified Capabilities
|
||
|
||
- `routing`: 移除 V1 路由配置,简化版本切换逻辑
|
||
- `transaction-api`: 移除 `GetDailyStatistics` (Obsolete) 接口
|
||
- `budget-api`: 移除 `GetUncoveredCategories`, `GetArchiveSummary` 接口
|
||
- `statistics-api`: 移除 `GetBalanceStatistics` 接口
|
||
|
||
## Impact
|
||
|
||
### 前端影响
|
||
- **页面数量**: 减少 3 个页面文件
|
||
- **路由配置**: 移除 3 个路由 (`/calendar`, `/budget`, `/`)
|
||
- **API 客户端**: 清理 4+ 个废弃方法
|
||
- **组件**: 需验证共享组件 (`TransactionList`, `TransactionDetail`) 在 V2 中是否正常工作
|
||
|
||
### 后端影响
|
||
- **Controller 层**: 移除 4 个 API 端点
|
||
- **Application 层**: 移除 4 个业务方法
|
||
- **Service 层**: 移除 4 个服务方法
|
||
- **Repository 层**: 无影响 (V2 继续使用相同的 Repository)
|
||
|
||
### 兼容性影响
|
||
- **破坏性变更**: 所有 V1 API 端点将不可用
|
||
- **用户影响**: V1 用户必须切换到 V2 版本
|
||
- **数据影响**: 无,数据库表和实体不受影响
|
||
|
||
### 测试影响
|
||
- **单元测试**: 需移除 V1 相关的测试用例
|
||
- **集成测试**: 需验证 V2 页面功能完整性
|
||
- **手动测试**: 需打开 V2 页面进行功能回归测试
|
||
|
||
### 依赖影响
|
||
- **共享组件**: `TransactionList`, `TransactionDetail`, `PopupContainer`, `SmartClassifyButton` 仍被 V2 使用,不能删除
|
||
- **第三方库**: ECharts 仍被 V2 使用,不能删除
|
||
- **全局事件**: 需检查 `transaction-deleted`, `transactions-changed` 事件是否仅被 V1 监听
|
||
|
||
### 文档影响
|
||
- 需更新 API 文档,标记移除的端点
|
||
- 需更新用户文档,说明 V1 已下线
|