完成了接口和基本的类定义

This commit is contained in:
2025-11-14 01:54:04 +08:00
commit b73727ccc2
22 changed files with 988 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
package backend.utils.interfaces;
import java.util.Random;
/**
* 验证码工具类接口
* 提供验证码的生成和验证功能
*/
public interface CaptchaUtils {
/**
* 字符集常量,包含大小写字母和数字
*/
static final String CHAR_SET="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
/**
* 验证码长度常量默认为4位
*/
static final int CAPTCHA_LENGTH=4;
/**
* 私有构造函数,防止实例化
*/
private CaptchaUtils();
/**
* 生成随机验证码
*
* @return 生成的验证码字符串
*/
static String generateCaptcha();
/**
* 验证用户输入的验证码是否正确
*
* @param inputCaptcha 用户输入的验证码
* @param systemCaptcha 系统生成的验证码
* @return 验证结果正确返回true错误返回false
*/
static boolean verifyCaptcha(String inputCaptcha,String systemCaptcha);
}