Created crud opration for company api's
This commit is contained in:
@@ -31,8 +31,6 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
import static net.gepafin.tendermanagement.util.Utils.setIfUpdated;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Repository
|
||||
public class UserDao {
|
||||
|
||||
@@ -84,7 +82,7 @@ public class UserDao {
|
||||
}
|
||||
|
||||
private void validateUserRequest(String tempToken, UserReq userReq) {
|
||||
if (Boolean.FALSE.equals(isValidEmail(userReq.getEmail()))) {
|
||||
if (Boolean.FALSE.equals(Utils.isValidEmail(userReq.getEmail()))) {
|
||||
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
||||
Translator.toLocale(GepafinConstant.VALIDATE_EMAIL));
|
||||
}
|
||||
@@ -302,16 +300,6 @@ public class UserDao {
|
||||
authService.logout(request, response);
|
||||
log.info("User successfully logged out.");
|
||||
}
|
||||
|
||||
|
||||
public static Boolean isValidEmail(String email) {
|
||||
String EMAIL_REGEX = "^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+$";
|
||||
if (email == null || email.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
Pattern pattern = Pattern.compile(EMAIL_REGEX);
|
||||
return pattern.matcher(email).matches();
|
||||
}
|
||||
|
||||
public UserResponseBean updateUserStatus(Long userId, UserStatusEnum statusReq) {
|
||||
log.info("Updating status for user with ID: {}", userId);
|
||||
|
||||
Reference in New Issue
Block a user