shz.core.verify.VerifyManager Maven / Gradle / Ivy
package shz.core.verify;
import shz.core.msg.ClientFailureMsg;
public interface VerifyManager {
boolean generate(T verifiable);
VerifyResult verify(T verifiable);
default void check(T verifiable) {
VerifyResult verify = verify(verifiable);
ClientFailureMsg.requireNon(verify == VerifyResult.NOT_EXIST, "验证码已失效");
ClientFailureMsg.requireNon(verify == VerifyResult.ERROR, "验证码错误");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy