This commit is contained in:
2026-08-15 01:40:51 +08:00
parent 2f165d3a45
commit e55fb57432
29 changed files with 163 additions and 124 deletions
+8 -2
View File
@@ -33,11 +33,17 @@ type SecurityRepo interface {
SaveSecurityConfig(context.Context, *SecurityConfig) error
}
func (uc *SettingsUsecase) UpdateSecurity(ctx context.Context, value *SecurityConfig) error {
type SecurityUsecase struct{ SecurityRepo }
func NewSecurityUsecase(repo SecurityRepo) *SecurityUsecase {
return &SecurityUsecase{SecurityRepo: repo}
}
func (uc *SecurityUsecase) UpdateSecurity(ctx context.Context, value *SecurityConfig) error {
return uc.SaveSecurityConfig(ctx, value)
}
func (uc *SettingsUsecase) ValidatePassword(value *SecurityConfig, password string) error {
func (uc *SecurityUsecase) ValidatePassword(value *SecurityConfig, password string) error {
if len([]rune(password)) < value.PwdMinLength {
return errors.New("密码长度不足")
}