优化接口
parent
5ce562aea1
commit
416dae00bf
|
@ -739,7 +739,6 @@ public class SIPCommander implements ISIPCommander {
|
||||||
cmdXml.append("</Control>\r\n");
|
cmdXml.append("</Control>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()));
|
Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()));
|
||||||
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request);
|
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,8 +123,7 @@ public class DeviceControl {
|
||||||
|
|
||||||
@Operation(summary = "布防/撤防命令", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "布防/撤防命令", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||||
@Parameter(name = "channelId", description = "通道国标编号", required = true)
|
@Parameter(name = "command", description = "控制命令,可选值:set(布防),reset(撤防)", required = true)
|
||||||
@Parameter(name = "command", description = "控制命令,可选值:start(布防),stop(撤防)", required = true)
|
|
||||||
@GetMapping("/guard/{deviceId}")
|
@GetMapping("/guard/{deviceId}")
|
||||||
public DeferredResult<String> guardApi(@PathVariable String deviceId, String command) {
|
public DeferredResult<String> guardApi(@PathVariable String deviceId, String command) {
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
|
@ -137,9 +136,9 @@ public class DeviceControl {
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + deviceId + deviceId;
|
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + deviceId + deviceId;
|
||||||
String uuid =UUID.randomUUID().toString();
|
String uuid =UUID.randomUUID().toString();
|
||||||
boolean setGuard;
|
boolean setGuard;
|
||||||
if (command.equalsIgnoreCase("start")) {
|
if (command.equalsIgnoreCase("set")) {
|
||||||
setGuard = true;
|
setGuard = true;
|
||||||
}else if (command.equalsIgnoreCase("stop")) {
|
}else if (command.equalsIgnoreCase("reset")) {
|
||||||
setGuard = false;
|
setGuard = false;
|
||||||
}else {
|
}else {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "command参数不是规定值");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "command参数不是规定值");
|
||||||
|
|
Loading…
Reference in New Issue