Skip to content

Instantly share code, notes, and snippets.

@danirod
Created July 24, 2023 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danirod/f420586f82a2ee17072258fc322ae291 to your computer and use it in GitHub Desktop.
Save danirod/f420586f82a2ee17072258fc322ae291 to your computer and use it in GitHub Desktop.
Ejemplo de respuesta paginada. Este código tiene que ver con las notas del episodio de este tutorial de Quarkus: https://www.makigas.es/series/acceso-a-datos-con-quarkus/paginacion-de-resultados. El vídeo puede verse aquí: https://www.youtube.com/watch?v=itWumBxloo8
public record PaginatedResponse<E>(int currentPage, int totalPages, List<E> data) {
public PaginatedResponse(PanacheQuery<E> query) {
this(query.page().index + 1, query.pageCount(), query.list());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment