+
+ public ResponseEntity<UIDevice> getDevice(@RequestParam(value = "id") Long id) {
+ log.debug("UI request: {}", "get device");
+ Device device = deviceService.findOne(id);
+ UIDevice uiDevice = UIDevice.builder()
+ .id(device.getId())
+ .duid(device.getDuid())
+ .ctime(device.getCtime())
+ .model(device.getModel())
+ .ipaddr(device.getIpaddr())
+ .sn(device.getSn())
+ .descr(device.getDescr())
+ .locked(device.getLocked()!=null && !device.getLocked().equals("0") ? 1:0)
+ .uiDeviceOS(new UIDevice.UIDeviceOS(device.getSw(), device.getOsname(), device.getOsver()))
+ .uiDeviceType(new UIDevice.UIDeviceType(device.getDtype().getName(), device.getDtype().getDescr()))
+ .geoIP(geoIPService.getGeo(device.getIpaddr()))
+ .build();
+
+ final HttpHeaders httpHeaders = new HttpHeaders();
+ httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
+ return new ResponseEntity<>(uiDevice , httpHeaders, HttpStatus.OK);
+ }
+