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

Feat/#30 유저 프로필 수정 기능 구현 #35

Merged
merged 5 commits into from
Oct 24, 2023
Merged

Feat/#30 유저 프로필 수정 기능 구현 #35

merged 5 commits into from
Oct 24, 2023

Conversation

1o18z
Copy link
Collaborator

@1o18z 1o18z commented Oct 24, 2023

이슈번호

close: #30

작업 내용 설명

  • 유저 프로필 정보 수정 기능 구현
  • 유저 프로필 이미지 수정 기능 구현

리뷰어에게 한마디

@1o18z 1o18z added the feat 기능 개발 label Oct 24, 2023
@1o18z 1o18z added this to the 1차 스프린트 milestone Oct 24, 2023
@1o18z 1o18z self-assigned this Oct 24, 2023
@github-actions
Copy link

github-actions bot commented Oct 24, 2023

Test Results

1 tests   1 ✔️  1s ⏱️
1 suites  0 💤
1 files    0

Results for commit 95432e4.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@yumyeonghan yumyeonghan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다.!

@@ -4,5 +4,15 @@ public enum Keyword {
COOK,
GAME,
EXERCISE,
;

public static boolean isValidKeyword(String keyword) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enum에서 제공하는 Keyword.valueOf() 메서드 사용하는게 더 좋아보여요!

}
}

private void validateInterests(List<Keyword> interests) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

서비스 레이어에서 말고,
DTO 객체에서 입력값에 대한 검증 로직을 추가하는게 좋아보입니다!

import jakarta.validation.constraints.NotBlank;
import java.util.List;

public record UpdateProfileRequest(@NotBlank String nickname, List<Keyword> interests) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

바로 이곳!

Comment on lines 59 to 64
if (nickname != null) {
user.getProfile().updateNickname(nickname);
}
if (interests != null && !interests.isEmpty()) {
interestService.updateInterests(userId, interests);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

입력 값에 대한 검증 로직은 dto에 추가해 주세요

@@ -29,4 +34,18 @@ public ResponseEntity<MyProfileResponse> findMyProfile(@Login AuthInfo authInfo)
return ResponseEntity.ok(userService.findMyProfile(authInfo.userId()));
}

@PatchMapping("/me/profile-image")
public ResponseEntity<Void> updateProfileImage(@Login AuthInfo authInfo,
@RequestParam String profileImageUrl) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dto 객체로 빼서 검증 해주세용

@1o18z 1o18z merged commit c03ed0b into dev Oct 24, 2023
3 checks passed
@1o18z 1o18z deleted the feat/#30 branch October 24, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 기능 개발
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

🚀 [Feature] 유저 프로필 수정 기능 구현
2 participants