优化接口

结构优化
648540858 2023-12-28 00:15:18 +08:00
parent 5ce562aea1
commit 416dae00bf
2 changed files with 5 additions and 7 deletions

View File

@ -739,7 +739,6 @@ public class SIPCommander implements ISIPCommander {
cmdXml.append("</Control>\r\n");
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);
}

View File

@ -123,8 +123,7 @@ public class DeviceControl {
@Operation(summary = "布防/撤防命令", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
@Parameter(name = "channelId", description = "通道国标编号", required = true)
@Parameter(name = "command", description = "控制命令可选值start布防stop撤防", required = true)
@Parameter(name = "command", description = "控制命令可选值set布防reset撤防", required = true)
@GetMapping("/guard/{deviceId}")
public DeferredResult<String> guardApi(@PathVariable String deviceId, String command) {
if (logger.isDebugEnabled()) {
@ -137,9 +136,9 @@ public class DeviceControl {
String key = DeferredResultHolder.CALLBACK_CMD_DEVICECONTROL + deviceId + deviceId;
String uuid =UUID.randomUUID().toString();
boolean setGuard;
if (command.equalsIgnoreCase("start")) {
if (command.equalsIgnoreCase("set")) {
setGuard = true;
}else if (command.equalsIgnoreCase("stop")) {
}else if (command.equalsIgnoreCase("reset")) {
setGuard = false;
}else {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "command参数不是规定值");