NCP-3 add UserContent entity #5

Merged
backdev merged 29 commits from NCP-3 into dev 2025-12-05 17:58:17 +08:00
3 changed files with 3 additions and 3 deletions
Showing only changes of commit 3a9980fd86 - Show all commits
@@ -5,9 +5,11 @@ import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginRequest {
@NotBlank(message = "error.not.blank") @Email(message = "error.not.email") @Size(max = 128)
@@ -13,7 +13,6 @@ import java.time.LocalDate;
public record RegisterRequest(
@NotBlank(message = "error.name.length")
@Size(min = 2)
String fullName,
String companyName,
@@ -38,8 +38,7 @@ public class AuthService {
@Transactional
public AuthToken register(RegisterRequest registerRequest) {
if (userRepository.existsByEmail(registerRequest.email())) {
throw new UserAlreadyExistsException(messageSource.getMessage("error.user.exists", null,
Locale.getDefault()));
throw new UserAlreadyExistsException("User already exists with email: " + registerRequest.email());
}
User user = new User();