Merged
Conversation
대부분의 엔티티에 공통으로 사용되는 createdAt, updatedAt 필드를 추상 클래스 BaseEntity로 분리하여재사용할 수 있도록 구성했습니다.
회원의 주소 정보를 나타내는 엔티티입니다.
f-lab-nolan
reviewed
Apr 3, 2025
|
|
||
| @Transactional | ||
| public Long signup(UserSignupRequestDto userSignupRequestDto) { | ||
| User user = userMapper.toEntity(userSignupRequestDto); |
Collaborator
There was a problem hiding this comment.
final User user = userMapper.toEntity(userSignupRequestDto);
f-lab-nolan
reviewed
Apr 3, 2025
| public Long signup(UserSignupRequestDto userSignupRequestDto) { | ||
| User user = userMapper.toEntity(userSignupRequestDto); | ||
| userJpaRepository.findUserByEmail(userSignupRequestDto.email()) | ||
| .ifPresent(u -> { throw new UserDuplicateException(EXCEPTION_USER_DUPLICATE.message()); }); |
Collaborator
There was a problem hiding this comment.
return userJpaRepository.findUserByEmail(userSignupRequestDto.email())
.map(s-> throw new UserDuplicateException(EXCEPTION_USER_DUPLICATE.message()) )
.orElseGet(u -> { User savedUser = userJpaRepository.save(user);
return savedUser.getId();});
f-lab-nolan
reviewed
Apr 3, 2025
|
|
||
| public enum ExceptionMessages { | ||
|
|
||
| EXCEPTION_USER_DUPLICATE("이미 존재하는 회원입니다."); |
f-lab-nolan
reviewed
Apr 3, 2025
| User user = userMapper.toEntity(userSignupRequestDto); | ||
| userJpaRepository.findUserByEmail(userSignupRequestDto.email()) | ||
| .ifPresent(u -> { throw new UserDuplicateException(EXCEPTION_USER_DUPLICATE.message()); }); | ||
| User savedUser = userJpaRepository.save(user); |
Collaborator
There was a problem hiding this comment.
try{
User savedUser = userJpaRepository.save(user);
}catch(Exception ex){
logger.error(e.getMessage(), e)
throw e;
}
Collaborator
There was a problem hiding this comment.
try{
String savedUser = json.toString(userJpaRepository.save(user));
return savedUser;
}catch(Exception ex){
logger.info(e.getMessage(), e)
return null;
}
f-lab-nolan
reviewed
Apr 3, 2025
| private final UserService userService; | ||
|
|
||
| @PostMapping | ||
| public ResponseEntity<UserSignupResponseDto> signup(@Valid @RequestBody UserSignupRequestDto request) { |
Collaborator
There was a problem hiding this comment.
public UserSignupResponseDto signup(@Valid @RequestBody UserSignupRequestDto request) {
모든 엔티티가 전부 사용하지 않기때문에, 필드 값으로 따로 명시
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
작업 내용
UserSignupRequestDto,UserSignupResponseDto구현UserController에 회원가입 API(/api/v1/users) 추가UserService에 회원 저장 로직 구현UserMapper에서 DTO → Entity 변환 및 비밀번호 암호화 처리추가 사항
ValidationMessages로 상수화UserIntegrationTest) 작성 및 성공 검증관련 이슈