mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-21 14:30:59 +08:00
优化目录结构
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.openisle.service;
|
||||
|
||||
import com.openisle.exception.FieldException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* Simple validator for usernames.
|
||||
*/
|
||||
@Service
|
||||
public class UsernameValidator {
|
||||
/**
|
||||
* Validate the username string.
|
||||
*
|
||||
* @param username the username to validate
|
||||
*/
|
||||
public void validate(String username) {
|
||||
if (username == null || username.isEmpty()) {
|
||||
throw new FieldException("username", "Username cannot be empty");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user