|
@@ -7,6 +7,9 @@ import com.citu.module.menduner.system.controller.base.web.WebContentPageReqVO;
|
|
|
import com.citu.module.menduner.system.controller.base.web.WebContentSaveReqVO;
|
|
|
import com.citu.module.menduner.system.dal.dataobject.web.WebContentDO;
|
|
|
import com.citu.module.menduner.system.dal.mysql.web.WebContentMapper;
|
|
|
+import com.citu.module.menduner.system.dal.redis.RedisKeyConstants;
|
|
|
+import org.springframework.cache.annotation.CacheEvict;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
@@ -37,6 +40,7 @@ public class WebContentServiceImpl implements WebContentService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @CacheEvict(value = RedisKeyConstants.MDE_WEB_CONTENT, key = "#updateReqVO.id")
|
|
|
public void updateWebContent(WebContentSaveReqVO updateReqVO) {
|
|
|
// 校验存在
|
|
|
validateWebContentExists(updateReqVO.getId());
|
|
@@ -46,6 +50,7 @@ public class WebContentServiceImpl implements WebContentService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @CacheEvict(value = RedisKeyConstants.MDE_WEB_CONTENT, key = "#id")
|
|
|
public void deleteWebContent(Long id) {
|
|
|
// 校验存在
|
|
|
validateWebContentExists(id);
|
|
@@ -60,6 +65,8 @@ public class WebContentServiceImpl implements WebContentService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Cacheable(cacheNames = RedisKeyConstants.MDE_WEB_CONTENT+ "#1h", key = "#id",
|
|
|
+ unless = "#result == null")
|
|
|
public WebContentDO getWebContent(Long id) {
|
|
|
return webContentMapper.selectById(id);
|
|
|
}
|