From 6a297b246eb0e5ba8073ae302236fc576a820e14 Mon Sep 17 00:00:00 2001 From: Seoyoung2222 Date: Tue, 3 Dec 2024 15:12:18 +0900 Subject: [PATCH] =?UTF-8?q?BE:=20[feat]=20=EA=B0=A4=EB=9F=AC=EB=A6=AC=20?= =?UTF-8?q?=ED=94=84=EB=A6=AC=EB=B7=B0=20=EB=82=B4=EC=9A=A9=20=EB=B0=98?= =?UTF-8?q?=ED=99=98=20#83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/crew/post/gallery/dto/GallerySimpleResponseDto.java | 1 + .../crew/post/gallery/service/GalleryPostQueryService.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/gallery/dto/GallerySimpleResponseDto.java b/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/gallery/dto/GallerySimpleResponseDto.java index cbad8357..9b9cf9dd 100644 --- a/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/gallery/dto/GallerySimpleResponseDto.java +++ b/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/gallery/dto/GallerySimpleResponseDto.java @@ -11,4 +11,5 @@ public class GallerySimpleResponseDto { private Long postId; private String imageUrl; + private String content; } diff --git a/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/gallery/service/GalleryPostQueryService.java b/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/gallery/service/GalleryPostQueryService.java index fe8c2931..2f873643 100644 --- a/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/gallery/service/GalleryPostQueryService.java +++ b/src/backend/src/main/java/RunningMachines/R2R/domain/crew/post/gallery/service/GalleryPostQueryService.java @@ -61,6 +61,9 @@ public GalleryPreviewResponseDto getGalleryPreview(Long crewId) { .map(post -> GallerySimpleResponseDto.builder() .postId(post.getId()) .imageUrl(post.getImages().get(0).getImageUrl()) + .content(post.getContent() != null && post.getContent().length() > 30 + ? post.getContent().substring(0, 20) + "..." + : post.getContent()) .build()) .collect(Collectors.toList());