| | |
| | | @Operation(summary = "远程启动控制命令") |
| | | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| | | @GetMapping("/teleboot/{deviceId}") |
| | | public String teleBootApi(@PathVariable String deviceId) { |
| | | public void teleBootApi(@PathVariable String deviceId) { |
| | | if (logger.isDebugEnabled()) { |
| | | logger.debug("设备远程启动API调用"); |
| | | } |
| | | Device device = storager.queryVideoDevice(deviceId); |
| | | boolean sucsess = cmder.teleBootCmd(device); |
| | | if (sucsess) { |
| | | JSONObject json = new JSONObject(); |
| | | json.put("DeviceID", deviceId); |
| | | json.put("Result", "OK"); |
| | | return json.toJSONString(); |
| | | } else { |
| | | logger.warn("设备远程启动API调用失败!"); |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "设备远程启动API调用失败!"); |
| | | if (!cmder.teleBootCmd(device)) { |
| | | logger.warn("设备远程启动API调用失败!"); |
| | | throw new ControllerException(ErrorCode.ERROR100); |
| | | } |
| | | } |
| | | |