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

Commit ee0e0f3d authored by GaoHu's avatar GaoHu

修改初始化条件

parent 1d44c602
...@@ -162,6 +162,9 @@ public class SmileSchoolServiceImpl extends ServiceImpl<SmileSchoolMapper, Smile ...@@ -162,6 +162,9 @@ public class SmileSchoolServiceImpl extends ServiceImpl<SmileSchoolMapper, Smile
*/ */
@PostConstruct @PostConstruct
private void updateRedisSchoolAll(){ private void updateRedisSchoolAll(){
Query query = new Query();
long count = mongoTemplate.count(query, SmileSchoolVo.class.getSimpleName());
if (count==0){
//删除旧redisSchoolAll缓存 //删除旧redisSchoolAll缓存
smileRedisUtils.delSchoolAll(); smileRedisUtils.delSchoolAll();
//跟新缓存 //跟新缓存
...@@ -169,6 +172,7 @@ public class SmileSchoolServiceImpl extends ServiceImpl<SmileSchoolMapper, Smile ...@@ -169,6 +172,7 @@ public class SmileSchoolServiceImpl extends ServiceImpl<SmileSchoolMapper, Smile
//mongodb初始化就数据 //mongodb初始化就数据
saveSmileSchoolMongodb(); saveSmileSchoolMongodb();
} }
}
} }
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