Skip to content

Commit

Permalink
[merge] preference response 타입 변환
Browse files Browse the repository at this point in the history
[refactor] preference response 타입 변환
  • Loading branch information
sebbbin authored Jul 16, 2024
2 parents 62b889b + 936e89a commit 41d62fb
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public record Preference(
long userId,
List<List<Object>> preference
List<List<String>> preference
) {

public static Preference of(long userId, Map<Keyword, Long> preference) {
Expand Down Expand Up @@ -43,12 +43,12 @@ private static long sum(Map<Keyword, Long> preference) {
.sum();
}

private static List<List<Object>> transform(Map<Keyword, Long> preference) {
private static List<List<String>> transform(Map<Keyword, Long> preference) {
return preference.entrySet().stream()
.map(entry -> {
List<Object> list = new ArrayList<>();
list.add(entry.getKey());
list.add(entry.getValue());
List<String> list = new ArrayList<>();
list.add(entry.getKey().name());
list.add(String.valueOf(entry.getValue()));
return list;
})
.collect(Collectors.toList());
Expand Down

0 comments on commit 41d62fb

Please sign in to comment.