fix(handlers): add handlers

This commit is contained in:
2026-01-30 16:31:53 +08:00
parent bb82c75834
commit ce12b997f4
38 changed files with 3746 additions and 317 deletions

View File

@@ -4,15 +4,19 @@ version = "0.1.0"
edition = "2024"
[dependencies]
# 统一日志处理与错误处理
common-telemetry = { version = "0.1.3", registry = "kellnr", default-features = false, features = [
"error",
common-telemetry = { version = "0.1.5", registry = "kellnr", default-features = false, features = [
"response",
"telemetry",
"with-anyhow",
"with-sqlx",
] }
] } # 内部公共库(统一错误/响应/日志/Telemetry
# Web 框架
# Web 框架与 HTTP 基础
axum = "0.8.8"
http = "1.4.0"
# 异步运行时与通用异步工具
async-trait = "0.1.89"
tokio = { version = "1", features = ["full"] }
# 序列化
@@ -21,25 +25,46 @@ serde_json = "1"
# 数据库 (PostgreSQL)
sqlx = { version = "0.8", features = [
"runtime-tokio-native-tls",
"postgres",
"uuid",
"chrono",
"json",
"postgres",
"runtime-tokio-native-tls",
"uuid",
] }
# 工具
uuid = { version = "1", features = ["v4", "serde"] }
dotenvy = "0.15" # 加载 .env
# 配置管理
config = "0.15.19" # 方便读取配置
dotenvy = "0.15" # 加载 .env
# 错误处理
anyhow = "1"
thiserror = "2.0.18"
jsonwebtoken = { version = "10.3.0", features = ["aws_lc_rs"] }
argon2 = "0.5"
rand = "0.9.2"
config = "0.15.19" # 方便读取配置
# 可观测性(日志与 tracing
tracing = "0.1"
tracing-subscriber = "0.3"
# API 文档 (关键部分)
# 安全与加密密码、JWT、密钥/编码)
argon2 = "0.5"
base64 = "0.22.1"
hex = "0.4.3"
jsonwebtoken = { version = "10.3.0", features = ["aws_lc_rs"] }
rand = "0.9.2"
rsa = "0.9.10"
uuid = { version = "1", features = ["v4", "serde"] }
# API 文档 (OpenAPI/Scalar)
utoipa = { version = "5", features = ["axum_extras", "uuid", "chrono"] }
utoipa-scalar = { version = "0.3.0", features = ["axum"] } # Scalar 集成
async-trait = "0.1.89"
http = "1.4.0"
# 中间件组件(限流)
governor = "0.10.4"
ipnet = "2.11.0"
tower_governor = { version = "0.8.0", features = ["axum"] }
# 时间处理
chrono = "0.4.43"
[dev-dependencies]
# 测试工具
tower = "0.5"