docs: 更新 IMPROVEMENTS.md 标记 1.1 已完成
This commit is contained in:
@@ -3,14 +3,17 @@
|
||||
## 一、代码质量与架构改进
|
||||
|
||||
### 1.1 代码组织问题
|
||||
- [ ] **所有路由处理器都在 main.rs 中**
|
||||
- 现状:`main.rs` 包含所有路由处理器,文件过大(800+ 行)
|
||||
- 改进:按功能模块拆分到独立文件
|
||||
- [x] **所有路由处理器都在 main.rs 中** ✅
|
||||
- 改进:将 handler 函数按功能模块拆分到 `handlers/` 目录
|
||||
- 目录结构:
|
||||
- `handlers/auth.rs` - 登录相关
|
||||
- `handlers/weather.rs` - 天气数据相关
|
||||
- `handlers/weather.rs` - 天气数据 CRUD
|
||||
- `handlers/user.rs` - 用户相关
|
||||
- `handlers/admin.rs` - 管理员相关
|
||||
- 影响:提高代码可维护性
|
||||
- `handlers/admin.rs` - 管理员功能
|
||||
- `handlers/health.rs` - 健康检查
|
||||
- `handlers/static_files.rs` - 静态文件服务
|
||||
- 完成时间:2026-04-15
|
||||
- 附加:发现并修复静态文件被 JWT middleware 拦截的问题(路由顺序)
|
||||
|
||||
- [ ] **config.rs 是死代码**
|
||||
- 现状:AGENTS.md 中提到 config.rs 未被使用
|
||||
|
||||
Reference in New Issue
Block a user