feat: 完善生产级 Rust Web 模板

This commit is contained in:
2026-07-21 16:00:03 +08:00
parent fb30d5da1a
commit ce89569bf3
58 changed files with 2042 additions and 349 deletions
+8 -2
View File
@@ -7,8 +7,8 @@ edition = "2021"
# ===== Web 框架 =====
axum = "0.7"
tokio = { version = "1", features = ["full"] }
tower = "0.4"
tower-http = { version = "0.5", features = ["cors", "trace"] }
tower = { version = "0.5", features = ["limit", "timeout", "util"] }
tower-http = { version = "0.5", features = ["catch-panic", "cors", "limit", "set-header", "timeout", "trace"] }
# ===== 数据库(支持 MySQL、SQLite、PostgreSQL =====
# SeaORM - 数据库 ORM(替代 SQLX 直接使用)
@@ -30,6 +30,10 @@ jsonwebtoken = "9"
argon2 = "0.5"
sha2 = "0.10"
base64 = "0.22"
aes-gcm = "0.10"
# ===== 邮件发送 =====
lettre = { version = "0.11", default-features = false, features = ["tokio1", "tokio1-rustls", "builder", "smtp-transport", "webpki-roots", "ring"] }
# ===== Redis =====
redis = { version = "0.27", features = ["tokio-comp", "connection-manager"] }
@@ -45,6 +49,8 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
config = "0.13"
rand = "0.8"
clap = { version = "4", features = ["derive", "env"] }
validator = { version = "0.16", features = ["derive"] }
http-body-util = "0.1"
# 优化发布版本
[profile.release]