Skip to content

Commit

Permalink
Merge pull request #109 from WooRibound/feature/#33-Wbuser-info
Browse files Browse the repository at this point in the history
[fix] #33 - 개인 회원 정보 수정 기능 수정
  • Loading branch information
Oodls authored Nov 18, 2024
2 parents a5a4353 + 1b802dd commit 20ca258
Showing 1 changed file with 20 additions and 19 deletions.
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

0 comments on commit 20ca258

Please sign in to comment.