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行),降低重构风险 架构优势: - 清晰的框架/应用分离 - 降低耦合度,便于后续维护 - 为新功能提供清晰的模块空间 - 保持现有功能稳定运行
12 lines
390 B
Rust
12 lines
390 B
Rust
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
|