2
Good morning, I need to make a query via REST where multiple ID will be sent for example (ID: 1, ID: 2, ID:3, etc).
To search only for an ID I use findById(codigo)
, but I don’t know how to use multiple data.
As I am using Restfull, how would the URI be separated by multiple data?
What would my appeal look like?
Today I do so(for an ID)
@GetMapping("/{id}")
public ResponseEntity<OBJ> buscarPeloCodigo(@PathVariable Long codigo) {
Optional<OBj> obj = pessoaRepository.findById(codigo);
return obj.isPresent() ? ResponseEntity.ok(obj.get()) : ResponseEntity.notFound().build();
}
and the URI: localhost:8080/data/1
Perfect my dear, thank you very much.
– Ronaldo Lopes