记得上下班打卡 | git大法好,push需谨慎

Commit 03778213 authored by anjiabin's avatar anjiabin

提交chime社交相关-修改排序

parent b71733aa
...@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
...@@ -90,6 +91,9 @@ public class ChimePerformanceServiceImpl implements IChimePerformanceService { ...@@ -90,6 +91,9 @@ public class ChimePerformanceServiceImpl implements IChimePerformanceService {
Pageable pageable = PageRequest.of(pageNum, pageSize); // get 5 profiles on a page Pageable pageable = PageRequest.of(pageNum, pageSize); // get 5 profiles on a page
Query query = Query.query(criteria); Query query = Query.query(criteria);
query.with(pageable); query.with(pageable);
query.with(Sort.by( //根据集合中对象的某个字段排序
Sort.Order.desc("createdAt")
));
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
List<ChimeUserInfoVo> chimeUserInfoVoList = mongoTemplate.find(query, ChimeUserInfoVo.class, ChimeUserInfoVo.class.getSimpleName()); List<ChimeUserInfoVo> chimeUserInfoVoList = mongoTemplate.find(query, ChimeUserInfoVo.class, ChimeUserInfoVo.class.getSimpleName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment