feat(aiot): 截图持久化 — cos_key 存入 DB,proxyImage 支持 DB 兜底

- 新建 wvp_ai_camera_snapshot 表(camera_code → cos_key 映射)
- 新建 AiCameraSnapshotMapper(getCosKey / upsert)
- AiScreenshotServiceImpl: handleCallback 成功后将 cos_key 写入 DB
- AiScreenshotServiceImpl: proxyScreenshotImage 增加 DB 兜底路径
  Redis 缓存(5min) → DB(永久) → CosUtil 生成 presigned URL → 下载
- AiRoiController: Cache-Control 从 60s 增大到 300s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 20:08:47 +08:00
parent bdd69ce268
commit 650894b4e4
4 changed files with 91 additions and 14 deletions

View File

@@ -0,0 +1,6 @@
-- 截图持久化表:保存摄像头最新截图的 COS object key
CREATE TABLE IF NOT EXISTS wvp_ai_camera_snapshot (
camera_code VARCHAR(64) PRIMARY KEY COMMENT '摄像头编码',
cos_key VARCHAR(512) NOT NULL COMMENT 'COS 对象键(永久有效)',
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='AI摄像头截图持久化';