From 3de5741bb3ae31ca1578cf8cff1d9567762e4662 Mon Sep 17 00:00:00 2001 From: pparkjs Date: Fri, 25 Oct 2024 20:04:39 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=98=EC=9D=98=20=EC=BD=9C=EB=A0=89?= =?UTF-8?q?=EC=85=98=20=EC=A1=B0=ED=9A=8C=20=EC=9D=91=EB=8B=B5=EC=97=90=20?= =?UTF-8?q?=ED=8F=B4=EB=8D=94=20=EC=9D=B4=EB=A6=84=EB=8F=84=20=EC=9D=91?= =?UTF-8?q?=EB=8B=B5=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/dto/CollectionResponse.java | 12 +++++++++--- .../application/service/CollectionService.java | 4 ++-- .../custom/impl/CustomCollectionRepositoryImpl.java | 1 - 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/listywave/collection/application/dto/CollectionResponse.java b/src/main/java/com/listywave/collection/application/dto/CollectionResponse.java index 4588ff72..3e55e35d 100644 --- a/src/main/java/com/listywave/collection/application/dto/CollectionResponse.java +++ b/src/main/java/com/listywave/collection/application/dto/CollectionResponse.java @@ -10,11 +10,17 @@ public record CollectionResponse( Long cursorId, Boolean hasNext, - List collectionLists + List collectionLists, + String folderName ) { - public static CollectionResponse of(Long cursorId, Boolean hasNext, List collects) { - return new CollectionResponse(cursorId, hasNext, toList(collects)); + public static CollectionResponse of( + Long cursorId, + Boolean hasNext, + List collects, + String folderName + ) { + return new CollectionResponse(cursorId, hasNext, toList(collects), folderName); } public static List toList(List collects) { diff --git a/src/main/java/com/listywave/collection/application/service/CollectionService.java b/src/main/java/com/listywave/collection/application/service/CollectionService.java index cb2fba37..a2ea3389 100644 --- a/src/main/java/com/listywave/collection/application/service/CollectionService.java +++ b/src/main/java/com/listywave/collection/application/service/CollectionService.java @@ -62,7 +62,7 @@ private void addCollect(ListEntity list, User user, Folder folder) { public CollectionResponse getCollection(Long loginUserId, Long cursorId, Pageable pageable, Long folderId) { User user = userRepository.getById(loginUserId); - folderRepository.getById(folderId); + Folder folder = folderRepository.getById(folderId); Slice result = collectionRepository.getAllCollectionList(cursorId, pageable, user.getId(), folderId); List collectionList = result.getContent(); @@ -70,7 +70,7 @@ public CollectionResponse getCollection(Long loginUserId, Long cursorId, Pageabl if (!collectionList.isEmpty()) { cursorId = collectionList.get(collectionList.size() - 1).getId(); } - return CollectionResponse.of(cursorId, result.hasNext(), collectionList); + return CollectionResponse.of(cursorId, result.hasNext(), collectionList, folder.getFolderName()); } public List getCategoriesOfCollection(Long loginUserId) { diff --git a/src/main/java/com/listywave/collection/repository/custom/impl/CustomCollectionRepositoryImpl.java b/src/main/java/com/listywave/collection/repository/custom/impl/CustomCollectionRepositoryImpl.java index c2d4d864..ad5289c0 100644 --- a/src/main/java/com/listywave/collection/repository/custom/impl/CustomCollectionRepositoryImpl.java +++ b/src/main/java/com/listywave/collection/repository/custom/impl/CustomCollectionRepositoryImpl.java @@ -2,7 +2,6 @@ import static com.listywave.collection.application.domain.QCollect.collect; import static com.listywave.common.util.PaginationUtils.checkEndPage; -import static com.listywave.list.application.domain.category.CategoryType.ENTIRE; import static com.listywave.list.application.domain.item.QItem.item; import static com.listywave.list.application.domain.list.QListEntity.listEntity; import static com.listywave.user.application.domain.QUser.user;