|
@@ -74,24 +74,26 @@ public class GBRecordController {
|
|
|
@GetMapping("/query/{deviceId}/{channelId}")
|
|
|
public DeferredResult<WVPResult<RecordInfo>> recordinfo(@PathVariable String deviceId, @PathVariable String channelId, String startTime, String endTime) {
|
|
|
|
|
|
- logger.info("[设备录像查询] {}-{}", deviceId, channelId);
|
|
|
- Device device = deviceHelper.getDevice(deviceId, null);
|
|
|
- DeferredResult<WVPResult<RecordInfo>> result = new DeferredResult<>();
|
|
|
- if (device == null) {
|
|
|
- // 无权限
|
|
|
- result.setResult(WVPResult.fail(ErrorCode.ERROR403, "无法操控此设备"));
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- // 时间转换
|
|
|
- if (!DateUtil.verification(startTime, DateUtil.formatter)) {
|
|
|
- result.setResult(
|
|
|
- WVPResult.fail(ErrorCode.ERROR100, "startTime error, format is " + DateUtil.PATTERN)
|
|
|
- );
|
|
|
- return result;
|
|
|
- }
|
|
|
- if (!DateUtil.verification(endTime, DateUtil.formatter)) {
|
|
|
- result.setResult(
|
|
|
+ logger.info("[设备录像查询] {}-{}", deviceId, channelId);
|
|
|
+ Device device = deviceHelper.getDevice(deviceId, null);
|
|
|
+ DeferredResult<WVPResult<RecordInfo>> result = new DeferredResult<>();
|
|
|
+ if (device == null) {
|
|
|
+ // 无权限
|
|
|
+ result.setResult(WVPResult.fail(ErrorCode.ERROR403, "无法操控此设备"));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ // 适应旧api, 用于sip异步交互 key
|
|
|
+ deviceId = device.getDeviceId();
|
|
|
+
|
|
|
+ // 时间转换
|
|
|
+ if (!DateUtil.verification(startTime, DateUtil.formatter)) {
|
|
|
+ result.setResult(
|
|
|
+ WVPResult.fail(ErrorCode.ERROR100, "startTime error, format is " + DateUtil.PATTERN)
|
|
|
+ );
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ if (!DateUtil.verification(endTime, DateUtil.formatter)) {
|
|
|
+ result.setResult(
|
|
|
WVPResult.fail(ErrorCode.ERROR100, "endTime error, format is " + DateUtil.PATTERN)
|
|
|
);
|
|
|
return result;
|