deason 4 vuotta sitten
vanhempi
commit
0de0459a83

+ 2 - 2
examcloud-core-oe-admin-api-provider/src/main/java/cn/com/qmth/examcloud/core/oe/admin/api/controller/IllegallyTypeController.java

@@ -197,8 +197,8 @@ public class IllegallyTypeController extends ControllerSupport {
         }
 
         List<Sort.Order> orderList = new ArrayList<>();
-        orderList.add(Sort.by.Order(Direction.DESC, "dataCategory"));
-        orderList.add(Sort.by.Order(Direction.ASC, "id"));
+        orderList.add(Sort.Order.desc("dataCategory"));
+        orderList.add(Sort.Order.asc("id"));
 
         List<IllegallyTypeEntity> list = illegallyTypeRepo.findAll(specification,
                 Sort.by(orderList));

+ 5 - 1
examcloud-core-oe-admin-base/src/main/java/cn/com/qmth/examcloud/core/oe/admin/base/jpa/Order.java

@@ -42,7 +42,11 @@ public class Order implements Serializable {
         }
         List<Sort.Order> list = new ArrayList<>();
         for (Order order : orders) {
-            list.add(Sort.by.Order(order.getDirection(), order.getFieldName()));
+            if(order.getDirection().isAscending()){
+                list.add(Sort.Order.asc(order.getFieldName()));
+            }else {
+                list.add(Sort.Order.desc(order.getFieldName()));
+            }
         }
         return Sort.by(list);
     }