|
@@ -222,6 +222,19 @@ public class HomePageDataInfoServiceImpl extends ServiceImpl<HomePageDataInfoMap
|
|
|
FileInfo fileInfo = fileInfoService.getById(homePageDataInfo.getFileId());
|
|
|
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(homePageDataInfo));
|
|
|
jsonObject.put("fileUrl",fileInfo.getFileUrl());
|
|
|
+
|
|
|
+ if (homePageDataInfo.getId()!=null){
|
|
|
+ //判断类型 删除缓存
|
|
|
+ if (redisTemplate.hasKey(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.CAROUSElCHART.getDataType()+":"+homePageDataInfo.getId())){
|
|
|
+ redisTemplate.delete(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.CAROUSElCHART.getDataType() + ":" + homePageDataInfo.getId());
|
|
|
+ }
|
|
|
+ if (redisTemplate.hasKey(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.COUPON.getDataType()+":"+homePageDataInfo.getId())){
|
|
|
+ redisTemplate.delete(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.COUPON.getDataType() + ":" + homePageDataInfo.getId());
|
|
|
+ }
|
|
|
+ if (redisTemplate.hasKey(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.MENU.getDataType()+":"+homePageDataInfo.getId())){
|
|
|
+ redisTemplate.delete(Constants.HOME_PAGE_DATA_KEY + HomePageDataType.MENU.getDataType() + ":" + homePageDataInfo.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
//同时更新缓存(根据type拼接)
|
|
|
redisTemplate.opsForValue().set(Constants.HOME_PAGE_DATA_KEY +homePageDataInfo.getDataType()+":"+ homePageDataInfo.getId(),JSONObject.toJSONString(jsonObject));
|
|
|
}
|