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 3e623dd2..881f9de8 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 cancelCollect(ListEntity list, Long userId) { 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;