-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 새로운 DTO를 만들었슴다 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.cozymate.cozymate_server.domain.memberstat.dto.response; | ||
|
||
import com.cozymate.cozymate_server.domain.memberstat.enums.DifferenceStatus; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record MemberStatPreferenceDetailColorDTO( | ||
String stat, | ||
// 다양한 Stat 값이 들어갈 수 있어 Object로 정의. | ||
Object value, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 주석으로 어떤 이유에서 Object를 사용하는지 적어주면 알아보기 편할 것 같습니당 |
||
String color | ||
) { | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
package com.cozymate.cozymate_server.domain.memberstat.dto.response; | ||
|
||
import com.cozymate.cozymate_server.domain.member.dto.response.MemberDetailResponseDTO; | ||
import java.util.Map; | ||
import java.util.List; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record MemberStatPreferenceResponseDTO( | ||
MemberDetailResponseDTO memberDetail, | ||
Integer equality, | ||
Map<String,Object> preferenceStats | ||
List<MemberStatPreferenceDetailColorDTO> preferenceStats | ||
) { | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Map.Entry; | ||
import java.util.function.BiFunction; | ||
import java.util.stream.Collectors; | ||
|
||
|
@@ -56,6 +57,14 @@ public static <T> DifferenceStatus compareField(List<MemberStat> memberStatList, | |
} | ||
} | ||
|
||
public static DifferenceStatus compareField( | ||
Object memberStatMapValue, Object criteriaMemberStatValue){ | ||
if(memberStatMapValue.equals(criteriaMemberStatValue)){ | ||
return DifferenceStatus.BLUE; | ||
} | ||
return DifferenceStatus.RED; | ||
} | ||
|
||
Comment on lines
+60
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 새로 만든 비교 메서드임다 |
||
|
||
// 아래부터는 특정 멤버스탯을 가져오기 위한 Util들 | ||
public static Map<String, BiFunction<Member,MemberStat,Object>> createFieldGetters() { | ||
|
@@ -110,6 +119,8 @@ public static Map<String, Object> getMemberStatFields(MemberStat memberStat, Lis | |
return result; | ||
} | ||
|
||
|
||
|
||
// 학번 Response 위해 필요한 Util | ||
public static String formatNumber(int number) { | ||
return String.format("%02d", number); | ||
|
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.
빡세게 계층화 했습니다