验证码
| 13 | * 验证码 |
| 14 | */ |
| 15 | @RestController |
| 16 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…