package com.gyt.shr.config.settingConfig;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author coyle
 * @description 用来从系统配置文件中动态加载业务配置【这里是注册登录时候的数据长度限制】
 * 202501
 */
@Data
@Component
@ConfigurationProperties(prefix = "app.validation")
public class AppValidationConfig {
    private Username username = new Username();
    private Password password = new Password();
    private Phone phone = new Phone();
    private Code code = new Code();

    private VerifyCodeExpireTime  expireTime = new VerifyCodeExpireTime();

    @Data
    public static class Username {
        private int minLength;
        private int maxLength;
        private String regex;
    }

    @Data
    public static class Password {
        private int length;
    }
    @Data
    public static class Phone {
        private String regex;
    }

    @Data
    public static class Code {
        private int length  ;
    }

    @Data
    public static class VerifyCodeExpireTime {
        private int length  ;
    }

}