Skip to content

Commit

Permalink
Refactor : 성별입력시 유저 프로필 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Astin01 committed Sep 22, 2024
1 parent 03129f2 commit 4046560
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,19 @@ public Page<GatheringApplicantResponse> retrieveGatheringApplicant(Pageable page
@Transactional
public void updateUserInfo(Long userId, UpdateUserInfoRequest request) {
User user = userRepository.findByUserId(userId);
changeUserProfile(user, request);
user.updateUserInfo(request);
}

private void changeUserProfile(User user, UpdateUserInfoRequest request) {
String sex = request.getSex();
if(sex.equals("male")){
user.updateUserImage(maleProfileUrl);
} else if (sex.equals("female")) {
user.updateUserImage(femaleProfileUrl);
}
}

private void resetUserProfile(User user, String imageUrl, String sex) {
checkUserProfile(imageUrl);
if (sex.equals("male")) {
Expand Down

0 comments on commit 4046560

Please sign in to comment.