|
|
e6048ea010
|
feat(auth): 实现登录限流和性能优化
性能优化:
- 添加数据库索引优化查询性能 (006)
- weather_data: user_id, date, is_favorite 索引
- users: openid 索引
- payment_orders: status 索引
- 新增 refresh_tokens 表支持双 Token 机制 (004)
- 新增 web_login_codes 表支持网页端扫码登录 (005)
安全增强:
- 实现基于 IP 的登录限流 (rate_limiter.rs)
- 滑动窗口算法: 5次/分钟/IP
- 自动清理过期记录
- 429 TooManyRequests 响应
新模块:
- src/rate_limiter.rs: 限流模块
- src/alipay.rs: 支付宝签名模块 (RSA2)
- src/error.rs: 统一错误类型 (含 TooManyRequests)
- src/handlers/meta.rs: 元数据处理器
代码清理:
- 修复 .gitignore 规则,正确跟踪 src/ 和 migrations/
|
2026-04-24 16:13:49 +08:00 |
|
|
|
e8286310ea
|
feat(payment): 接入支付宝沙箱环境 (alipay.trade.page.pay)
|
2026-04-23 12:23:53 +08:00 |
|
|
|
a91948a18c
|
refactor(config): 统一版本管理,移除冗余的 app_version 字段
- 移除 config/*.toml 中的 app_version 字段(代码中未使用)
- 版本号统一由 Cargo.toml 管理
- Cargo.lock 自动同步更新
- 更新 AGENTS.md 添加版本管理说明
|
2026-04-19 20:35:12 +08:00 |
|
|
|
e14c85436b
|
feat(auth): 添加 Refresh Token 双 Token 机制
- 添加 /api/refresh-token 接口支持 Token 续期
- 登录接口返回 access_token 和 refresh_token
- 新增 refresh_tokens 表存储 refresh_token
- 部署脚本添加数据库备份和迁移功能
- deploy.sh 添加 4 项 API 测试
- 更新 AGENTS.md 文档
|
2026-04-19 16:01:41 +08:00 |
|
|
|
562528a1f0
|
feat: implement payment order system (create-order, mock-confirm, get-quota)
|
2026-04-17 12:45:53 +08:00 |
|
|
|
da4e6f557e
|
feat: 实现后端多环境配置机制
- 使用 toml crate 替代 config crate 直接读取配置文件
- 创建 config/default.toml、config/development.toml、config/production.toml
- 重写 config.rs 支持多环境配置加载
- 增强 deploy.sh 支持 development/production 环境参数
- 更新 IMPROVEMENTS.md 标记环境区分完成
|
2026-04-17 11:11:13 +08:00 |
|
|
|
741d6acff1
|
feat: 升级日志系统为 tracing 结构化日志
- 替换 env_logger 为 tracing + tracing-subscriber
- 统一使用 tracing::{debug, error, info, warn} 日志宏
- 消除所有 eprintln!/println 调用
- 添加 JSON 格式日志输出便于 ELK Stack 收集
- 添加文件日志轮转(每天一个新文件 ./logs/rust-backend-{date}.log)
- 日志等级过滤:rust_backend=info, actix_web=info, sqlx=warn
- 更新 IMPROVEMENTS.md 标记 6.1 日志系统两项完成
|
2026-04-15 10:39:30 +08:00 |
|
|
|
484146aba9
|
支付系统核心:配额限制与用户付费状态管理
- 添加 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 数据库迁移脚本
|
2026-03-25 13:17:36 +08:00 |
|
|
|
7143064a09
|
更新了https功能,将原有的服务从http迁移到了https中
|
2025-09-30 17:26:56 +08:00 |
|
|
|
7fa1ae6301
|
使用了logger来进行后端的消息记录
|
2025-09-30 15:59:15 +08:00 |
|
|
|
ea64c436b6
|
可以在使用temp_token的情况下使浏览器和微信小程序前端都能获取到正确的数据
|
2025-09-29 11:56:08 +08:00 |
|
|
|
56844a537f
|
可以正常使用get_weather_details获取前端指定的数据了
|
2025-09-29 11:20:21 +08:00 |
|
|
|
1c2eb82248
|
使用了jwt作为身份验证和分发
|
2025-09-26 13:48:18 +08:00 |
|
|
|
40d4c9ad49
|
weather data upload test
|
2025-09-12 09:25:15 +08:00 |
|
|
|
00a4faa410
|
添加weatherdata表的struct
|
2025-09-10 16:24:01 +08:00 |
|
|
|
7e569e59d6
|
更新了get_user_id和get_openid
|
2025-09-10 15:42:05 +08:00 |
|
|
|
f567e66485
|
访问users数据库
|
2025-09-05 15:10:30 +08:00 |
|
|
|
e6f937fe44
|
initialize
|
2025-09-04 16:36:08 +08:00 |
|