From 043f20869e08b6e438eaa04eb633470a67fe6306 Mon Sep 17 00:00:00 2001 From: RyuKwanKon Date: Thu, 25 Jan 2024 22:12:49 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20#67=20post=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20room=20dormitoryType=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/post/dto/response/PostDetailResponseDto.java | 4 ++++ .../checkmate/domain/post/dto/support/PostDetailDto.java | 8 +++++++- .../domain/post/repository/PostCustomRepositoryImpl.java | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gachon/checkmate/domain/post/dto/response/PostDetailResponseDto.java b/src/main/java/org/gachon/checkmate/domain/post/dto/response/PostDetailResponseDto.java index 4df81d9..e61f37c 100644 --- a/src/main/java/org/gachon/checkmate/domain/post/dto/response/PostDetailResponseDto.java +++ b/src/main/java/org/gachon/checkmate/domain/post/dto/response/PostDetailResponseDto.java @@ -12,6 +12,8 @@ public record PostDetailResponseDto( String profile, String gender, String mbti, + String roomType, + String dormitoryType, boolean isScrap, CheckListResponseDto checkList ) { @@ -22,6 +24,8 @@ public static PostDetailResponseDto of(PostDetailDto postDetailDto, CheckListRes .major(postDetailDto.major()) .profile(postDetailDto.profile()) .gender(postDetailDto.gender().getDesc()) + .roomType(postDetailDto.roomType().getDesc()) + .dormitoryType(postDetailDto.dormitoryType().getDesc()) .mbti(postDetailDto.mbti().getDesc()) .isScrap(isScrap) .checkList(checkList) diff --git a/src/main/java/org/gachon/checkmate/domain/post/dto/support/PostDetailDto.java b/src/main/java/org/gachon/checkmate/domain/post/dto/support/PostDetailDto.java index c4f5086..1603a20 100644 --- a/src/main/java/org/gachon/checkmate/domain/post/dto/support/PostDetailDto.java +++ b/src/main/java/org/gachon/checkmate/domain/post/dto/support/PostDetailDto.java @@ -5,22 +5,28 @@ import org.gachon.checkmate.domain.member.entity.GenderType; import org.gachon.checkmate.domain.member.entity.MbtiType; import org.gachon.checkmate.domain.member.entity.ProfileImageType; +import org.gachon.checkmate.domain.post.entity.DormitoryType; +import org.gachon.checkmate.domain.post.entity.RoomType; public record PostDetailDto( Long memberId, String major, MbtiType mbti, GenderType gender, + RoomType roomType, + DormitoryType dormitoryType, String name, String profile, PostCheckList postCheckList ) { @QueryProjection - public PostDetailDto(Long memberId, String major, MbtiType mbti, GenderType gender, String name, String profile, PostCheckList postCheckList) { + public PostDetailDto(Long memberId, String major, MbtiType mbti, GenderType gender, RoomType roomType, DormitoryType dormitoryType, String name, String profile, PostCheckList postCheckList) { this.memberId = memberId; this.major = major; this.mbti = mbti; this.gender = gender; + this.roomType = roomType; + this.dormitoryType = dormitoryType; this.name = name; this.profile = profile; this.postCheckList = postCheckList; diff --git a/src/main/java/org/gachon/checkmate/domain/post/repository/PostCustomRepositoryImpl.java b/src/main/java/org/gachon/checkmate/domain/post/repository/PostCustomRepositoryImpl.java index d182b2b..14bfdf7 100644 --- a/src/main/java/org/gachon/checkmate/domain/post/repository/PostCustomRepositoryImpl.java +++ b/src/main/java/org/gachon/checkmate/domain/post/repository/PostCustomRepositoryImpl.java @@ -33,6 +33,8 @@ public Optional findPostDetail(Long postId) { user.major, user.mbtiType, user.gender, + post.roomType, + post.dormitoryType, user.name, user.profile, post.postCheckList