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

[BE] 피드백 미작성시 받은 피드백 안보이는 기능(#640) #643

Merged
merged 18 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions backend/src/main/java/corea/feedback/dto/FeedbackOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import corea.feedback.util.FeedbackKeywordConverter;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Collections;
import java.util.List;

@Schema(description = "개발 피드백 + 커뮤니케이션 피드백 조회 응답")
Expand All @@ -23,6 +24,9 @@ public record FeedbackOutput(@Schema(description = "피드백 아이디", exampl
@Schema(description = "유저 이름", example = "jcoding-play")
String username,

@Schema(description = "내가 상대방의 피드백 작성을 완료하였는지 여부", example = "false")
boolean isWrited,
Copy link
Contributor

Choose a reason for hiding this comment

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

isFeedbackCompleted 같은 이름이 더 어울리는 것 같기는 하네요...

MatchResultResponse에서도 마찬가지입니다.
대신 바꾸게 되면 프론트에 노티줘야 할듯. 👀


@Schema(description = "선택한 피드백 키워드", example = "[\"코드를 이해하기 쉬웠어요\", \"컨벤션이 잘 지켜졌어요\"]")
List<String> feedbackKeywords,

Expand All @@ -39,6 +43,7 @@ public static FeedbackOutput fromReceiver(DevelopFeedback developFeedback) {
developFeedback.getDeliver().getId(),
developFeedback.getDeliver().getThumbnailUrl(),
developFeedback.getDeliver().getUsername(),
true,
Copy link
Contributor

Choose a reason for hiding this comment

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

지금 하드코딩으로 박혀있는 boolean 값들을 static 상수로 빼보시는 건 어떤가요? 👀

private static final String `FEEDBACK_COMPLETED` = true
private static final String `FEEDBACK_INCOMPLETED` = false 같은 너낌...

Copy link
Contributor

Choose a reason for hiding this comment

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

괜찮은듯요

FeedbackKeywordConverter.convertToMessages(developFeedback.getKeywords()),
developFeedback.getEvaluatePoint(),
developFeedback.getFeedBackText()
Expand All @@ -52,6 +57,7 @@ public static FeedbackOutput fromDeliver(DevelopFeedback developFeedback) {
developFeedback.getReceiver().getId(),
developFeedback.getReceiver().getThumbnailUrl(),
developFeedback.getReceiver().getUsername(),
true,
FeedbackKeywordConverter.convertToMessages(developFeedback.getKeywords()),
developFeedback.getEvaluatePoint(),
developFeedback.getFeedBackText()
Expand All @@ -65,6 +71,7 @@ public static FeedbackOutput fromReceiver(SocialFeedback socialFeedback) {
socialFeedback.getDeliver().getId(),
socialFeedback.getDeliver().getThumbnailUrl(),
socialFeedback.getDeliver().getUsername(),
true,
FeedbackKeywordConverter.convertToMessages(socialFeedback.getKeywords()),
socialFeedback.getEvaluatePoint(),
socialFeedback.getFeedBackText()
Expand All @@ -78,9 +85,24 @@ public static FeedbackOutput fromDeliver(SocialFeedback socialFeedback) {
socialFeedback.getReceiver().getId(),
socialFeedback.getReceiver().getThumbnailUrl(),
socialFeedback.getReceiver().getUsername(),
true,
FeedbackKeywordConverter.convertToMessages(socialFeedback.getKeywords()),
socialFeedback.getEvaluatePoint(),
socialFeedback.getFeedBackText()
);
}

public static FeedbackOutput masking(FeedbackOutput feedbackOutput) {
return new FeedbackOutput(
feedbackOutput.feedbackId(),
feedbackOutput.roomId,
feedbackOutput.receiverId,
feedbackOutput.profile,
feedbackOutput.username,
false,
Collections.emptyList(),
0,
""
);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package corea.feedback.dto;

import corea.room.domain.Room;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Collections;
import java.util.List;

@Schema(description = "개발 피드백 + 커뮤니케이션 피드백 작성 응답")
Expand All @@ -20,6 +22,9 @@ public record FeedbackResponse(@Schema(description = "피드백 아이디", exam
@Schema(description = "유저 이름", example = "jcoding-play")
String username,

@Schema(description = "내가 상대방의 피드백 작성을 완료하였는지 여부", example = "false")
Copy link
Contributor

Choose a reason for hiding this comment

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

마찬가지입뉘다.

boolean isWrited,

@Schema(description = "선택한 피드백 키워드", example = "[\"코드를 이해하기 쉬웠어요\", \"컨벤션이 잘 지켜졌어요\"]")
List<String> feedbackKeywords,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ private static FeedbackResponse toFeedbackResponse(FeedbackOutput output) {
output.receiverId(),
output.profile(),
output.username(),
output.isWrited(),
output.feedbackKeywords(),
output.evaluationPoint(),
output.feedbackText()
Expand Down