支付系统核心:配额限制与用户付费状态管理

- 添加 tokio 依赖用于异步测试
- 启用 User 结构体,添加 is_paid/is_admin/paid_expires_at 字段
- 添加 UpdatePaymentRequest 请求体
- insert_weather_data 集成配额检查逻辑
- 新增 get_user_by_id、count_user_weather_data、update_user_payment_status
- 添加 payment_fields 数据库迁移脚本
This commit is contained in:
2026-03-25 13:17:36 +08:00
parent 63b6d5df8f
commit 484146aba9
5 changed files with 117 additions and 19 deletions

View File

@@ -18,3 +18,7 @@ reqwest = { version = "0.12.23", features=["json"]}
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.143"
sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid"] }
tokio = { version = "1", features = ["full"] }
[dev-dependencies]
tokio = { version = "1", features = ["full"] }