Browse Source

replace to PageRequest.of

deason 4 years ago
parent
commit
e268bda6cd

+ 1 - 1
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/bean/coursestatistic/CourseStatisticConvert.java

@@ -48,7 +48,7 @@ public class CourseStatisticConvert {
     }
 
     public static Page<CourseStatisticInfo> ofPage(Page<CourseStatistic> page) {
-        Pageable pageable = new PageRequest(page.getNumber(), page.getSize());
+        Pageable pageable = PageRequest.of(page.getNumber(), page.getSize());
         List<CourseStatistic> entities = page.getContent();
         if (entities == null || entities.isEmpty()) {
             return new PageImpl<>(Lists.newArrayList(), pageable, page.getTotalElements());

+ 1 - 1
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/bean/examstructure/ExamStructureConvert.java

@@ -39,7 +39,7 @@ public class ExamStructureConvert {
     }
 
     public static Page<ExamStructureInfo> ofPage(Page<ExamStructure> page) {
-        Pageable pageable = new PageRequest(page.getNumber(), page.getSize());
+        Pageable pageable = PageRequest.of(page.getNumber(), page.getSize());
         List<ExamStructure> entities = page.getContent();
         if (entities == null || entities.isEmpty()) {
             return new PageImpl<>(Lists.newArrayList(), pageable, page.getTotalElements());

+ 1 - 1
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/bean/printingproject/PrintingProjectConvert.java

@@ -37,7 +37,7 @@ public class PrintingProjectConvert {
     }
 
     public static Page<PrintingProjectInfo> ofPage(Page<PrintingProject> page) {
-        Pageable pageable = new PageRequest(page.getNumber(), page.getSize());
+        Pageable pageable = PageRequest.of(page.getNumber(), page.getSize());
         List<PrintingProject> entities = page.getContent();
         if (entities == null || entities.isEmpty()) {
             return new PageImpl<>(Lists.newArrayList(), pageable, page.getTotalElements());