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

YEL-193 [feat] 친구 쪽지 전체 조회하기 #421

Merged
merged 11 commits into from
Jan 30, 2024
Merged

Conversation

hyeonjeongs
Copy link
Member

☘️ Related Issue

  • resolves YEL-193

✅ Work description

  • type 별 친구 쪽지 조회

💡 PR point

  • type 아에 입력 안 하는 경우, 값을 입력해달라는 에러 메시지 때문에 null이라도 반드시 입력해야하는 것 같습니다.

@hyeonjeongs hyeonjeongs added feat 새로운 기능 구현 현정👕 labels Jan 29, 2024
@hyeonjeongs hyeonjeongs self-assigned this Jan 29, 2024
Copy link

github-actions bot commented Jan 29, 2024

Test Results

144 tests  +1   144 ✅ +1   8s ⏱️ -1s
 25 suites ±0     0 💤 ±0 
 25 files   ±0     0 ❌ ±0 

Results for commit bc6b303. ± Comparison against base commit 902a055.

♻️ This comment has been updated with latest results.

Copy link
Member

@euije euije left a 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())
Copy link
Member

Choose a reason for hiding this comment

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

차후 ENUM 점검할 때 getInitial()로 변경할 수 있도록 합시다

Copy link
Member Author

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)
Copy link
Member

Choose a reason for hiding this comment

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

NameHint도 ENUM화 시켰으면 좋을텐데 말이죠
(처음만든게 아쉬운게 보여서 아쉽다고하는 리뷰)

Copy link
Member Author

Choose a reason for hiding this comment

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

그러게요 ㅎ... 숫자로 하니까 의미가 뚜렷하게 보이지 않아서 오랜만에 보니 또 헤깔리네유

Copy link
Member Author

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)) {
Copy link
Member

Choose a reason for hiding this comment

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

switch문을 사용하는게 어떨까요

Copy link
Member Author

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) {
Copy link
Member

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처리를 해주세요

Copy link
Member

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,
Copy link
Member

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");
Copy link
Member

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) {
Copy link
Member

Choose a reason for hiding this comment

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

String type -> VoteType type으로 바꿔주세요

@hyeonjeongs hyeonjeongs merged commit a74aa4e into develop Jan 30, 2024
3 checks passed
@euije euije deleted the feat/YEL-193 branch February 6, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 새로운 기능 구현 현정👕
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants