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

Commit d9b6af94 authored by anjiabin's avatar anjiabin

社交增加喜欢和不喜欢计数

parent 4de40f04
......@@ -18,5 +18,8 @@ liquidnet:
level-root: debug
mysql:
database-name: test_ln_scene
mongodb:
sslEnabled: false
database: test_ln_scene
#以下为spring各环境个性配置
......@@ -92,9 +92,16 @@ public class ChimePerformanceServiceImpl implements IChimePerformanceService {
Pageable pageable = PageRequest.of(pageNum, pageSize); // get 5 profiles on a page
Query query = Query.query(criteria);
query.with(pageable);
query.with(Sort.by( //根据集合中对象的某个字段排序
Sort.Order.desc("createdAt")
));
//多列排序
List<Sort.Order> orderList = new ArrayList<Sort.Order>();
Sort.Order likeCountOrder = new Sort.Order(Sort.Direction.DESC, "likeCount");
Sort.Order disLikeCountOrder = new Sort.Order(Sort.Direction.ASC, "disLikeCount");
orderList.add(likeCountOrder);
orderList.add(disLikeCountOrder);
query.with(Sort.by(orderList));
// query.with(Sort.by( //根据集合中对象的某个字段排序
// Sort.Order.desc("createdAt")
// ));
startTime = System.currentTimeMillis();
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