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

Commit ac54e7e6 authored by GaoHu's avatar GaoHu

演出预告列表降级查询

parent 5b988a74
...@@ -526,6 +526,19 @@ public class DataUtils { ...@@ -526,6 +526,19 @@ public class DataUtils {
Object obj = redisUtil.get(key + id); Object obj = redisUtil.get(key + id);
if (obj != null) { if (obj != null) {
toDayList.add((KylinPerformanceVo) obj); toDayList.add((KylinPerformanceVo) obj);
}else {
Query query = new Query();
query.fields().exclude("details");
query.fields().exclude("noticeImage");
query.fields().exclude("ticketTimeList");
query.fields().exclude("describeElectronic");
query.addCriteria(Criteria.where("performancesId").is(id));
KylinPerformanceVo one = mongoTemplate.findOne(query, KylinPerformanceVo.class, KylinPerformanceVo.class.getSimpleName());
if (one!=null){
//增加redis缓存
redisUtil.set(key + id,one);
toDayList.add(one);
}
} }
}); });
//查询mongodb //查询mongodb
......
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