Git-Leon bb06ee7e09 Update README.md | hace 7 años | |
---|---|---|
src | hace 7 años | |
.gitignore | hace 7 años | |
README.md | hace 7 años | |
pom.xml | hace 7 años |
-
GET
method resembling the following:
http://blog.example.com/posts?page=3
-
http://blog.example.com/posts?page=3&size=20
-
-
JSON
object below.{
"data": [
... Blog Data
],
"totalPages": 9,
"currentPageNumber": 2,
"pageSize": 10,
"totalRecords": 90
}
-
Create a src/main/resource/import.sql
file with DML statements for populating the database upon bootstrap. The import.sql
should insert at least 15 polls, each with 3 or more options.
Below is an example of SQL
statements for creating a single poll with only one option.
Poll Creation
insert into poll (poll_id, question) values (1, 'What is your favorite color?');
Option Creation
insert into option (option_id, option_value, poll_id) values (1, 'Red', 1);
Restart your application.
Use Postman to ensure database is populated by import.sql
.
org.springframework.data.repository.PagingAndSortingRepository
.Controller
methods to handle Pageable
arguments.GET
request to http://localhost:8080/polls?page=0&size=2
via Postman.
JSON
object with pagination-specific information.