|
@@ -212,6 +212,25 @@ public class HomePageDataInfoServiceImpl extends ServiceImpl<HomePageDataInfoMap
|
|
|
return Response.success(map);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 同步数据
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Response synchroData() {
|
|
|
+ //查询全部启用数据
|
|
|
+ List<HomePageDataInfo> dataInfos = homePageDataInfoMapper.selectByMap(new HashMap<String, Object>() {{
|
|
|
+ put("status", 0);
|
|
|
+ }});
|
|
|
+ //删除全部缓存
|
|
|
+ redisTemplate.delete( redisTemplate.keys(Constants.HOME_PAGE_DATA_KEY +"*"));
|
|
|
+ //同步缓存
|
|
|
+ for (HomePageDataInfo dataInfo : dataInfos) {
|
|
|
+ updateHomePageDataRedis(dataInfo);
|
|
|
+ }
|
|
|
+ return Response.success();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 更新首页数据缓存
|