It's a simple rest API that has a customer table:
@GetMapping("/customers/region/{code}")
public List<Customer> findByRegionCode(@PathVariable("code") String regionCode) {
return repository.list(
repository.query(Customer.class)
.where(x -> x.getRegionCode()).eq(regionCode)
);
}
The project was created using the Spring Initializr and it was added the fluent query library.
curl http://localhost:8080/customers
[]
curl -X POST -H "Content-Type: application/json" -d '{"name":"Fulano"}' http://localhost:8080/customers
[{"id":1,"name":"Fulano","regionCode":null}]
curl -X PUT -H "Content-Type: application/json" -d '{"name":"Fulano Modificado"}' http://localhost:8080/customers/1
[{"id":1,"name":"Fulano Modificado","regionCode":null}]
curl -X DELETE http://localhost:8080/customers/1