添加回放控制界面,优化录像查询接口

This commit is contained in:
648540858
2021-11-24 18:42:54 +08:00
parent 88d5b106cf
commit d87ff7bf4d
4 changed files with 295 additions and 8 deletions

View File

@@ -56,17 +56,21 @@ public class GBRecordController {
}
Device device = storager.queryVideoDevice(deviceId);
cmder.recordInfoQuery(device, channelId, startTime, endTime);
// 指定超时时间 1分钟30秒
DeferredResult<ResponseEntity<RecordInfo>> result = new DeferredResult<>(90*1000L);
String uuid = UUID.randomUUID().toString();
String key = DeferredResultHolder.CALLBACK_CMD_RECORDINFO + deviceId + channelId;
RequestMessage msg = new RequestMessage();
msg.setId(uuid);
msg.setKey(key);
cmder.recordInfoQuery(device, channelId, startTime, endTime, (eventResult -> {
msg.setData("查询录像失败, status: " + eventResult.statusCode + ", message: " + eventResult.msg );
resultHolder.invokeResult(msg);
}));
// 录像查询以channelId作为deviceId查询
resultHolder.put(key, uuid, result);
result.onTimeout(()->{
RequestMessage msg = new RequestMessage();
msg.setId(uuid);
msg.setKey(key);
msg.setData("timeout");
resultHolder.invokeResult(msg);
});