功能:摄像头区域绑定 area_id,配置推送携带区域信息

- StreamProxy Bean 添加 areaId 字段
- StreamProxyMapper INSERT/UPDATE 支持 area_id
- AiRedisConfigServiceImpl buildFlatConfig 输出 camera.area_id

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-18 16:05:03 +08:00
parent 38b6a20e45
commit 7db9a3f95d
3 changed files with 10 additions and 3 deletions

View File

@@ -560,6 +560,9 @@ public class AiRedisConfigServiceImpl implements IAiRedisConfigService {
cameraMap.put("location", "");
cameraMap.put("rtsp_url", rtspUrl);
cameraMap.put("rtsp_url_valid", true);
if (proxy.getAreaId() != null) {
cameraMap.put("area_id", proxy.getAreaId());
}
cameras.add(cameraMap);
// 该摄像头下的 ROI 和绑定

View File

@@ -72,6 +72,9 @@ public class StreamProxy extends CommonGBChannel {
@Schema(description = "拉流状态")
private Boolean pulling;
@Schema(description = "所属区域ID")
private Long areaId;
public CommonGBChannel buildCommonGBChannel() {
if (ObjectUtils.isEmpty(this.getGbDeviceId())) {
return null;

View File

@@ -13,10 +13,10 @@ public interface StreamProxyMapper {
@Insert("INSERT INTO wvp_stream_proxy (type, app, stream,relates_media_server_id, src_url, " +
"timeout, ffmpeg_cmd_key, rtsp_type, enable_audio, enable_mp4, enable, pulling, " +
"enable_disable_none_reader, server_id, create_time, camera_code) VALUES" +
"enable_disable_none_reader, server_id, create_time, camera_code, area_id) VALUES" +
"(#{type}, #{app}, #{stream}, #{relatesMediaServerId}, #{srcUrl}, " +
"#{timeout}, #{ffmpegCmdKey}, #{rtspType}, #{enableAudio}, #{enableMp4}, #{enable}, #{pulling}, " +
"#{enableDisableNoneReader}, #{serverId}, #{createTime}, #{cameraCode} )")
"#{enableDisableNoneReader}, #{serverId}, #{createTime}, #{cameraCode}, #{areaId} )")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
int add(StreamProxy streamProxyDto);
@@ -33,7 +33,8 @@ public interface StreamProxyMapper {
"enable=#{enable}, " +
"pulling=#{pulling}, " +
"enable_disable_none_reader=#{enableDisableNoneReader}, " +
"enable_mp4=#{enableMp4} " +
"enable_mp4=#{enableMp4}, " +
"area_id=#{areaId} " +
"WHERE id=#{id}")
int update(StreamProxy streamProxyDto);