答案缓存管理
| 13 | * 答案缓存管理 |
| 14 | */ |
| 15 | @Component("answerCacheManager") |
| 16 | public class AnswerCacheManager { |
| 17 | @Resource AnswerRepository answerRepository; |
| 18 | |
| 19 | /** |
| 20 | * 查询答案缓存 |
| 21 | * @param answerId 答案Id |
| 22 | */ |
| 23 | @Cacheable(value="answerCacheManager_cache_findByAnswerId",key="#answerId") |
| 24 | public Answer query_cache_findByAnswerId(Long answerId){ |
| 25 | return answerRepository.findByAnswerId(answerId); |
| 26 | } |
| 27 | /** |
| 28 | * 删除答案缓存 |
| 29 | * @param answerId 答案Id |
| 30 | */ |
| 31 | @CacheEvict(value="answerCacheManager_cache_findByAnswerId",key="#answerId") |
| 32 | public void delete_cache_findByAnswerId(Long answerId){ |
| 33 | |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * 查询答案回复缓存 |
| 38 | * @param answerReplyId 答案回复Id |
| 39 | */ |
| 40 | @Cacheable(value="answerCacheManager_cache_findReplyByReplyId",key="#answerReplyId") |
| 41 | public AnswerReply query_cache_findReplyByReplyId(Long answerReplyId){ |
| 42 | return answerRepository.findReplyByReplyId(answerReplyId); |
| 43 | } |
| 44 | /** |
| 45 | * 删除答案回复缓存 |
| 46 | * @param answerReplyId 答案回复Id |
| 47 | */ |
| 48 | @CacheEvict(value="answerCacheManager_cache_findReplyByReplyId",key="#answerReplyId") |
| 49 | public void delete_cache_findReplyByReplyId(Long answerReplyId){ |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * 查询缓存 查询回答数量 |
| 54 | * @param userName 用户名称 |
| 55 | * @return |
| 56 | */ |
| 57 | @Cacheable(value="answerCacheManager_cache_answerCount",key="#userName") |
| 58 | public Long query_cache_answerCount(String userName){ |
| 59 | |
| 60 | return answerRepository.findAnswerCountByUserName(userName); |
| 61 | } |
| 62 | /** |
| 63 | * 删除缓存 查询回答数量 |
| 64 | * @param userName 用户名称 |
| 65 | * @return |
| 66 | */ |
| 67 | @CacheEvict(value="answerCacheManager_cache_answerCount",key="#userName") |
| 68 | public void delete_cache_answerCount(String userName){ |
| 69 | } |
| 70 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…