MCPcopy Create free account
hub / github.com/diyhi/bbs / CaptchaCacheManager

Class CaptchaCacheManager

src/main/java/cms/component/CaptchaCacheManager.java:11–43  ·  view source on GitHub ↗

验证码缓存管理

Source from the content-addressed store, hash-verified

9 * 验证码缓存管理
10 */
11@Component("captchaCacheManager")
12public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…