mirror of https://gitee.com/stylefeng/roses
【8.0】【config】系统配置编码抽出常量
parent
13d8b973b6
commit
98a23380e0
|
@ -11,6 +11,46 @@ import cn.stylefeng.roses.kernel.config.api.context.ConfigContext;
|
||||||
*/
|
*/
|
||||||
public class LoginConfigExpander {
|
public class LoginConfigExpander {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最大错误登录次数的配置code
|
||||||
|
*/
|
||||||
|
public static final String SYS_LOGIN_MAX_ERROR_LOGIN_COUNT = "SYS_LOGIN_MAX_ERROR_LOGIN_COUNT";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最小密码长度的配置code
|
||||||
|
*/
|
||||||
|
public static final String SYS_LOGIN_MIN_PASSWORD_LENGTH = "SYS_LOGIN_MIN_PASSWORD_LENGTH";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特殊字符最小数量的配置code
|
||||||
|
*/
|
||||||
|
public static final String SYS_LOGIN_PASSWORD_MIN_SPECIAL_SYMBOL_COUNT = "SYS_LOGIN_PASSWORD_MIN_SPECIAL_SYMBOL_COUNT";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大写字母最小数量的配置code
|
||||||
|
*/
|
||||||
|
public static final String SYS_LOGIN_PASSWORD_MIN_UPPER_CASE_COUNT = "SYS_LOGIN_PASSWORD_MIN_UPPER_CASE_COUNT";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小写字母最小数量的配置code
|
||||||
|
*/
|
||||||
|
public static final String SYS_LOGIN_PASSWORD_MIN_LOWER_CASE_COUNT = "SYS_LOGIN_PASSWORD_MIN_LOWER_CASE_COUNT";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字最小数量的配置code
|
||||||
|
*/
|
||||||
|
public static final String SYS_LOGIN_PASSWORD_MIN_NUMBER_COUNT = "SYS_LOGIN_PASSWORD_MIN_NUMBER_COUNT";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多久更新一次密码的配置code
|
||||||
|
*/
|
||||||
|
public static final String SYS_LOGIN_PASSWORD_MIN_UPDATE_DAYS = "SYS_LOGIN_PASSWORD_MIN_UPDATE_DAYS";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码最小不能重复次数的配置code
|
||||||
|
*/
|
||||||
|
public static final String SYS_LOGIN_PASSWORD_MIN_CANT_REPEAT_TIMES = "SYS_LOGIN_PASSWORD_MIN_CANT_REPEAT_TIMES";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取单账号单端登录的开关
|
* 获取单账号单端登录的开关
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -46,7 +86,7 @@ public class LoginConfigExpander {
|
||||||
*/
|
*/
|
||||||
public static Integer getMaxErrorLoginCount() {
|
public static Integer getMaxErrorLoginCount() {
|
||||||
return ConfigContext.me()
|
return ConfigContext.me()
|
||||||
.getSysConfigValueWithDefault("SYS_LOGIN_MAX_ERROR_LOGIN_COUNT", Integer.class, LoginCacheConstants.MAX_ERROR_LOGIN_COUNT);
|
.getSysConfigValueWithDefault(SYS_LOGIN_MAX_ERROR_LOGIN_COUNT, Integer.class, LoginCacheConstants.MAX_ERROR_LOGIN_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,7 +96,7 @@ public class LoginConfigExpander {
|
||||||
* @since 2023/10/3 20:39
|
* @since 2023/10/3 20:39
|
||||||
*/
|
*/
|
||||||
public static Integer getMinPasswordLength() {
|
public static Integer getMinPasswordLength() {
|
||||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_MIN_PASSWORD_LENGTH", Integer.class, 6);
|
return ConfigContext.me().getSysConfigValueWithDefault(SYS_LOGIN_MIN_PASSWORD_LENGTH, Integer.class, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,7 +106,7 @@ public class LoginConfigExpander {
|
||||||
* @since 2023/10/3 20:44
|
* @since 2023/10/3 20:44
|
||||||
*/
|
*/
|
||||||
public static Integer getPasswordMinSpecialSymbolCount() {
|
public static Integer getPasswordMinSpecialSymbolCount() {
|
||||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_SPECIAL_SYMBOL_COUNT", Integer.class, 0);
|
return ConfigContext.me().getSysConfigValueWithDefault(SYS_LOGIN_PASSWORD_MIN_SPECIAL_SYMBOL_COUNT, Integer.class, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,7 +116,7 @@ public class LoginConfigExpander {
|
||||||
* @since 2023/10/3 21:14
|
* @since 2023/10/3 21:14
|
||||||
*/
|
*/
|
||||||
public static Integer getPasswordMinUpperCaseCount() {
|
public static Integer getPasswordMinUpperCaseCount() {
|
||||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_UPPER_CASE_COUNT", Integer.class, 0);
|
return ConfigContext.me().getSysConfigValueWithDefault(SYS_LOGIN_PASSWORD_MIN_UPPER_CASE_COUNT, Integer.class, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,7 +126,7 @@ public class LoginConfigExpander {
|
||||||
* @since 2023/10/3 21:16
|
* @since 2023/10/3 21:16
|
||||||
*/
|
*/
|
||||||
public static Integer getPasswordMinLowerCaseCount() {
|
public static Integer getPasswordMinLowerCaseCount() {
|
||||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_LOWER_CASE_COUNT", Integer.class, 0);
|
return ConfigContext.me().getSysConfigValueWithDefault(SYS_LOGIN_PASSWORD_MIN_LOWER_CASE_COUNT, Integer.class, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,7 +136,7 @@ public class LoginConfigExpander {
|
||||||
* @since 2023/10/3 21:18
|
* @since 2023/10/3 21:18
|
||||||
*/
|
*/
|
||||||
public static Integer getPasswordMinNumberCount() {
|
public static Integer getPasswordMinNumberCount() {
|
||||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_NUMBER_COUNT", Integer.class, 0);
|
return ConfigContext.me().getSysConfigValueWithDefault(SYS_LOGIN_PASSWORD_MIN_NUMBER_COUNT, Integer.class, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,7 +146,7 @@ public class LoginConfigExpander {
|
||||||
* @since 2023/10/3 21:27
|
* @since 2023/10/3 21:27
|
||||||
*/
|
*/
|
||||||
public static Integer getPasswordMinUpdateDays() {
|
public static Integer getPasswordMinUpdateDays() {
|
||||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_UPDATE_DAYS", Integer.class, 180);
|
return ConfigContext.me().getSysConfigValueWithDefault(SYS_LOGIN_PASSWORD_MIN_UPDATE_DAYS, Integer.class, 180);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,7 +156,7 @@ public class LoginConfigExpander {
|
||||||
* @since 2023/10/3 21:50
|
* @since 2023/10/3 21:50
|
||||||
*/
|
*/
|
||||||
public static Integer getPasswordMinCantRepeatTimes() {
|
public static Integer getPasswordMinCantRepeatTimes() {
|
||||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_LOGIN_PASSWORD_MIN_CANT_REPEAT_TIMES", Integer.class, 0);
|
return ConfigContext.me().getSysConfigValueWithDefault(SYS_LOGIN_PASSWORD_MIN_CANT_REPEAT_TIMES, Integer.class, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue