From 404656093e00cae677e2b0f5e7dc9f9848982f49 Mon Sep 17 00:00:00 2001 From: Donghun Won Date: Sun, 22 Sep 2024 22:24:28 +0900 Subject: [PATCH] =?UTF-8?q?Refactor=20:=20=EC=84=B1=EB=B3=84=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EC=8B=9C=20=EC=9C=A0=EC=A0=80=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=ED=95=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solitour/user/service/UserService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/solitour_backend/solitour/user/service/UserService.java b/src/main/java/solitour_backend/solitour/user/service/UserService.java index eef5f0a..b370a72 100644 --- a/src/main/java/solitour_backend/solitour/user/service/UserService.java +++ b/src/main/java/solitour_backend/solitour/user/service/UserService.java @@ -86,9 +86,19 @@ public Page 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")) {