feat: implement settings page and config management

This commit is contained in:
Tim
2025-07-07 20:41:52 +08:00
parent fbf0d9fe2f
commit 693d6d5e6b
7 changed files with 244 additions and 4 deletions

View File

@@ -7,12 +7,20 @@ import org.springframework.stereotype.Service;
@Service
public class PasswordValidator {
private final PasswordStrength strength;
private PasswordStrength strength;
public PasswordValidator(@Value("${app.password.strength:LOW}") PasswordStrength strength) {
this.strength = strength;
}
public PasswordStrength getStrength() {
return strength;
}
public void setStrength(PasswordStrength strength) {
this.strength = strength;
}
public void validate(String password) {
if (password == null || password.isEmpty()) {
throw new FieldException("password", "Password cannot be empty");