From 9f7f3730a0c2b250690a06c917eeb9ac7fd8f9a5 Mon Sep 17 00:00:00 2001 From: LeeJiSoo Date: Sun, 18 Aug 2024 20:16:38 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[FEAT]=20=EC=A3=BC=EC=A0=9C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EC=A1=B0=ED=9A=8C=20=EC=9D=91=EB=8B=B5=EC=8B=9C=20?= =?UTF-8?q?=EC=A3=BC=EC=A0=9CID=EA=B0=92=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mvp/ns/domain/theme/dto/response/ThemeDetailRes.java | 5 ++++- .../java/depth/mvp/ns/domain/theme/service/ThemeService.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/depth/mvp/ns/domain/theme/dto/response/ThemeDetailRes.java b/src/main/java/depth/mvp/ns/domain/theme/dto/response/ThemeDetailRes.java index 758dd05..f05bbe8 100644 --- a/src/main/java/depth/mvp/ns/domain/theme/dto/response/ThemeDetailRes.java +++ b/src/main/java/depth/mvp/ns/domain/theme/dto/response/ThemeDetailRes.java @@ -14,16 +14,19 @@ public class ThemeDetailRes { private PageInfo pageInfo; // 페이지 정보 private Long userId; // 사용자ID private boolean likedTheme; // 주제 좋아요 여부 + private Long themeId; // 주제ID private String content; // 주제 내용 private String date; // 발행일 private int likeCount; // 주제 좋아요 수 private List boards; // 게시글 목록 @Builder - public ThemeDetailRes(PageInfo pageInfo, Long userId, boolean likedTheme, String content, LocalDate date, int likeCount, List boards){ + public ThemeDetailRes(PageInfo pageInfo, Long userId, boolean likedTheme, Long themeId, + String content, LocalDate date, int likeCount, List boards){ this.pageInfo = pageInfo; this.userId = userId; this.likedTheme = likedTheme; + this.themeId = themeId; this.content = content; this.date = date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd")); this.likeCount = likeCount; diff --git a/src/main/java/depth/mvp/ns/domain/theme/service/ThemeService.java b/src/main/java/depth/mvp/ns/domain/theme/service/ThemeService.java index 5bc8fac..a1966d1 100644 --- a/src/main/java/depth/mvp/ns/domain/theme/service/ThemeService.java +++ b/src/main/java/depth/mvp/ns/domain/theme/service/ThemeService.java @@ -213,6 +213,7 @@ public ResponseEntity getThemeDetail(Long themeId, String sortBy, Pageable pa .pageInfo(pageInfo) .userId(userId) .likedTheme(likedTheme) + .themeId(theme.getId()) .content(theme.getContent()) .date(theme.getDate()) .likeCount(themeRepository.countLikesByThemeId(themeId)) From 9915608b864234d6528d056212478846799aea77 Mon Sep 17 00:00:00 2001 From: LeeJiSoo Date: Sun, 18 Aug 2024 20:39:32 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[FEAT]=20=EA=B8=80=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=EC=8B=9C=20=EC=A3=BC=EC=A0=9CID=EA=B0=92=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mvp/ns/domain/board/dto/response/BoardDetailRes.java | 4 +++- .../java/depth/mvp/ns/domain/board/service/BoardService.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/depth/mvp/ns/domain/board/dto/response/BoardDetailRes.java b/src/main/java/depth/mvp/ns/domain/board/dto/response/BoardDetailRes.java index 5912604..17d53e6 100644 --- a/src/main/java/depth/mvp/ns/domain/board/dto/response/BoardDetailRes.java +++ b/src/main/java/depth/mvp/ns/domain/board/dto/response/BoardDetailRes.java @@ -14,19 +14,21 @@ public class BoardDetailRes { private boolean likedTheme; // 주제 좋아요 여부 private String nickname; // 작성자 닉네임 private String imageUrl; // 작성자 프사 + private Long themeId; // 주제ID private String themeContent; // 주제 내용 private String boardTitle; // 게시글 제목 private String boardContent; // 게시글 내용 @Builder public BoardDetailRes(Long userId, boolean owner, boolean likedBoard, boolean likedTheme, String nickname, - String imageUrl, String themeContent, String boardTitle, String boardContent){ + String imageUrl, Long themeId, String themeContent, String boardTitle, String boardContent){ this.userId = userId; this.owner = owner; this.likedBoard = likedBoard; this.likedTheme = likedTheme; this.nickname = nickname; this.imageUrl = imageUrl; + this.themeId = themeId; this.themeContent = themeContent; this.boardTitle = boardTitle; this.boardContent = boardContent; diff --git a/src/main/java/depth/mvp/ns/domain/board/service/BoardService.java b/src/main/java/depth/mvp/ns/domain/board/service/BoardService.java index 1676cf1..412910a 100644 --- a/src/main/java/depth/mvp/ns/domain/board/service/BoardService.java +++ b/src/main/java/depth/mvp/ns/domain/board/service/BoardService.java @@ -301,6 +301,7 @@ public ResponseEntity getBoardDetail(Long boardId, CustomUserDetails customUs .likedTheme(likedTheme) .nickname(board.getUser().getNickname()) .imageUrl(board.getUser().getImageUrl()) + .themeId(theme.getId()) .themeContent(board.getTheme().getContent()) .boardTitle(board.getTitle()) .boardContent(board.getContent())