package com.zhangmeng.api.service.admin_manager;


import com.zhangmeng.model.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Api(tags = "验证码管理")
public interface VerificationCodeControllerApi {

    /**
     * 验证码生成
     *
     * @param request  请求报文 校验
     * @param response 响应报文
     */
    @ApiOperation("验证码生成")
    public void generate(HttpServletRequest request, HttpServletResponse response);

    /**
     * 异步验证
     *
     * @param request 请求报文
     * @param captcha 验证码
     * @return 验证结果
     */
    @ApiOperation("异步验证")
    public Result verify(HttpServletRequest request, String captcha);


    /**
     * 生成验证码
     *
     * @param httpServletRequest  imageIo
     * @param httpServletResponse imageIo
     */
    @ApiOperation("生成验证码V1")
    public void generateVerificationCodeV1(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse,
                                           @RequestParam(name = "vl", defaultValue = "4") Integer vcodeLength,//vcodeLength,验证码长度
                                           @RequestParam(name = "fs", defaultValue = "21") Integer fontSize,//fontSize,验证码字体大小
                                           @RequestParam(name = "w", defaultValue = "98") Integer width,//width,图片宽度
                                           @RequestParam(name = "h", defaultValue = "33") Integer height//height,图片高度
    );


    /**
     * 生成验证码
     */
    @ApiOperation("生成验证码V2")
    public String generateVerificationCodeV2();


    /**
     * 模拟手机验证码
     */
    @ApiOperation("生成验证码V2")
    public Result generateVerificationCodeV3(String telephone);
}
