From 5e9462cd04f3268855c23b77ea50dbff9e32badb Mon Sep 17 00:00:00 2001 From: hseoky desktop Date: Sat, 18 Jan 2025 01:10:22 +0900 Subject: [PATCH] =?UTF-8?q?[#543]=20fix:=20=EC=B0=9C=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeju/nanaland/domain/common/dto/PostPreviewDto.java | 9 +++++++++ .../experience/repository/ExperienceRepositoryImpl.java | 1 + .../domain/experience/service/ExperienceService.java | 2 -- .../domain/member/controller/MemberController.java | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/jeju/nanaland/domain/common/dto/PostPreviewDto.java b/src/main/java/com/jeju/nanaland/domain/common/dto/PostPreviewDto.java index 567c49cf..b8f275d1 100644 --- a/src/main/java/com/jeju/nanaland/domain/common/dto/PostPreviewDto.java +++ b/src/main/java/com/jeju/nanaland/domain/common/dto/PostPreviewDto.java @@ -33,6 +33,15 @@ public PostPreviewDto(Long id, String title, String originUrl, String thumbnailU this.firstImage = new ImageFileDto(originUrl, thumbnailUrl); } + @QueryProjection + public PostPreviewDto(Long id, String title, String category, String originUrl, + String thumbnailUrl) { + this.id = id; + this.title = title; + this.category = category; + this.firstImage = new ImageFileDto(originUrl, thumbnailUrl); + } + public PostPreviewDto(PostPreviewDto postPreviewDto) { this.id = postPreviewDto.getId(); this.title = postPreviewDto.getTitle(); diff --git a/src/main/java/com/jeju/nanaland/domain/experience/repository/ExperienceRepositoryImpl.java b/src/main/java/com/jeju/nanaland/domain/experience/repository/ExperienceRepositoryImpl.java index 031924fd..e64ae86e 100644 --- a/src/main/java/com/jeju/nanaland/domain/experience/repository/ExperienceRepositoryImpl.java +++ b/src/main/java/com/jeju/nanaland/domain/experience/repository/ExperienceRepositoryImpl.java @@ -359,6 +359,7 @@ public PostPreviewDto findPostPreviewDto(Long postId, Language language) { .select(new QPostPreviewDto( experience.id, experienceTrans.title, + experience.experienceType.stringValue(), imageFile.originUrl, imageFile.thumbnailUrl )) diff --git a/src/main/java/com/jeju/nanaland/domain/experience/service/ExperienceService.java b/src/main/java/com/jeju/nanaland/domain/experience/service/ExperienceService.java index 0cb17a55..5409451e 100644 --- a/src/main/java/com/jeju/nanaland/domain/experience/service/ExperienceService.java +++ b/src/main/java/com/jeju/nanaland/domain/experience/service/ExperienceService.java @@ -5,7 +5,6 @@ import com.jeju.nanaland.domain.common.data.AddressTag; import com.jeju.nanaland.domain.common.data.Category; import com.jeju.nanaland.domain.common.data.Language; -import com.jeju.nanaland.domain.common.data.PostCategory; import com.jeju.nanaland.domain.common.dto.ImageFileDto; import com.jeju.nanaland.domain.common.dto.PostPreviewDto; import com.jeju.nanaland.domain.common.entity.Post; @@ -79,7 +78,6 @@ public PostPreviewDto getPostPreviewDto(Long postId, Category category, Language Optional.ofNullable(postPreviewDto) .orElseThrow(() -> new NotFoundException("해당 게시물을 찾을 수 없습니다.")); - postPreviewDto.setCategory(PostCategory.EXPERIENCE.toString()); return postPreviewDto; } diff --git a/src/main/java/com/jeju/nanaland/domain/member/controller/MemberController.java b/src/main/java/com/jeju/nanaland/domain/member/controller/MemberController.java index 3f0d1016..10c930d3 100644 --- a/src/main/java/com/jeju/nanaland/domain/member/controller/MemberController.java +++ b/src/main/java/com/jeju/nanaland/domain/member/controller/MemberController.java @@ -180,8 +180,8 @@ public BaseResponse> getPopularPosts( } @Operation( - summary = "랜덤 추천 게시물 2개 반환", - description = "홈에서 보여질 랜덤 추천 게시물 2개 반환") + summary = "랜덤 추천 게시물 3개 반환", + description = "홈에서 보여질 랜덤 추천 게시물 3개 반환") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "성공"), @ApiResponse(responseCode = "400", description = "결과 타입에 없는 값으로 요청", content = @Content),