Skip to content

Commit

Permalink
fix: boards 응답 형태수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Beakjiyeon committed Apr 6, 2024
1 parent 2acf9b4 commit f33439e
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.unit.daybook.domain.board.dto.response;

import java.time.LocalDateTime;
import java.util.List;

import com.unit.daybook.domain.board.entity.Board;

Expand All @@ -10,9 +11,11 @@ public record FindBoardResponse(
Long respectBoardId,
Long authorId,
String category,

Long hearts,
String paperType,
LocalDateTime createdAt
LocalDateTime createdAt,
List<String> hashtags
) {
public static FindBoardResponse from(Board board) {
return new FindBoardResponse(
Expand All @@ -23,7 +26,8 @@ public static FindBoardResponse from(Board board) {
board.getCategory(),
board.getHearts(),
board.getPaperType(),
board.getCreatedAt()
board.getCreatedAt(),
board.getHashtags().stream().map(h->h.getContent()).toList()
);
}
}

0 comments on commit f33439e

Please sign in to comment.