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] 개별 프로필 조회 API 구현 #139

Merged
merged 4 commits into from
Mar 4, 2024
Merged

Conversation

gardening-y
Copy link
Member

@gardening-y gardening-y commented Mar 3, 2024

Related Issue 📌

close #134

Description ✔️

  • 개별 프로필 조회 API를 구현하였습니다.
  • 개별 프로필 조회 응답 dto인 TripParticipantProfileResponse를 구현하였습니다.

@gardening-y gardening-y changed the title [feat] 개별 프로필 조회API 구현 [feat] 개별 프로필 조회 API 구현 Mar 3, 2024
Copy link
Member

@SunwoongH SunwoongH left a comment

Choose a reason for hiding this comment

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

고생 많으셨습니다!

Comment on lines 20 to 30
return new TripParticipantProfileResponse(
user.getName(),
user.getIntro(),
validatedResult,
participant.getStyleA(),
participant.getStyleB(),
participant.getStyleC(),
participant.getStyleD(),
participant.getStyleE(),
isOwner
);
Copy link
Member

Choose a reason for hiding this comment

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

Builder 어노테이션을 적용해봐도 좋을 것 같습니다~

Comment on lines 211 to 217
private int getvalidatedResult(User user) {
try {
return user.getResult().getNumResult();
} catch (NullPointerException e) {
return -1;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

메서드명 Camel Case 확인 한 번 부탁드립니다. 그리고 NPE의 경우,
스크린샷 2024-03-04 오전 12 26 55
numResult가 int 기본 자료형으로 선언되어 있어서 발생하는 것 같습니다. 해당 자료형을 Integer 래퍼 클래스로 변경하면 null 값을 가질 수 있어서 해결될 것 같은데 확인 가능할까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

변경해보니 response builder에서 user.getResult().getNumResult()를 사용하는데 getResult() 자체가 null 이기 때문에 getNumResult()를 꺼내오면 NPE가 발생하는것으로 확인됩니다. null을 그대로 반환하려면 다시 user.getResult()를 null인지 아닌지 확인하는 메서드가 필요한데 이 메서드를 추가해서 null을 반환하는 것으로 변경하는게 나을까요?! 좋은 의견있으면 알려주세요!

Copy link
Member

Choose a reason for hiding this comment

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

제가 잘못 이해했었네요! 저도 조금 더 고민이 필요할 것 같습니다. 우선 2차 스프린트 기간 내에 API가 배포되어야 해서 현재 기능적인 문제는 없으니 현재 PR 머지 후 이슈를 새롭게 생성해서 리팩터링을 진행해 보면 좋을 것 같습니다. 같이 고민해 보겠습니다!

@gardening-y gardening-y merged commit 597ea79 into develop Mar 4, 2024
1 check passed
@SunwoongH SunwoongH deleted the feature/134 branch July 11, 2024 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 개별 프로필 조회 API 구현
2 participants