From 1cedf52a82b6936a0a7e5063446cf7e62752c996 Mon Sep 17 00:00:00 2001 From: shortboy7 Date: Wed, 6 Dec 2023 01:02:37 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=A0=84=EC=B2=B4=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=EA=B8=80=20=EB=82=B4=EC=9A=A9=20=EA=B0=80=EC=A0=B8?= =?UTF-8?q?=EC=98=A4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dguonoff/domain/admin/api/BoardController.java | 4 ++-- .../admin/dto/{BoardOutlineDTO.java => BoardTotalDTO.java} | 3 ++- .../dguonoff/domain/admin/service/BoardService.java | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) rename backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/dto/{BoardOutlineDTO.java => BoardTotalDTO.java} (82%) diff --git a/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/api/BoardController.java b/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/api/BoardController.java index a45134a..599e51d 100644 --- a/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/api/BoardController.java +++ b/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/api/BoardController.java @@ -1,7 +1,7 @@ package backend.spectrum.dguonoff.domain.admin.api; import backend.spectrum.dguonoff.domain.admin.dto.BoardDetailDTO; -import backend.spectrum.dguonoff.domain.admin.dto.BoardOutlineDTO; +import backend.spectrum.dguonoff.domain.admin.dto.BoardTotalDTO; import backend.spectrum.dguonoff.domain.admin.service.BoardService; import java.util.List; import lombok.RequiredArgsConstructor; @@ -18,7 +18,7 @@ public class BoardController { private final BoardService boardService; @GetMapping("/") - public ResponseEntity> getOutlines() { + public ResponseEntity> getOutlines() { return ResponseEntity.ok(boardService.getOutlines()); } @GetMapping("/{boardId}") diff --git a/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/dto/BoardOutlineDTO.java b/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/dto/BoardTotalDTO.java similarity index 82% rename from backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/dto/BoardOutlineDTO.java rename to backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/dto/BoardTotalDTO.java index 58f94f6..fe7258d 100644 --- a/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/dto/BoardOutlineDTO.java +++ b/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/dto/BoardTotalDTO.java @@ -7,8 +7,9 @@ @Getter @Builder @AllArgsConstructor -public class BoardOutlineDTO { +public class BoardTotalDTO { private Long boardId; private String title; private String authorId; + private String body; } diff --git a/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/service/BoardService.java b/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/service/BoardService.java index 6847370..ce7f528 100644 --- a/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/service/BoardService.java +++ b/backend/dguonoff/src/main/java/backend/spectrum/dguonoff/domain/admin/service/BoardService.java @@ -4,7 +4,7 @@ import backend.spectrum.dguonoff.DAO.User; import backend.spectrum.dguonoff.DAO.model.Role; import backend.spectrum.dguonoff.domain.admin.dto.BoardDetailDTO; -import backend.spectrum.dguonoff.domain.admin.dto.BoardOutlineDTO; +import backend.spectrum.dguonoff.domain.admin.dto.BoardTotalDTO; import backend.spectrum.dguonoff.domain.admin.dto.PostBoardDTO; import backend.spectrum.dguonoff.domain.admin.repository.BoardRepository; import backend.spectrum.dguonoff.domain.user.exception.UserNotFoundException; @@ -51,11 +51,12 @@ public Long updateBoard(String userId, Long boardId ,PostBoardDTO dto) { } @Transactional(readOnly = true) - public List getOutlines() { - return boardRepository.findAll().stream().map(board -> BoardOutlineDTO.builder() + public List getOutlines() { + return boardRepository.findAll().stream().map(board -> BoardTotalDTO.builder() .boardId(board.getId()) .authorId(board.getAuthor().getId()) .title(board.getTitle()) + .body(board.getBody()) .build() ).collect(Collectors.toList()); }