use of com.bigcrowd.noticeBoard.services.exceptions.ControllerNotFoundException in project Notice-Board by FulvioFPimentel.
the class SupportController method save.
@PostMapping
public ResponseEntity<SupportDTO> save(@RequestBody SupportSaveDTO dto) {
try {
SupportDTO entity = supportService.saveSupport(dto);
URI uri = ServletUriComponentsBuilder.fromCurrentRequest().path("/{id}").buildAndExpand(entity.getId()).toUri();
return ResponseEntity.created(uri).body(entity);
} catch (RuntimeException e) {
throw new ControllerNotFoundException("Not Found");
}
}
Aggregations