Ich weiß, dass die Pageable
von spring-data-
Domain kommt.Wie kann ich die Umlagerungsfunktion in @RestController verwenden?
Gibt es eine elegante Möglichkeit, org.springframework.data.domain.Pageable
in @RestController
direkt zu verwenden?
Ich versuchte folgendes.
@RequestMapping(method = RequestMethod.GET,
path = "pageable",
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Pageable> readPageable(@NotNull final Pageable pageable) {
return ResponseEntity.ok(pageable);
}
Das Ergebnis ist nicht das, was ich erwartet habe.
...: ~ $ curl -X GET --header 'Accept: application/json' 'http://localhost:8080/.../pageable?limit=1&offset=1' | python -mjson.tool
...
{
"offset": 0,
"pageNumber": 0,
"pageSize": 20,
"sort": null
}
welche Antwort möchten Sie? –