From ba7a42ebb5966cff081d2998aa1e0643dbd1ec35 Mon Sep 17 00:00:00 2001 From: jinho7 <69239293+jinho7@users.noreply.github.com> Date: Sun, 18 Aug 2024 00:06:07 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Boolean=20isLiked=20?= =?UTF-8?q?=EC=9E=90=EB=A3=8C=ED=98=95=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/board/dto/response/BoardResponseDTO.java | 8 ++++---- .../service/commandService/BoardCommandServiceImpl.java | 2 +- .../board/service/queryService/BoardQueryServiceImpl.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/example/template/domain/board/dto/response/BoardResponseDTO.java b/src/main/java/com/example/template/domain/board/dto/response/BoardResponseDTO.java index 3eb3ffc..53609e2 100644 --- a/src/main/java/com/example/template/domain/board/dto/response/BoardResponseDTO.java +++ b/src/main/java/com/example/template/domain/board/dto/response/BoardResponseDTO.java @@ -30,15 +30,15 @@ public static class BoardDTO { private String content; private Category category; private HelpStatus helpStatus; - private Boolean isAuthor; - private Boolean isLiked; + private boolean isAuthor; + private boolean isLiked; private Integer likeNum; private Integer commentCount; private LocalDateTime createdAt; private LocalDateTime updatedAt; private List images; - public static BoardDTO from(Board board, Long currentMemberId, Boolean isLiked) { + public static BoardDTO from(Board board, Long currentMemberId, boolean isLiked) { return BoardDTO.builder() .id(board.getId()) .memberId(board.getMember().getId()) @@ -100,7 +100,7 @@ public static class BoardLikeDTO { private boolean isLiked; private Integer likeCount; - public static BoardLikeDTO from(Board board, Long currentMemberId, Boolean isLiked) { + public static BoardLikeDTO from(Board board, Long currentMemberId, boolean isLiked) { return BoardLikeDTO.builder() .memberId(currentMemberId) .boardId(board.getId()) diff --git a/src/main/java/com/example/template/domain/board/service/commandService/BoardCommandServiceImpl.java b/src/main/java/com/example/template/domain/board/service/commandService/BoardCommandServiceImpl.java index 1518472..0696ba1 100644 --- a/src/main/java/com/example/template/domain/board/service/commandService/BoardCommandServiceImpl.java +++ b/src/main/java/com/example/template/domain/board/service/commandService/BoardCommandServiceImpl.java @@ -133,7 +133,7 @@ public BoardResponseDTO.BoardDTO updateBoard(Long boardId, } } Board updatedBoard = boardRepository.save(board); - Boolean isLiked = boardLikeRepository.existsByMemberAndBoard(member, updatedBoard); + boolean isLiked = boardLikeRepository.existsByMemberAndBoard(member, updatedBoard); return BoardResponseDTO.BoardDTO.from(updatedBoard, member.getId(), isLiked); } diff --git a/src/main/java/com/example/template/domain/board/service/queryService/BoardQueryServiceImpl.java b/src/main/java/com/example/template/domain/board/service/queryService/BoardQueryServiceImpl.java index 6e7ee6c..9dca891 100644 --- a/src/main/java/com/example/template/domain/board/service/queryService/BoardQueryServiceImpl.java +++ b/src/main/java/com/example/template/domain/board/service/queryService/BoardQueryServiceImpl.java @@ -42,7 +42,7 @@ public BoardResponseDTO.BoardDTO getBoardDetail(Long boardId, Member member) { Board board = boardRepository.findById(boardId) .orElseThrow(() -> new BoardException(BoardErrorCode.BOARD_NOT_FOUND)); - Boolean isLiked = boardLikeRepository.existsByMemberAndBoard(member, board); + boolean isLiked = boardLikeRepository.existsByMemberAndBoard(member, board); return BoardResponseDTO.BoardDTO.from(board, member.getId(), isLiked); }