-
Notifications
You must be signed in to change notification settings - Fork 0
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
[COZY-410] 룸메이트 추천, 필터링, 상세 필터링 color 리턴 #194
Conversation
리뷰해드려요~FavoriteQueryService.java - 리뷰
MemberStatConverter.java - 리뷰
MemberStatPreferenceDetailColorDTO.java - 리뷰
MemberStatPreferenceResponseDTO.java - 리뷰
MemberStatQueryService.java - 리뷰
MemberStatUtil.java - 리뷰
추가 개선 사항:
|
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.
새로운 DTO를 만들었슴다
|
||
// 랜덤에서 사용하는 Converter | ||
public static List<MemberStatPreferenceDetailColorDTO> toMemberStatPreferenceDetailColorDTOList( | ||
MemberStat memberStat, List<String> preferences | ||
){ | ||
Map<String, Object> memberStatMap = MemberStatUtil.getMemberStatFields(memberStat, preferences); | ||
|
||
return memberStatMap.entrySet().stream() | ||
.map(entry -> | ||
MemberStatConverter.toMemberStatPreferenceDetailColorDTO(entry.getKey(), entry.getValue(), DifferenceStatus.WHITE)) | ||
.toList(); | ||
} | ||
|
||
// 일반 검색/ 필터링에서 사용하는 Converter | ||
public static List<MemberStatPreferenceDetailColorDTO> toMemberStatPreferenceDetailColorDTOList( | ||
MemberStat memberStat, MemberStat criteriaMemberStat, List<String> preferences | ||
){ | ||
Map<String, Object> memberStatMap = MemberStatUtil.getMemberStatFields(memberStat, preferences); | ||
Map<String, Object> criteriaMemberStatMap = MemberStatUtil.getMemberStatFields(criteriaMemberStat, preferences); | ||
|
||
return memberStatMap.entrySet().stream() | ||
.map(entry-> | ||
MemberStatConverter.toMemberStatPreferenceDetailColorDTO( | ||
entry.getKey(), entry.getValue(), MemberStatUtil.compareField(entry.getValue(), criteriaMemberStatMap.get(entry.getKey()) | ||
))).toList(); | ||
} | ||
|
||
public static MemberStatPreferenceDetailColorDTO toMemberStatPreferenceDetailColorDTO(String stat, Object value, DifferenceStatus color){ | ||
return MemberStatPreferenceDetailColorDTO.builder() | ||
.stat(stat) | ||
.value(value) | ||
.color(color.getValue()) | ||
.build(); | ||
} | ||
|
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.
빡세게 계층화 했습니다
public static DifferenceStatus compareField( | ||
Object memberStatMapValue, Object criteriaMemberStatValue){ | ||
if(memberStatMapValue.equals(criteriaMemberStatValue)){ | ||
return DifferenceStatus.BLUE; | ||
} | ||
return DifferenceStatus.RED; | ||
} | ||
|
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.
깔끔해졌네용 멋지다~
@Builder | ||
public record MemberStatPreferenceDetailColorDTO( | ||
String stat, | ||
Object value, |
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.
주석으로 어떤 이유에서 Object를 사용하는지 적어주면 알아보기 편할 것 같습니당
왜 오브젝트를 쓰지? 했는데, 멤버스탯이었군요...
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.
LGTM~ 구구굳
리뷰해드려요~FavoriteQueryService.java - 리뷰 1
MemberStatConverter.java - 리뷰 2
MemberStatPreferenceDetailColorDTO.java - 리뷰 3
MemberStatPreferenceResponseDTO.java - 리뷰 4
MemberStatQueryService.java - 리뷰 5
MemberStatUtil.java - 리뷰 6
추가 개선 사항 제안:
|
⚒️develop의 최신 커밋을 pull 받았나요?
네
#️⃣ 작업 내용
룸메이트 추천, 필터링, 상세 필터링에 color를 넣어 리턴했습니다.
동작 확인
💬 리뷰 요구사항(선택)
감사합니다다.