| | |
| | | @ApiOperation("设备列表") |
| | | @PreAuthorize("@ss.hasPermi('device:dock:list')") |
| | | @GetMapping("/list") |
| | | public ResponseResult<List<DeviceDTO>> getDevices() { |
| | | public ResponseResult<List<DeviceDTO>> getDevices(@RequestParam(required = false) String nickname) { |
| | | // List<DeviceDTO> devicesList = deviceService.getDevicesTopoForWeb(); |
| | | List<DeviceDTO> devicesList = deviceService.getDockList(); |
| | | List<DeviceDTO> devicesList = deviceService.getDockList(nickname); |
| | | return ResponseResult.success(devicesList); |
| | | } |
| | | |
| | | // /** |
| | | // * 获取按nickname筛选在线设备列表 |
| | | // * |
| | | // * @return |
| | | // */ |
| | | // @ApiOperation("设备列表-按nickname筛选") |
| | | // @GetMapping("/cameralist") |
| | | // public ResponseResult<List<DeviceDTO>> getCameraDevices(@RequestParam(required = false) String nickname) { |
| | | // List<DeviceDTO> devicesList = deviceService.getDockCameraList(nickname); |
| | | // return ResponseResult.success(devicesList); |
| | | // } |
| | | |
| | | /** |
| | | * 绑定设备 |
| | |
| | | public ResponseResult devicePropertySet(@PathVariable("device_sn") String dockSn, |
| | | @RequestBody JsonNode param) { |
| | | if (param.size() != 1) { |
| | | return ResponseResult.error(CommonErrorEnum.ILLEGAL_ARGUMENT); |
| | | //return ResponseResult.error(CommonErrorEnum.ILLEGAL_ARGUMENT); |
| | | return ResponseResult.error(999,"参数不合法"); |
| | | } |
| | | String property = param.fieldNames().next(); |
| | | Optional<DeviceSetPropertyEnum> propertyEnumOpt = DeviceSetPropertyEnum.find(property); |
| | | if (propertyEnumOpt.isEmpty()) { |
| | | return ResponseResult.error(CommonErrorEnum.ILLEGAL_ARGUMENT); |
| | | //return ResponseResult.error(CommonErrorEnum.ILLEGAL_ARGUMENT); |
| | | return ResponseResult.error(999,"参数无效"); |
| | | } |
| | | deviceService.devicePropertySet(dockSn, propertyEnumOpt.get(), param); |
| | | return ResponseResult.success(); |
| | | return deviceService.devicePropertySet(dockSn, propertyEnumOpt.get(), param); |
| | | // return ResponseResult.success(); |
| | | } |
| | | |
| | | //.get(property) |
| | |
| | | .workType(dto.getWorkType()) |
| | | .webrtcUrl(dto.getWebrtcUrl()) |
| | | .cameraWebrtcUrl(dto.getCameraWebrtcUrl()) |
| | | .cameraState(dto.getCameraState()) |
| | | .compatibleStatus(dto.getFirmwareStatus() == null ? null : |
| | | DeviceFirmwareStatusEnum.CONSISTENT_UPGRADE != DeviceFirmwareStatusEnum.find(dto.getFirmwareStatus())) |
| | | .build(); |