[集群] 增加强制关键帧/看守位控制/拉框放大缩小/设备状态查询
This commit is contained in:
@@ -40,13 +40,25 @@ public interface IRedisRpcService {
|
||||
|
||||
SyncStatus getChannelSyncStatus(String serverId, String deviceId);
|
||||
|
||||
String deviceBasicConfig(String serverId, Device device, String channelId, String name, String expiration, String heartBeatInterval, String heartBeatCount);
|
||||
WVPResult<String> deviceBasicConfig(String serverId, Device device, String channelId, String name, String expiration, String heartBeatInterval, String heartBeatCount);
|
||||
|
||||
String deviceConfigQuery(String serverId, Device device, String channelId, String configType);
|
||||
WVPResult<String> deviceConfigQuery(String serverId, Device device, String channelId, String configType);
|
||||
|
||||
void teleboot(String serverId, Device device);
|
||||
|
||||
String recordControl(String serverId, Device device, String channelId, String recordCmdStr);
|
||||
WVPResult<String> recordControl(String serverId, Device device, String channelId, String recordCmdStr);
|
||||
|
||||
WVPResult<String> guard(String serverId, Device device, String guardCmdStr);
|
||||
|
||||
WVPResult<String> resetAlarm(String serverId, Device device, String channelId, String alarmMethod, String alarmType);
|
||||
|
||||
void iFrame(String serverId, Device device, String channelId);
|
||||
|
||||
WVPResult<String> homePosition(String serverId, Device device, String channelId, Boolean enabled, Integer resetTime, Integer presetIndex);
|
||||
|
||||
void dragZoomIn(String serverId, Device device, String channelId, int length, int width, int midpointx, int midpointy, int lengthx, int lengthy);
|
||||
|
||||
void dragZoomOut(String serverId, Device device, String channelId, int length, int width, int midpointx, int midpointy, int lengthx, int lengthy);
|
||||
|
||||
WVPResult<String> deviceStatus(String serverId, Device device);
|
||||
}
|
||||
|
||||
@@ -107,22 +107,18 @@ public class RedisRpcDeviceController extends RpcController {
|
||||
response.setBody("param error");
|
||||
return response;
|
||||
}
|
||||
DeferredResult<String> deferredResult = deviceService.deviceBasicConfig(device, channelId, name, expiration, heartBeatInterval, heartBeatInterval);
|
||||
DeferredResult<WVPResult<String>> deferredResult = deviceService.deviceBasicConfig(device, channelId, name,
|
||||
expiration, heartBeatInterval, heartBeatInterval);
|
||||
deferredResult.onCompletion(() ->{
|
||||
String resultStr = (String)deferredResult.getResult();
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(resultStr);
|
||||
response.setBody(deferredResult.getResult());
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
deferredResult.onTimeout(() -> {
|
||||
log.warn(String.format("设备配置操作超时, 设备未返回应答指令"));
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("DeviceID", device.getDeviceId());
|
||||
json.put("Status", "Timeout");
|
||||
json.put("Description", "设备配置操作超时, 设备未返回应答指令");
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(json);
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), "操作超时, 设备未应答"));
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
@@ -144,22 +140,17 @@ public class RedisRpcDeviceController extends RpcController {
|
||||
response.setBody("param error");
|
||||
return response;
|
||||
}
|
||||
DeferredResult<String> deferredResult = deviceService.deviceConfigQuery(device, channelId, configType);
|
||||
DeferredResult<WVPResult<String>> deferredResult = deviceService.deviceConfigQuery(device, channelId, configType);
|
||||
deferredResult.onCompletion(() ->{
|
||||
String resultStr = (String)deferredResult.getResult();
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(resultStr);
|
||||
response.setBody(deferredResult.getResult());
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
deferredResult.onTimeout(() -> {
|
||||
log.warn(String.format("设备配置操作超时, 设备未返回应答指令"));
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("DeviceID", device.getDeviceId());
|
||||
json.put("Status", "Timeout");
|
||||
json.put("Description", "设备配置操作超时, 设备未返回应答指令");
|
||||
log.warn("[设备配置]操作超时, 设备未返回应答指令, {}", deviceId);
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(json);
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), "超时"));
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
@@ -182,11 +173,11 @@ public class RedisRpcDeviceController extends RpcController {
|
||||
deviceService.teleboot(device);
|
||||
}catch (ControllerException e) {
|
||||
response.setStatusCode(e.getCode());
|
||||
response.setBody(e.getMsg());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMsg()));
|
||||
return response;
|
||||
}
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(ErrorCode.SUCCESS.getMsg());
|
||||
response.setBody(WVPResult.success());
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -206,28 +197,22 @@ public class RedisRpcDeviceController extends RpcController {
|
||||
return response;
|
||||
}
|
||||
try {
|
||||
DeferredResult<String> deferredResult = deviceService.record(device, channelId, recordCmdStr);
|
||||
DeferredResult<WVPResult<String>> deferredResult = deviceService.record(device, channelId, recordCmdStr);
|
||||
deferredResult.onCompletion(() ->{
|
||||
String resultStr = (String)deferredResult.getResult();
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(resultStr);
|
||||
response.setBody(deferredResult.getResult());
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
deferredResult.onTimeout(() -> {
|
||||
log.warn("设备录像控制操作超时, 设备未返回应答指令");
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("DeviceID", device.getDeviceId());
|
||||
json.put("Status", "Timeout");
|
||||
json.put("Description", "设备录像控制操作超时, 设备未返回应答指令");
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(json);
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), "操作超时, 设备未应答"));
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
}catch (ControllerException e) {
|
||||
response.setStatusCode(e.getCode());
|
||||
response.setBody(e.getMsg());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMsg()));
|
||||
sendResponse(response);
|
||||
}
|
||||
return null;
|
||||
@@ -256,7 +241,7 @@ public class RedisRpcDeviceController extends RpcController {
|
||||
sendResponse(response);
|
||||
});
|
||||
deferredResult.onTimeout(() -> {
|
||||
log.warn("设备录像控制操作超时, 设备未返回应答指令");
|
||||
log.warn("[布防/撤防]操作超时, 设备未返回应答指令");
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), "操作超时, 设备未应答"));
|
||||
// 手动发送结果
|
||||
@@ -264,12 +249,210 @@ public class RedisRpcDeviceController extends RpcController {
|
||||
});
|
||||
}catch (ControllerException e) {
|
||||
response.setStatusCode(e.getCode());
|
||||
response.setBody(e.getMsg());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMsg()));
|
||||
sendResponse(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@RedisRpcMapping("resetAlarm")
|
||||
public RedisRpcResponse resetAlarm(RedisRpcRequest request) {
|
||||
JSONObject paramJson = JSONObject.parseObject(request.getParam().toString());
|
||||
String deviceId = paramJson.getString("deviceId");
|
||||
String channelId = paramJson.getString("channelId");
|
||||
String alarmMethod = paramJson.getString("alarmMethod");
|
||||
String alarmType = paramJson.getString("alarmType");
|
||||
|
||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
if (device == null || !userSetting.getServerId().equals(device.getServerId())) {
|
||||
response.setStatusCode(ErrorCode.ERROR400.getCode());
|
||||
response.setBody("param error");
|
||||
return response;
|
||||
}
|
||||
try {
|
||||
DeferredResult<WVPResult<String>> deferredResult = deviceService.resetAlarm(device, channelId, alarmMethod, alarmType);
|
||||
deferredResult.onCompletion(() ->{
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(deferredResult.getResult());
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
deferredResult.onTimeout(() -> {
|
||||
log.warn("[报警重置] 操作超时, 设备未返回应答指令");
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), "操作超时, 设备未应答"));
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
}catch (ControllerException e) {
|
||||
response.setStatusCode(e.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMsg()));
|
||||
sendResponse(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@RedisRpcMapping("iFrame")
|
||||
public RedisRpcResponse iFrame(RedisRpcRequest request) {
|
||||
JSONObject paramJson = JSONObject.parseObject(request.getParam().toString());
|
||||
String deviceId = paramJson.getString("deviceId");
|
||||
String channelId = paramJson.getString("channelId");
|
||||
|
||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
if (device == null || !userSetting.getServerId().equals(device.getServerId())) {
|
||||
response.setStatusCode(ErrorCode.ERROR400.getCode());
|
||||
response.setBody("param error");
|
||||
return response;
|
||||
}
|
||||
try {
|
||||
deviceService.iFrame(device, channelId);
|
||||
}catch (ControllerException e) {
|
||||
response.setStatusCode(e.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMsg()));
|
||||
sendResponse(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@RedisRpcMapping("homePosition")
|
||||
public RedisRpcResponse homePosition(RedisRpcRequest request) {
|
||||
JSONObject paramJson = JSONObject.parseObject(request.getParam().toString());
|
||||
String deviceId = paramJson.getString("deviceId");
|
||||
String channelId = paramJson.getString("channelId");
|
||||
|
||||
Boolean enabled = paramJson.getBoolean("enabled");
|
||||
Integer resetTime = paramJson.getInteger("resetTime");
|
||||
Integer presetIndex = paramJson.getInteger("presetIndex");
|
||||
|
||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
if (device == null || !userSetting.getServerId().equals(device.getServerId())) {
|
||||
response.setStatusCode(ErrorCode.ERROR400.getCode());
|
||||
response.setBody("param error");
|
||||
return response;
|
||||
}
|
||||
try {
|
||||
DeferredResult<WVPResult<String>> deferredResult = deviceService.homePosition(device, channelId, enabled, resetTime, presetIndex);
|
||||
deferredResult.onCompletion(() ->{
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(deferredResult.getResult());
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
deferredResult.onTimeout(() -> {
|
||||
log.warn("[看守位控制] 操作超时, 设备未返回应答指令");
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), "操作超时, 设备未应答"));
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
}catch (ControllerException e) {
|
||||
response.setStatusCode(e.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMsg()));
|
||||
sendResponse(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@RedisRpcMapping("dragZoomIn")
|
||||
public RedisRpcResponse dragZoomIn(RedisRpcRequest request) {
|
||||
JSONObject paramJson = JSONObject.parseObject(request.getParam().toString());
|
||||
String deviceId = paramJson.getString("deviceId");
|
||||
String channelId = paramJson.getString("channelId");
|
||||
Integer length = paramJson.getInteger("length");
|
||||
Integer width = paramJson.getInteger("width");
|
||||
Integer midpointx = paramJson.getInteger("midpointx");
|
||||
Integer midpointy = paramJson.getInteger("midpointy");
|
||||
Integer lengthx = paramJson.getInteger("lengthx");
|
||||
Integer lengthy = paramJson.getInteger("lengthy");
|
||||
|
||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
if (device == null || !userSetting.getServerId().equals(device.getServerId())) {
|
||||
response.setStatusCode(ErrorCode.ERROR400.getCode());
|
||||
response.setBody("param error");
|
||||
return response;
|
||||
}
|
||||
try {
|
||||
deviceService.dragZoomIn(device, channelId, length, width, midpointx, midpointy, lengthx, lengthy);
|
||||
}catch (ControllerException e) {
|
||||
response.setStatusCode(e.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMsg()));
|
||||
sendResponse(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@RedisRpcMapping("dragZoomOut")
|
||||
public RedisRpcResponse dragZoomOut(RedisRpcRequest request) {
|
||||
JSONObject paramJson = JSONObject.parseObject(request.getParam().toString());
|
||||
String deviceId = paramJson.getString("deviceId");
|
||||
String channelId = paramJson.getString("channelId");
|
||||
Integer length = paramJson.getInteger("length");
|
||||
Integer width = paramJson.getInteger("width");
|
||||
Integer midpointx = paramJson.getInteger("midpointx");
|
||||
Integer midpointy = paramJson.getInteger("midpointy");
|
||||
Integer lengthx = paramJson.getInteger("lengthx");
|
||||
Integer lengthy = paramJson.getInteger("lengthy");
|
||||
|
||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
if (device == null || !userSetting.getServerId().equals(device.getServerId())) {
|
||||
response.setStatusCode(ErrorCode.ERROR400.getCode());
|
||||
response.setBody("param error");
|
||||
return response;
|
||||
}
|
||||
try {
|
||||
deviceService.dragZoomOut(device, channelId, length, width, midpointx, midpointy, lengthx, lengthy);
|
||||
}catch (ControllerException e) {
|
||||
response.setStatusCode(e.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMsg()));
|
||||
sendResponse(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@RedisRpcMapping("deviceStatus")
|
||||
public RedisRpcResponse deviceStatus(RedisRpcRequest request) {
|
||||
String deviceId = request.getParam().toString();
|
||||
|
||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||
|
||||
RedisRpcResponse response = request.getResponse();
|
||||
if (device == null || !userSetting.getServerId().equals(device.getServerId())) {
|
||||
response.setStatusCode(ErrorCode.ERROR400.getCode());
|
||||
response.setBody("param error");
|
||||
return response;
|
||||
}
|
||||
try {
|
||||
DeferredResult<WVPResult<String>> deferredResult = deviceService.deviceStatus(device);
|
||||
deferredResult.onCompletion(() ->{
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(deferredResult.getResult());
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
deferredResult.onTimeout(() -> {
|
||||
log.warn("[获取设备状态] 操作超时, 设备未返回应答指令");
|
||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), "操作超时, 设备未应答"));
|
||||
// 手动发送结果
|
||||
sendResponse(response);
|
||||
});
|
||||
}catch (ControllerException e) {
|
||||
response.setStatusCode(e.getCode());
|
||||
response.setBody(WVPResult.fail(ErrorCode.ERROR100.getCode(), e.getMsg()));
|
||||
sendResponse(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String deviceBasicConfig(String serverId, Device device, String channelId, String name, String expiration,
|
||||
public WVPResult<String> deviceBasicConfig(String serverId, Device device, String channelId, String name, String expiration,
|
||||
String heartBeatInterval, String heartBeatCount) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device", device.getDeviceId());
|
||||
@@ -279,11 +279,11 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||
RedisRpcRequest request = buildRequest("device/deviceBasicConfig", jsonObject);
|
||||
request.setToId(serverId);
|
||||
RedisRpcResponse response = redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
return response.getBody().toString();
|
||||
return JSON.parseObject(response.getBody().toString(), WVPResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String deviceConfigQuery(String serverId, Device device, String channelId, String configType) {
|
||||
public WVPResult<String> deviceConfigQuery(String serverId, Device device, String channelId, String configType) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device", device.getDeviceId());
|
||||
jsonObject.put("channelId", channelId);
|
||||
@@ -291,7 +291,7 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||
RedisRpcRequest request = buildRequest("device/deviceConfigQuery", jsonObject);
|
||||
request.setToId(serverId);
|
||||
RedisRpcResponse response = redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
return response.getBody().toString();
|
||||
return JSON.parseObject(response.getBody().toString(), WVPResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -305,7 +305,7 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String recordControl(String serverId, Device device, String channelId, String recordCmdStr) {
|
||||
public WVPResult<String> recordControl(String serverId, Device device, String channelId, String recordCmdStr) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device", device.getDeviceId());
|
||||
jsonObject.put("channelId", channelId);
|
||||
@@ -313,7 +313,7 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||
RedisRpcRequest request = buildRequest("device/record", jsonObject);
|
||||
request.setToId(serverId);
|
||||
RedisRpcResponse response = redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
return response.getBody().toString();
|
||||
return JSON.parseObject(response.getBody().toString(), WVPResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -326,4 +326,82 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||
RedisRpcResponse response = redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
return JSON.parseObject(response.getBody().toString(), WVPResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WVPResult<String> resetAlarm(String serverId, Device device, String channelId, String alarmMethod, String alarmType) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device", device.getDeviceId());
|
||||
jsonObject.put("channelId", channelId);
|
||||
jsonObject.put("alarmMethod", alarmMethod);
|
||||
jsonObject.put("alarmType", alarmType);
|
||||
RedisRpcRequest request = buildRequest("device/resetAlarm", jsonObject);
|
||||
request.setToId(serverId);
|
||||
RedisRpcResponse response = redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
return JSON.parseObject(response.getBody().toString(), WVPResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void iFrame(String serverId, Device device, String channelId) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device", device.getDeviceId());
|
||||
jsonObject.put("channelId", channelId);
|
||||
RedisRpcRequest request = buildRequest("device/iFrame", jsonObject);
|
||||
request.setToId(serverId);
|
||||
redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WVPResult<String> homePosition(String serverId, Device device, String channelId, Boolean enabled, Integer resetTime, Integer presetIndex) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device", device.getDeviceId());
|
||||
jsonObject.put("channelId", channelId);
|
||||
jsonObject.put("enabled", enabled);
|
||||
jsonObject.put("resetTime", resetTime);
|
||||
jsonObject.put("presetIndex", presetIndex);
|
||||
RedisRpcRequest request = buildRequest("device/homePosition", jsonObject);
|
||||
request.setToId(serverId);
|
||||
RedisRpcResponse response = redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
return JSON.parseObject(response.getBody().toString(), WVPResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragZoomIn(String serverId, Device device, String channelId, int length, int width, int midpointx,
|
||||
int midpointy, int lengthx, int lengthy) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device", device.getDeviceId());
|
||||
jsonObject.put("channelId", channelId);
|
||||
jsonObject.put("length", length);
|
||||
jsonObject.put("width", width);
|
||||
jsonObject.put("midpointx", midpointx);
|
||||
jsonObject.put("midpointy", midpointy);
|
||||
jsonObject.put("lengthx", lengthx);
|
||||
jsonObject.put("lengthy", lengthy);
|
||||
RedisRpcRequest request = buildRequest("device/dragZoomIn", jsonObject);
|
||||
request.setToId(serverId);
|
||||
redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragZoomOut(String serverId, Device device, String channelId, int length, int width, int midpointx, int midpointy, int lengthx, int lengthy) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("device", device.getDeviceId());
|
||||
jsonObject.put("channelId", channelId);
|
||||
jsonObject.put("length", length);
|
||||
jsonObject.put("width", width);
|
||||
jsonObject.put("midpointx", midpointx);
|
||||
jsonObject.put("midpointy", midpointy);
|
||||
jsonObject.put("lengthx", lengthx);
|
||||
jsonObject.put("lengthy", lengthy);
|
||||
RedisRpcRequest request = buildRequest("device/dragZoomOut", jsonObject);
|
||||
request.setToId(serverId);
|
||||
redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WVPResult<String> deviceStatus(String serverId, Device device) {
|
||||
RedisRpcRequest request = buildRequest("device/deviceStatus", device.getDeviceId());
|
||||
request.setToId(serverId);
|
||||
RedisRpcResponse response = redisRpcConfig.request(request, 50, TimeUnit.MILLISECONDS);
|
||||
return JSON.parseObject(response.getBody().toString(), WVPResult.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user