fix(app): 修复 AppController 安全与查询问题

- 加强异常处理、类型安全和图片上传校验
- 优化设备相关查询,避免重复访问数据源
- 补充并记录并发测试与审查修复实施计划
This commit is contained in:
yuhaiming
2026-07-17 08:20:44 +08:00
parent 4a4aabf19e
commit 70e2356f22
82 changed files with 6070 additions and 583 deletions

View File

@@ -133,7 +133,7 @@ sequenceDiagram
```mermaid
flowchart TB
REDIS[("Redis")]
STATUS["mqtt:device:status:{deviceNo}<br/>设备最新在线状态<br/>TTL: 300s"]
STATUS["mqtt:device:status:{deviceNo}<br/>设备电量在线心跳<br/>TTL: 600s"]
PENDING["mqtt:command:pending:{commandId}<br/>待ACK命令详情<br/>TTL: 86400s"]
PENDING_IDS["mqtt:command:pending:ids<br/>待ACK commandId 集合"]
ACK["mqtt:command:ack:{commandId}<br/>设备ACK结果<br/>TTL: 86400s"]
@@ -176,7 +176,7 @@ flowchart TB
B --> C["后端单/少量订阅客户端消费通配 topic"]
C --> D["有界队列吸收突发流量"]
D --> E["批量消费降低线程调度成本"]
E --> F["状态写 Redis,避免心跳打数据库"]
E --> F["电量心跳写 Redis 并同步设备状态"]
F --> G["数据/告警后续建议批量落库"]
```