package com.codvision.auth.controller;

import com.codvision.auth.entity.vo.CustomCaptchaVO;
import com.codvision.auth.service.ICustomCaptchaService;
import com.codvision.commoncore.common.ResponseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 自定义图片验证码（包含数字、字母）
 *
 * @author hxl
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/customCaptcha")
@Api(tags = "用户端-验证码模块")
public class CustomCaptchaController {

    @Resource
    private ICustomCaptchaService customCaptchaService;

    @PostMapping("/get")
    @ApiOperation(value = "获取验证码", notes = "获取验证码接口")
    public ResponseEntity<CustomCaptchaVO> get() {
        return new ResponseEntity<CustomCaptchaVO>().data(customCaptchaService.getPicCaptcha());
    }
}
