package cn.reghao.tnb.auth.app.model.po;

import cn.reghao.jutil.jdk.web.db.BaseObject;
import cn.reghao.tnb.common.util.ConstantId;
import lombok.Getter;
import lombok.Setter;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

/**
 * 帐号开放注册规则
 *
 * @author reghao
 * @date 2024-11-01 10:41:36
 */
@Setter
@Getter
public class UserRegistry extends BaseObject<Integer> {
    @NotNull
    private Boolean enabled;
    @NotBlank
    @Size(min = 5, max = 5)
    private String captchaCode;
    @NotNull
    private Boolean enableCaptcha;
    @NotBlank
    @Size(min = 6, max = 6)
    private String verifyCode;
    @NotNull
    private Boolean enableVerify;

    public UserRegistry() {
        this.enabled = true;
        this.captchaCode = ConstantId.CAPTCHA_CODE;
        this.enableCaptcha = false;
        this.verifyCode = ConstantId.VERIFY_CODE;
        this.enableVerify = true;
    }
}
