All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.maxiaofa.captcha.spring.boot.service.ICaptchaService Maven / Gradle / Ivy

package com.maxiaofa.captcha.spring.boot.service;

import com.maxiaofa.captcha.spring.boot.framework.domain.Captcha;
import com.maxiaofa.captcha.spring.boot.framework.exception.chapcha.CaptchaErrorException;
import com.maxiaofa.captcha.spring.boot.framework.exception.chapcha.CaptchaExpireException;
import com.maxiaofa.captcha.spring.boot.framework.exception.io.CaptchaIoErrorException;

/**
 * 验证码服务接口
 * @author MaXiaoFa
 */
public interface ICaptchaService {

    /**
     * 生成验证码
     * @return {@link Captcha}验证码
     * */
    public Captcha createCaptcha() throws CaptchaIoErrorException;

    /**
     * 验证验证码 调用后会删除这个UUID验证码需重新生成
     * @param uuid 生成验证码返回的UUID
     * @param code 前台传递的验证码
     * @return 验证码验证通过生成的key
     * */
    public String verifyCaptcha(String uuid,String code) throws CaptchaExpireException, CaptchaErrorException;

    /**
     * 验证验证码key 调用后会删除这个UUID验证码需重新生成
     * @param uuid 生成验证码返回的UUID
     * @param key 验证验证码通过返回的key
     * @return 是否验证通过
     * */
    public boolean verifyCaptchaKey(String uuid,String key) throws CaptchaExpireException;

    /**
     * 删除验证码
     * @param uuid 生成验证码返回的UUID
     * */
    public void delCaptcha(String uuid);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy