Created
July 24, 2023 19:38
-
-
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
This file contains 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
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