验证码缓存管理
| 9 | * 验证码缓存管理 |
| 10 | */ |
| 11 | @Component("captchaCacheManager") |
| 12 | public class CaptchaCacheManager { |
| 13 | |
| 14 | /** |
| 15 | * 生成验证码 |
| 16 | * @param captchaKey 验证码KEY |
| 17 | * @param captcha 验证码 |
| 18 | * @return |
| 19 | */ |
| 20 | @CachePut(value="captchaCacheManager_cache_captcha",key="#captchaKey") |
| 21 | public String saveCaptcha(String captchaKey,String captcha){ |
| 22 | return captcha; |
| 23 | } |
| 24 | /** |
| 25 | * 查询验证码 |
| 26 | * 使用 @Cacheable:缓存存在则返回,不存在则执行方法(返回null) |
| 27 | */ |
| 28 | @Cacheable(value="captchaCacheManager_cache_captcha", key="#captchaKey") |
| 29 | public String getCaptcha(String captchaKey) { |
| 30 | return null; |
| 31 | } |
| 32 | /** |
| 33 | * 删除验证码 |
| 34 | * @param captchaKey 验证码KEY |
| 35 | * @return |
| 36 | */ |
| 37 | @CacheEvict(value="captchaCacheManager_cache_captcha",key="#captchaKey") |
| 38 | public void deleteCaptcha(String captchaKey){ |
| 39 | } |
| 40 | |
| 41 | |
| 42 | |
| 43 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…