优化接口

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

View File

@ -738,7 +738,6 @@ public class SIPCommander implements ISIPCommander {
cmdXml.append("<TeleBoot>Boot</TeleBoot>\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()));
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request);

View File

@ -70,7 +70,7 @@ public class DeviceControl {
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
@Parameter(name = "channelId", description = "通道国标编号", required = true)
@Parameter(name = "command", description = "控制命令可选值start手动录像stop停止手动录像", required = true)
@GetMapping("/record/{deviceId}/{channelId}")
@GetMapping("/record/{deviceId}/{channelId}")
public DeferredResult<ResponseEntity<String>> recordApi(@PathVariable String deviceId,
@PathVariable String channelId,
String command) {
@ -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参数不是规定值");
@ -185,7 +184,7 @@ public class DeviceControl {
@GetMapping("/reset_alarm/{deviceId}")
public DeferredResult<ResponseEntity<String>> resetAlarmApi(@PathVariable String deviceId,
@RequestParam(required = false) Integer alarmMethod,
@RequestParam(required = false) Integer alarmType) {
@RequestParam(required = false) Integer alarmType) {
if (logger.isDebugEnabled()) {
logger.debug("报警复位API调用");
}