-
Notifications
You must be signed in to change notification settings - Fork 1
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
YEL-193 [feat] 친구 쪽지 전체 조회하기 #421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
조금만 더 힘냅시다
.id(vote.getId()) | ||
.senderId(vote.getSender().getId()) | ||
.senderName(vote.getSender().getName()) | ||
.senderGender(vote.getSender().getGender().name()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
차후 ENUM 점검할 때 getInitial()로 변경할 수 있도록 합시다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋습니다
List<VoteFriendAndUserVO> list = | ||
voteRepository.findUserSendReceivedByFriends(userId, pageable) | ||
.stream() | ||
.filter(vote -> vote.getNameHint()!=-3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NameHint도 ENUM화 시켰으면 좋을텐데 말이죠
(처음만든게 아쉬운게 보여서 아쉽다고하는 리뷰)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그러게요 ㅎ... 숫자로 하니까 의미가 뚜렷하게 보이지 않아서 오랜만에 보니 또 헤깔리네유
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아쉬운게 보였다면 그게 성장.
@@ -113,6 +119,32 @@ public VoteFriendResponse findAllFriendVotes(Long userId, Pageable pageable) { | |||
return VoteFriendResponse.of(totalCount, list); | |||
} | |||
|
|||
public VoteFriendAndUserResponse findAllFriendVotesWithType(Long userId, Pageable pageable, String type) { | |||
|
|||
if(type.equals(USER_VOTE_TYPE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch문을 사용하는게 어떨까요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굿굿
@@ -113,6 +119,32 @@ public VoteFriendResponse findAllFriendVotes(Long userId, Pageable pageable) { | |||
return VoteFriendResponse.of(totalCount, list); | |||
} | |||
|
|||
public VoteFriendAndUserResponse findAllFriendVotesWithType(Long userId, Pageable pageable, String type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENUM을 통해 type을 narrowing해주고,
StringUtils.hasText();
통해 null처리를 해주세요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String type
-> VoteType type으로 바꿔주세요
public BaseResponse<KeywordCheckResponse> checkKeyword(@PathVariable Long voteId, @AccessTokenUser User user) { | ||
@GetMapping("/v2/vote/friend") | ||
public BaseResponse<VoteFriendAndUserResponse> findAllFriendVotesWithType( | ||
@RequestParam("page") Integer page, @RequestParam("type") String type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래와 같이 type을 Nullable하게 만들고,
@RequestParam(value = "type", required = false) String type
https://github.com/team-yello/YELLO-Server/blob/feat/YEL-187/src/main/java/com/yello/server/domain/admin/controller/AdminController.java#L156
을 참조해서 ENUM 처리를 해주세요
@Getter | ||
@RequiredArgsConstructor | ||
public enum VoteType { | ||
send("send"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum 이름은 대문자 SEND로 바꿔주세요
@@ -113,6 +119,32 @@ public VoteFriendResponse findAllFriendVotes(Long userId, Pageable pageable) { | |||
return VoteFriendResponse.of(totalCount, list); | |||
} | |||
|
|||
public VoteFriendAndUserResponse findAllFriendVotesWithType(Long userId, Pageable pageable, String type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String type
-> VoteType type으로 바꿔주세요
☘️ Related Issue
✅ Work description
💡 PR point