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

Class CaptchaController

src/main/java/cms/controller/frontend/CaptchaController.java:15–44  ·  view source on GitHub ↗

验证码

Source from the content-addressed store, hash-verified

13 * 验证码
14 */
15@RestController
16public class CaptchaController {
17
18 @Resource
19 CaptchaService captchaService;
20
21 /**
22 * 生成验证码
23 * @param captchaKey 验证码Key
24 * @return
25 */
26 @DynamicRouteTarget(route = DynamicRouteEnum.DEFAULT_1150100)
27 @RequestMapping(value="/captcha/{captchaKey}", method=RequestMethod.GET)
28 public ResponseEntity<byte[]> createCaptcha(@PathVariable String captchaKey){
29
30 return captchaService.generateCaptchaImage(captchaKey);
31 }
32
33 /**
34 * 校验验证码
35 * @param captchaKey 验证码键
36 * @param captchaValue 验证码值
37 * @return
38 */
39 @DynamicRouteTarget(route = DynamicRouteEnum.DEFAULT_1150200)
40 @RequestMapping(value="/checkCaptcha",method=RequestMethod.POST)
41 public CaptchaVerification verifyCaptcha(String captchaKey,String captchaValue){
42 return captchaService.verifyCaptcha(captchaKey, captchaValue);
43 }
44}

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…