Kaynağa Gözat

fix Sort.by

deason 4 yıl önce
ebeveyn
işleme
beb1cbdc3d

+ 2 - 2
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/PaperStructService.java

@@ -85,7 +85,7 @@ public class PaperStructService {
         }
 
         long count = this.mongoTemplate.count(query, PaperStruct.class);
-        query.with(Sort.by(Sort.by.Order(Sort.Direction.DESC, "createTime")));
+        query.with(Sort.by(Sort.Order.desc("createTime")));
         query.limit(pageSize);
         query.skip((curPage - 1L) * pageSize);
 
@@ -120,7 +120,7 @@ public class PaperStructService {
                     .in("", searchInfo.getCourseNo()));
         }
         query.addCriteria(Criteria.where("orgId").is(searchInfo.getOrgId()));
-        query.with(Sort.by(Sort.by.Order(Sort.Direction.DESC, "createTime")));
+        query.with(Sort.by(Sort.Order.desc("createTime")));
         List<PaperStruct> paperList = this.mongoTemplate.find(query, PaperStruct.class);
         return paperList;
     }