评论缓存管理
| 12 | * 评论缓存管理 |
| 13 | */ |
| 14 | @Component("commentCacheManager") |
| 15 | public class CommentCacheManager { |
| 16 | @Resource CommentRepository commentRepository; |
| 17 | |
| 18 | |
| 19 | /** |
| 20 | * 查询评论缓存 |
| 21 | * @param commentId 评论Id |
| 22 | */ |
| 23 | @Cacheable(value="commentCacheManager_cache_findByCommentId",key="#commentId") |
| 24 | public Comment query_cache_findByCommentId(Long commentId){ |
| 25 | return commentRepository.findByCommentId(commentId); |
| 26 | } |
| 27 | /** |
| 28 | * 删除评论缓存 |
| 29 | * @param commentId 评论Id |
| 30 | */ |
| 31 | @CacheEvict(value="commentCacheManager_cache_findByCommentId",key="#commentId") |
| 32 | public void delete_cache_findByCommentId(Long commentId){ |
| 33 | |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * 查询回复缓存 |
| 38 | * @param replyId 回复Id |
| 39 | */ |
| 40 | @Cacheable(value="commentCacheManager_cache_findReplyByReplyId",key="#replyId") |
| 41 | public Reply query_cache_findReplyByReplyId(Long replyId){ |
| 42 | return commentRepository.findReplyByReplyId(replyId); |
| 43 | } |
| 44 | /** |
| 45 | * 删除回复缓存 |
| 46 | * @param replyId 回复Id |
| 47 | */ |
| 48 | @CacheEvict(value="commentCacheManager_cache_findReplyByReplyId",key="#replyId") |
| 49 | public void delete_cache_findReplyByReplyId(Long replyId){ |
| 50 | } |
| 51 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…