[R2] Pageable default value
This commit is contained in:
parent
bc8a6b3ba2
commit
36b2a47c3f
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.web.PageableDefault;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@ -58,7 +59,7 @@ public class DoctorController {
|
|||||||
* @return A response entity containing the paginated sublist of doctors if successful
|
* @return A response entity containing the paginated sublist of doctors if successful
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResponseEntity<Object> getDoctors(Pageable pageable) {
|
public ResponseEntity<Object> getDoctors(@PageableDefault(size = 10, sort = {"name"}) Pageable pageable) {
|
||||||
|
|
||||||
Page<DoctorPublicDataDTO> doctors = doctorService.findDoctors(pageable);
|
Page<DoctorPublicDataDTO> doctors = doctorService.findDoctors(pageable);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user