功能:截图请求XADD消息中加入device_id字段,支持多Edge设备隔离
This commit is contained in:
@@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.aiot.service.impl;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.genersoft.iot.vmp.aiot.dao.AiCameraSnapshotMapper;
|
||||
import com.genersoft.iot.vmp.aiot.dao.AiRoiMapper;
|
||||
import com.genersoft.iot.vmp.aiot.service.IAiScreenshotService;
|
||||
import com.genersoft.iot.vmp.aiot.util.CosUtil;
|
||||
import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy;
|
||||
@@ -55,6 +56,9 @@ public class AiScreenshotServiceImpl implements IAiScreenshotService {
|
||||
@Autowired
|
||||
private AiCameraSnapshotMapper snapshotMapper;
|
||||
|
||||
@Autowired
|
||||
private AiRoiMapper roiMapper;
|
||||
|
||||
@Autowired
|
||||
private CosUtil cosUtil;
|
||||
|
||||
@@ -114,6 +118,12 @@ public class AiScreenshotServiceImpl implements IAiScreenshotService {
|
||||
fields.put("callback_url", callbackUrl);
|
||||
}
|
||||
|
||||
// 查询摄像头关联的 device_id,供 Edge 按设备过滤
|
||||
String deviceId = roiMapper.queryDeviceIdByCameraId(cameraCode);
|
||||
if (deviceId != null && !deviceId.isEmpty()) {
|
||||
fields.put("device_id", deviceId);
|
||||
}
|
||||
|
||||
// 查询 rtsp_url 放入请求,供 Edge 对无 ROI 摄像头临时连接截图
|
||||
StreamProxy proxy = streamProxyMapper.selectByCameraCode(cameraCode);
|
||||
if (proxy != null) {
|
||||
|
||||
Reference in New Issue
Block a user