Skip to content

Commit

Permalink
feat: #137 게시판 DTO 필드 추가(신고함 기능 구현 이후 추가 수정 필요)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyxxgsoo committed Sep 8, 2024
1 parent 6ec61b0 commit b1dd220
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public static class BoardsGetByBoardTypeBoardInfo {
private Integer heartCount;
private Integer commentCount;
private LocalDateTime createAt;
private Boolean liLiked;
private Boolean isMine;
private Boolean isReported;
private Boolean isLiked;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public BoardResponse.BoardsGetByBoardType toBoardsGetByBoardType(
public BoardResponse.BoardsGetByBoardTypeBoardInfo toBoardsGetByBoardTypeBoardInfo(
Board board,
Integer boardHeartsCount,
Boolean isLiked) {
Boolean isLiked,
Boolean isMine,
Boolean isReported) {
return BoardResponse.BoardsGetByBoardTypeBoardInfo.builder()
.boardId(board.getId())
.writerId(board.getWriter().getId())
Expand All @@ -54,6 +56,9 @@ public BoardResponse.BoardsGetByBoardTypeBoardInfo toBoardsGetByBoardTypeBoardIn
.commentCount(board.getCommentCount())
.createAt(board.getCreatedAt())
.isLiked(isLiked)
.isMine(isMine)
// TODO: BoardReport 관련 테이블 구현 후 수정 요망
.isReported(isReported)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public BoardResponse.BoardsGetByBoardType getBoardsByBoardType(Member member, Bo
throw new RestApiException(BoardErrorCode.BOARD_BAD_REQUEST);
}
return boardMapper.toBoardsGetByBoardType(boards.stream()
.map(board -> boardMapper.toBoardsGetByBoardTypeBoardInfo(board, boardHeartRedisRepository.getBoardHeartsCount(board.getId()), boardHeartRedisRepository.isMemberLikedBoard(member.getId(), board.getId())))
// TODO: BoardReport 관련 테이블 구현 후 수정 요망
.map(board -> boardMapper.toBoardsGetByBoardTypeBoardInfo(board, boardHeartRedisRepository.getBoardHeartsCount(board.getId()), boardHeartRedisRepository.isMemberLikedBoard(member.getId(), board.getId()), board.getWriter().getId().equals(member.getId()), false))
.toList()
);
}
Expand Down

0 comments on commit b1dd220

Please sign in to comment.