From b1dd2207fb1fd0d1edb251d00131d65533475fe4 Mon Sep 17 00:00:00 2001 From: KyungsooLee Date: Sun, 8 Sep 2024 16:50:17 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20#137=20=EA=B2=8C=EC=8B=9C=ED=8C=90=20DT?= =?UTF-8?q?O=20=ED=95=84=EB=93=9C=20=EC=B6=94=EA=B0=80(=EC=8B=A0=EA=B3=A0?= =?UTF-8?q?=ED=95=A8=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84=20=EC=9D=B4?= =?UTF-8?q?=ED=9B=84=20=EC=B6=94=EA=B0=80=20=EC=88=98=EC=A0=95=20=ED=95=84?= =?UTF-8?q?=EC=9A=94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/server/capple/domain/board/dto/BoardResponse.java | 3 +++ .../com/server/capple/domain/board/mapper/BoardMapper.java | 7 ++++++- .../capple/domain/board/service/BoardServiceImpl.java | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/server/capple/domain/board/dto/BoardResponse.java b/src/main/java/com/server/capple/domain/board/dto/BoardResponse.java index e4286499..2ab95bc9 100644 --- a/src/main/java/com/server/capple/domain/board/dto/BoardResponse.java +++ b/src/main/java/com/server/capple/domain/board/dto/BoardResponse.java @@ -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; } diff --git a/src/main/java/com/server/capple/domain/board/mapper/BoardMapper.java b/src/main/java/com/server/capple/domain/board/mapper/BoardMapper.java index cd1a2134..e53377a1 100644 --- a/src/main/java/com/server/capple/domain/board/mapper/BoardMapper.java +++ b/src/main/java/com/server/capple/domain/board/mapper/BoardMapper.java @@ -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()) @@ -54,6 +56,9 @@ public BoardResponse.BoardsGetByBoardTypeBoardInfo toBoardsGetByBoardTypeBoardIn .commentCount(board.getCommentCount()) .createAt(board.getCreatedAt()) .isLiked(isLiked) + .isMine(isMine) + // TODO: BoardReport 관련 테이블 구현 후 수정 요망 + .isReported(isReported) .build(); } diff --git a/src/main/java/com/server/capple/domain/board/service/BoardServiceImpl.java b/src/main/java/com/server/capple/domain/board/service/BoardServiceImpl.java index b7876968..b9289921 100644 --- a/src/main/java/com/server/capple/domain/board/service/BoardServiceImpl.java +++ b/src/main/java/com/server/capple/domain/board/service/BoardServiceImpl.java @@ -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() ); }