@PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(value = "/{id}/handle", method = RequestMethod.GET) public @ResponseBody boolean handle(@PathVariable("id") Long id) { try { interfaceReportService.setHandled(id); return true; } catch (Exception ex) { return false; } }
@PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping(method = RequestMethod.GET) public String findAll(ModelMap map) { map.put( "reports", interfaceReportService .findAll() .stream() .map(InterfaceReportListDto::create) .collect(Collectors.toList())); return REPORTS_PAGE; }
@RequestMapping(value = "/create", method = POST) public @ResponseBody boolean createReport( @RequestBody CreateInterfaceReportDto createInterfaceReportDto) { interfaceReportService.createReport(createInterfaceReportDto); return true; }
@PreAuthorize("hasRole('ROLE_ADMIN')") @RequestMapping("/{id}") public @ResponseBody InterfaceReportListDto findOne(@PathVariable("id") Long id) { return InterfaceReportListDto.create(interfaceReportService.findOne(id)); }