-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
637 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
src/main/java/com/listywave/list/application/dto/response/ListTrandingResponse.java
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
src/main/java/com/listywave/list/application/dto/response/RecommendedListResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.listywave.list.application.dto.response; | ||
|
||
import com.listywave.list.application.domain.item.Item; | ||
import com.listywave.list.application.domain.list.ListEntity; | ||
import lombok.Builder; | ||
|
||
import java.util.List; | ||
|
||
@Builder | ||
public record RecommendedListResponse( | ||
Long id, | ||
Long ownerId, | ||
String ownerNickname, | ||
String title, | ||
String itemImageUrl, | ||
String category, | ||
String backgroundColor, | ||
List<Top3ItemResponse> items | ||
) { | ||
public static RecommendedListResponse of(ListEntity list) { | ||
return RecommendedListResponse.builder() | ||
.id(list.getId()) | ||
.ownerId(list.getUser().getId()) | ||
.ownerNickname(list.getUser().getNickname()) | ||
.title(list.getTitle().getValue()) | ||
.itemImageUrl(list.getRepresentImageUrl()) | ||
.category(list.getCategory().getViewName()) | ||
.backgroundColor(list.getBackgroundColor().name()) | ||
.items(Top3ItemResponse.toList(list.getTop3Items().getValues())) | ||
.build(); | ||
} | ||
|
||
@Builder | ||
public record Top3ItemResponse( | ||
Long id, | ||
int rank, | ||
String title | ||
) { | ||
|
||
public static List<Top3ItemResponse> toList(List<Item> items) { | ||
return items.stream() | ||
.map(Top3ItemResponse::of) | ||
.toList(); | ||
} | ||
|
||
public static Top3ItemResponse of(Item item) { | ||
return Top3ItemResponse.builder() | ||
.id(item.getId()) | ||
.rank(item.getRanking()) | ||
.title(item.getTitle().getValue()) | ||
.build(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.