优化录像查询,优化注释
This commit is contained in:
@@ -29,15 +29,14 @@ public class PtzController {
|
||||
private IVideoManagerStorager storager;
|
||||
|
||||
/***
|
||||
* http://localhost:8080/api/ptz/34020000001320000002_34020000001320000008?leftRight=1&upDown=0&inOut=0&moveSpeed=50&zoomSpeed=0
|
||||
* @param deviceId
|
||||
* @param channelId
|
||||
* @param leftRight
|
||||
* @param upDown
|
||||
* @param inOut
|
||||
* @param moveSpeed
|
||||
* @param zoomSpeed
|
||||
* @return
|
||||
* 云台控制
|
||||
* @param deviceId 设备id
|
||||
* @param channelId 通道id
|
||||
* @param cmdCode 指令码
|
||||
* @param horizonSpeed 水平移动速度
|
||||
* @param verticalSpeed 垂直移动速度
|
||||
* @param zoomSpeed 缩放速度
|
||||
* @return String 控制结果
|
||||
*/
|
||||
@PostMapping("/ptz/{deviceId}/{channelId}")
|
||||
public ResponseEntity<String> ptz(@PathVariable String deviceId,@PathVariable String channelId,int cmdCode, int horizonSpeed, int verticalSpeed, int zoomSpeed){
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.genersoft.iot.vmp.vmanager.record;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -32,7 +33,7 @@ public class RecordController {
|
||||
|
||||
@Autowired
|
||||
private DeferredResultHolder resultHolder;
|
||||
|
||||
|
||||
@GetMapping("/record/{deviceId}/{channelId}")
|
||||
public DeferredResult<ResponseEntity<RecordInfo>> recordinfo(@PathVariable String deviceId,@PathVariable String channelId, String startTime, String endTime){
|
||||
|
||||
@@ -42,9 +43,17 @@ public class RecordController {
|
||||
|
||||
Device device = storager.queryVideoDevice(deviceId);
|
||||
cmder.recordInfoQuery(device, channelId, startTime, endTime);
|
||||
DeferredResult<ResponseEntity<RecordInfo>> result = new DeferredResult<ResponseEntity<RecordInfo>>();
|
||||
// 指定超时时间 1分钟30秒
|
||||
DeferredResult<ResponseEntity<RecordInfo>> result = new DeferredResult<ResponseEntity<RecordInfo>>(90*1000L);
|
||||
// 录像查询以channelId作为deviceId查询
|
||||
resultHolder.put(DeferredResultHolder.CALLBACK_CMD_RECORDINFO+channelId, result);
|
||||
result.onTimeout(()->{
|
||||
RequestMessage msg = new RequestMessage();
|
||||
msg.setDeviceId(deviceId);
|
||||
msg.setType(DeferredResultHolder.CALLBACK_CMD_RECORDINFO);
|
||||
msg.setData("timeout");
|
||||
resultHolder.invokeResult(msg);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user