Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] #33 - 개인 회원 정보 수정 기능 수정 #109

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions src/main/java/com/wooribound/domain/wbuser/WbUserServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,7 @@ public WbUserUpdateDTO updateUserInfo(WbUserUpdateDTO wbUserUpdateDTO) {
.build())
.orElseThrow(() -> new NoWbUserException("사용자를 찾을 수 없습니다. ID: " + wbUserUpdateDTO.getUserId()));

// 사용자 정보 업데이트
if (wbUserUpdateDTO.getName() != null) {
user.setName(wbUserUpdateDTO.getName());
}
if (wbUserUpdateDTO.getPhone() != null) {
user.setPhone(wbUserUpdateDTO.getPhone());
}
if (wbUserUpdateDTO.getGender() != null) {
user.setGender(wbUserUpdateDTO.getGender());
}
if (wbUserUpdateDTO.getAddrCity() != null) {
user.setAddrCity(wbUserUpdateDTO.getAddrCity());
}
if (wbUserUpdateDTO.getAddrProvince() != null) {
user.setAddrProvince(wbUserUpdateDTO.getAddrProvince());
}
if (wbUserUpdateDTO.getExjobChk() != null) {
user.setExjobChk(wbUserUpdateDTO.getExjobChk());
}
user.setExjobChk(wbUserUpdateDTO.getExjobChk());

// 관심 직종 업데이트
if (wbUserUpdateDTO.getInterestJobs() != null) {
Expand All @@ -144,6 +126,25 @@ public WbUserUpdateDTO updateUserInfo(WbUserUpdateDTO wbUserUpdateDTO) {
WbUser updatedUser = wbUserRepository.findByUserId(user.getUserId())
.orElseThrow(() -> new NoWbUserException("업데이트 후 사용자 조회 실패: ID: " + user.getUserId()));

// 사용자 정보 업데이트
if (wbUserUpdateDTO.getName() != null) {
updatedUser.setName(wbUserUpdateDTO.getName());
}
if (wbUserUpdateDTO.getPhone() != null) {
updatedUser.setPhone(wbUserUpdateDTO.getPhone());
}
if (wbUserUpdateDTO.getGender() != null) {
updatedUser.setGender(wbUserUpdateDTO.getGender());
}
if (wbUserUpdateDTO.getAddrCity() != null) {
updatedUser.setAddrCity(wbUserUpdateDTO.getAddrCity());
}
if (wbUserUpdateDTO.getAddrProvince() != null) {
updatedUser.setAddrProvince(wbUserUpdateDTO.getAddrProvince());
}
if (wbUserUpdateDTO.getExjobChk() != null) {
}

// 최종 저장
wbUserRepository.save(updatedUser);

Expand Down
Loading