lzh
3a3f7b78d4
refactor(video): 预置 AI 算法改为 SQL 种子数据,移除 @PostConstruct 初始化
原 AiAlgorithmServiceImpl.initPresetAlgorithms() 在 @PostConstruct
里插入 4 条预置算法,带来两个问题:
1. 启动时无登录上下文,MP 自动填充 creator 失效 → 启动失败
2. 算法清单硬编码在 Java 代码,迭代要重编译发布
改为 video.sql 种子数据管理:
- video.sql 的预置算法 INSERT 扩展为 4 条(leave_post / intrusion /
illegal_parking / vehicle_congestion),参数 schema 与边缘端对齐
- 使用 ON DUPLICATE KEY UPDATE 保证幂等:新库初始化 + 存量库升级
都走同一条语句,param_schema / description 会被自动校正
- 保留用户侧可修改的字段(is_active / global_params)不被覆盖
代码层:
- 删除 initPresetAlgorithms() 方法与 PRESET_ALGORITHMS 静态 Map
- 删除 SYSTEM_USER 常量
- 删除 @PostConstruct / HashMap 相关 import
- 保留 syncFromEdge() 作为边缘端主动同步的运行时入口
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 13:54:39 +08:00
..
2026-04-16 22:27:34 +08:00
2026-03-22 14:58:55 +08:00
2026-02-03 15:34:03 +08:00
2026-01-21 18:44:30 +08:00
2026-02-26 17:16:24 +08:00
2026-03-11 17:32:56 +08:00
2026-03-31 22:56:18 +08:00
2026-03-25 14:27:04 +08:00
2026-03-15 10:35:30 +08:00
2026-03-25 14:27:04 +08:00
2025-12-31 11:48:19 +08:00
2025-12-31 11:48:19 +08:00
2026-03-22 20:08:55 +08:00
2026-04-22 13:54:39 +08:00