package org.springblade.modules.app.web;

import com.wn.common.controller.BaseController;
import com.wn.common.datamodel.ResultDTO;
import org.springblade.modules.app.dto.InnerCaptchaReqDTO;
import org.springblade.modules.app.dto.InnerCaptchaResultDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.auth.permission.DisableLoginVerify;
import org.springblade.modules.app.manager.CaptchaManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("app/captcha")
@Api(value = "滑动验证码", tags = "滑动验证码")
public class CaptchaCheckController extends BaseController {

    @Autowired
    private CaptchaManager captchaManager;

    @DisableLoginVerify
    @ResponseBody
    @GetMapping("/get")
    //@ApiOperation(value = "获取滑动验证码")
    public ResponseEntity<ResultDTO<InnerCaptchaResultDTO>> getCaptcha(InnerCaptchaReqDTO innerCaptchaReqDTO) {
        return success(captchaManager.getCaptcha(innerCaptchaReqDTO));
    }

}
