package com.bonus.gateway.service;

import com.bonus.common.core.exception.CaptchaException;
import com.bonus.common.core.web.domain.AjaxResult;

import java.io.IOException;

/**
 * 验证码处理
 *
 * @author bonus
 */
public interface ValidateCodeService {
    /**
     * 生成验证码
     *
     * @return AjaxResult
     * @throws IOException      输入输出异常
     * @throws CaptchaException 自定义captcha 异常
     */
    public AjaxResult createCaptcha() throws IOException, CaptchaException;

    /**
     * 校验验证码
     *
     * @param key   captcha的key
     * @param value captcha的值
     * @throws CaptchaException 自定义captcha 异常
     */
    public void checkCaptcha(String key, String value) throws CaptchaException;

}
