Ejemplo n.º 1
0
 public ResponseEntity<PersonDto> convert(GetPersonResponse response) {
   Person person = response.getPerson();
   if (person == null) {
     return new ResponseEntity<PersonDto>(HttpStatus.NOT_FOUND);
   }
   return new ResponseEntity<PersonDto>(personConverter.convert(person), HttpStatus.OK);
 }
Ejemplo n.º 2
0
 public ResponseEntity<PersonDto> convert(UpdatePersonResponse response) {
   Person person = response.getPerson();
   if (ResponseStatus.ERROR.equals(response.getStatus())) {
     return new ResponseEntity<PersonDto>(HttpStatus.NOT_FOUND);
   }
   if (ResponseStatus.CONFLICT.equals(response.getStatus())) {
     return new ResponseEntity<PersonDto>(HttpStatus.CONFLICT);
   }
   return new ResponseEntity<PersonDto>(personConverter.convert(person), HttpStatus.OK);
 }