模組化重構 Phase 1-2完成:CLI架构分离 + API模块结构建立
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled

Phase 1:CLI架构重构
- main.rs: 509行 → 21行(简化96%)
- 新增cli模块:框架命令与应用命令分离
  - cli/framework.rs (394行): Display/Render/Config/Scan/Hash/WebDAV/iSCSI
  - cli/apps/download_center.rs (59行): ImportMarkdown/SshServer/Sftp
- 编译成功,CLI命令正确识别(11个命令)

Phase 2:API模块结构创建
- 新增api模块目录结构:api/handlers/
- 为未来handler模块预留空间:
  - tree.rs: FileTree CRUD
  - file.rs: 文件流/渲染
  - upload.rs: 上传处理
  - auth.rs: 认证
  - config.rs: 配置管理
  - system.rs: 系统健康检查
  - view.rs: 分类/系列视图
  - static.rs: 静态页面
- server.rs保持稳定(2409行),降低重构风险

架构优势:
- 清晰的框架/应用分离
- 降低耦合度,便于后续维护
- 为新功能提供清晰的模块空间
- 保持现有功能稳定运行
This commit is contained in:
Warren
2026-06-12 20:59:22 +08:00
parent da62973a43
commit 499efed099
8 changed files with 511 additions and 497 deletions

View File

@@ -0,0 +1,12 @@
pub mod handlers;
// API Module - Future Modular Architecture
//
// This module provides the structure for modular API handlers.
// Current implementation remains in server.rs for stability.
//
// Benefits of this architecture:
// - Clear separation of concerns
// - Easier maintenance for new features
// - Gradual migration path from server.rs
// - Independent testing per handler module