Created
November 16, 2020 13:47
-
-
Save GuilhermeManzano/2a80ddf5862e67dea010654dbd0d21d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GetMapping("/{id}") | |
public ResponseEntity get(@PathVariable("id") Long id) { | |
Optional<Carro> carro = service.getCarroById(id); | |
if(carro.isPresent()) { | |
return ResponseEntity.ok(carro.get()); | |
} else { | |
return ResponseEntity.notFound().build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment