Hamdam23/bookee

Implement pagination in 'Get list of entities' requests

Closed this issue · 3 comments

Implement pagination in 'Get list of entities' requests

image

Let's talk about what should I return on response.
If response details on the picture is fine, I'll implement the logic to entire project.

An interesting repo:
https://github.com/bezkoder/spring-boot-jpa-paging-sorting

Let's talk about what should I return on response. If response details on the picture is fine, I'll implement the logic to entire project.

I think it's ok, but I suggest removing separate 'pageable' JSON object for page details. You can write page details directly on parent JSON object:

{
    "items": [ ],
    "page": 3,
    "next_page": 4,
    "prev_page": 2,
    "total_items": 47,
    "total_pages" : 5,
    "page_size": 10
}

Test implementation is done on 65cf27a for Book API, and will be added to the whole project.