diff --git a/src/main/java/com/unit/daybook/domain/board/dto/request/AddBoardRequestDto.java b/src/main/java/com/unit/daybook/domain/board/dto/request/AddBoardRequestDto.java index 4386ed1..5d42bb0 100644 --- a/src/main/java/com/unit/daybook/domain/board/dto/request/AddBoardRequestDto.java +++ b/src/main/java/com/unit/daybook/domain/board/dto/request/AddBoardRequestDto.java @@ -3,5 +3,5 @@ import java.util.List; -public record AddBoardRequestDto(String content, Long respectBoardId, String category, Long hearts, List hashtags) { +public record AddBoardRequestDto(String content, Long respectBoardId, String category, Long hearts, List hashtags, String paperType) { } \ No newline at end of file diff --git a/src/main/java/com/unit/daybook/domain/board/dto/response/AddBoardResponseDto.java b/src/main/java/com/unit/daybook/domain/board/dto/response/AddBoardResponseDto.java index 00ae743..afb9c90 100644 --- a/src/main/java/com/unit/daybook/domain/board/dto/response/AddBoardResponseDto.java +++ b/src/main/java/com/unit/daybook/domain/board/dto/response/AddBoardResponseDto.java @@ -9,14 +9,16 @@ public record AddBoardResponseDto( String content, Long respectBoardId, Long authorId, + String category, Long hearts, - List hashtags + List hashtags, + String paperType ) { public static AddBoardResponseDto from(Board board) { List hashContents = board.getHashtags().stream().map(hashtag -> hashtag.getContent()).toList(); - return new AddBoardResponseDto(board.getBoardId(), board.getContent(), board.getRespectBoardId(), board.getMemeber().getId(), board.getCategory(), board.getHearts(), hashContents); + return new AddBoardResponseDto(board.getBoardId(), board.getContent(), board.getRespectBoardId(), board.getMemeber().getId(), board.getCategory(), board.getHearts(), hashContents, board.getPaperType()); } } diff --git a/src/main/java/com/unit/daybook/domain/board/dto/response/BoardTmpResponse.java b/src/main/java/com/unit/daybook/domain/board/dto/response/BoardTmpResponse.java index 33d68fe..8aa6210 100644 --- a/src/main/java/com/unit/daybook/domain/board/dto/response/BoardTmpResponse.java +++ b/src/main/java/com/unit/daybook/domain/board/dto/response/BoardTmpResponse.java @@ -13,6 +13,7 @@ public class BoardTmpResponse { private Long authorId; private String category; private Long hearts; + private String papaerType; private List hashtags; @Builder @@ -23,6 +24,7 @@ public BoardTmpResponse(AddBoardResponseDto dto, List hashtags) { this.authorId = dto.authorId(); this.category = dto.category(); this.hearts = dto.hearts(); + this.papaerType = dto.paperType(); this.hashtags = hashtags; } } diff --git a/src/main/java/com/unit/daybook/domain/board/entity/Board.java b/src/main/java/com/unit/daybook/domain/board/entity/Board.java index f7dcf32..4a4691e 100644 --- a/src/main/java/com/unit/daybook/domain/board/entity/Board.java +++ b/src/main/java/com/unit/daybook/domain/board/entity/Board.java @@ -34,6 +34,9 @@ public class Board extends BaseTimeEntity { @JoinColumn(name = "member_id") private Member memeber; + @Column + private String paperType; + @Column private Long hearts; @@ -41,13 +44,14 @@ public class Board extends BaseTimeEntity { private List hashtags = new ArrayList<>(); @Builder(access = AccessLevel.PRIVATE) - public Board(Long boardId, String content, Long respectBoardId, Member member, String category, Long hearts) { + public Board(Long boardId, String content, Long respectBoardId, Member member, String category, Long hearts, String paperType) { this.boardId = boardId; this.content = content; this.respectBoardId = respectBoardId; this.memeber = member; this.category = category; this.hearts = hearts; + this.paperType = paperType; } public static Board createBoard(AddBoardRequestDto addBoardRequestDto, Member member) { @@ -55,6 +59,7 @@ public static Board createBoard(AddBoardRequestDto addBoardRequestDto, Member me .content(addBoardRequestDto.content()) .respectBoardId(addBoardRequestDto.respectBoardId()) .member(member) + .paperType(addBoardRequestDto.paperType()) .category(addBoardRequestDto.category()) .hearts(0L) .build();