Skip to content

Commit

Permalink
feat: 도란도란 리스트 조회 response 카테고리 데이터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
soyeonii committed Oct 11, 2023
1 parent a70c673 commit 71e2638
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/makive/moumi/model/dto/DorandoranDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;

@Getter
@Builder
Expand All @@ -16,13 +17,17 @@
public class DorandoranDTO {
private Long id;
private String title;
private List<String> category;
private List<String> images;
private LocalDate uploadDate;

public static DorandoranDTO fromDorandoran(Dorandoran dorandoran) {
return DorandoranDTO.builder()
.id(dorandoran.getId())
.title(dorandoran.getTitle())
.category(dorandoran.getDorandoranCategories().stream()
.map(dorandoranCategory -> dorandoranCategory.getCategory().getName())
.collect(Collectors.toList()))
.images(dorandoran.getImages())
.uploadDate(dorandoran.getUploadDate())
.build();
Expand Down

0 comments on commit 71e2638

Please sign in to comment.