This repository has been archived on 2025-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2024-11-15 23:32:18 +08:00
.idea 添加 r2d2 和 r2d2_mysql 依赖,重构数据库连接池,更新用户服务接口以支持新的连接管理 2024-11-15 23:32:18 +08:00
src 添加 r2d2 和 r2d2_mysql 依赖,重构数据库连接池,更新用户服务接口以支持新的连接管理 2024-11-15 23:32:18 +08:00
.gitignore init 2024-11-03 23:22:03 +08:00
Cargo.lock 添加 r2d2 和 r2d2_mysql 依赖,重构数据库连接池,更新用户服务接口以支持新的连接管理 2024-11-15 23:32:18 +08:00
Cargo.toml 添加 r2d2 和 r2d2_mysql 依赖,重构数据库连接池,更新用户服务接口以支持新的连接管理 2024-11-15 23:32:18 +08:00
README.md init user 2024-11-06 21:50:58 +08:00

Rust分层架构

  1. 表示层Presentation Layer负责处理 HTTP 请求和响应,通常包含路由和控制器。
  2. 业务逻辑层Business Logic Layer包含服务和业务逻辑实现核心应用功能。
  3. 数据访问层Data Access Layer与数据库或其他存储系统进行交互。
  4. 模型层Model Layer定义应用程序的数据结构。
src/
|-- main.rs
|-- routes/      # 表示层
|   |-- mod.rs
|   |-- user_routes.rs
|-- services/    # 业务逻辑层
|   |-- mod.rs
|   |-- user_service.rs
|-- repositories/ # 数据访问层
|   |-- mod.rs
|   |-- user_repository.rs
|-- models/      # 模型层
    |-- mod.rs
    |-- user.rs