From 443fe47a0972ab2f786d88f40b4145b85aed86ce Mon Sep 17 00:00:00 2001 From: "DESKTOP-N5KD4EV\\litte" Date: Tue, 30 Sep 2025 18:01:44 +0900 Subject: [PATCH] =?UTF-8?q?hotfix/OPS-346=20:=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/archive/folder/service/FolderService.java | 8 ++++++-- .../backend/domain/datasource/dto/FileSummary.java | 6 +++--- .../zoopzoop/backend/domain/news/service/NewsService.java | 6 ++++-- .../domain/archive/folder/service/FolderServiceTest.java | 2 +- .../space/space/controller/ApiV1SpaceControllerTest.java | 1 - 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/tuna/zoopzoop/backend/domain/archive/folder/service/FolderService.java b/src/main/java/org/tuna/zoopzoop/backend/domain/archive/folder/service/FolderService.java index 2f07f53f..c9a7967a 100644 --- a/src/main/java/org/tuna/zoopzoop/backend/domain/archive/folder/service/FolderService.java +++ b/src/main/java/org/tuna/zoopzoop/backend/domain/archive/folder/service/FolderService.java @@ -16,6 +16,7 @@ import org.tuna.zoopzoop.backend.domain.datasource.repository.DataSourceRepository; import org.tuna.zoopzoop.backend.domain.member.entity.Member; import org.tuna.zoopzoop.backend.domain.member.repository.MemberRepository; +import org.tuna.zoopzoop.backend.domain.datasource.entity.Tag; import java.util.HashSet; import java.util.List; @@ -184,8 +185,11 @@ public FolderFilesDto getFilesInFolderForPersonal(Integer memberId, Integer fold ds.getSummary(), ds.getSourceUrl(), ds.getImageUrl(), - ds.getTags() == null ? List.of() : ds.getTags(), - ds.getCategory() == null ? null : ds.getCategory().toString() + ds.getTags() == null ? List.of() + : ds.getTags().stream() + .map(Tag::getTagName) + .toList(), + ds.getCategory() == null ? null : ds.getCategory().name() )) .toList(); diff --git a/src/main/java/org/tuna/zoopzoop/backend/domain/datasource/dto/FileSummary.java b/src/main/java/org/tuna/zoopzoop/backend/domain/datasource/dto/FileSummary.java index 66c9857a..8d90a415 100644 --- a/src/main/java/org/tuna/zoopzoop/backend/domain/datasource/dto/FileSummary.java +++ b/src/main/java/org/tuna/zoopzoop/backend/domain/datasource/dto/FileSummary.java @@ -1,7 +1,5 @@ package org.tuna.zoopzoop.backend.domain.datasource.dto; -import org.tuna.zoopzoop.backend.domain.datasource.entity.Tag; - import java.time.LocalDate; import java.util.List; @@ -12,6 +10,8 @@ public record FileSummary( String summary, String sourceUrl, String imageUrl, - List tags, + List tags, String category ) {} + + diff --git a/src/main/java/org/tuna/zoopzoop/backend/domain/news/service/NewsService.java b/src/main/java/org/tuna/zoopzoop/backend/domain/news/service/NewsService.java index 440a3476..4ef7b5d2 100644 --- a/src/main/java/org/tuna/zoopzoop/backend/domain/news/service/NewsService.java +++ b/src/main/java/org/tuna/zoopzoop/backend/domain/news/service/NewsService.java @@ -22,8 +22,10 @@ public List getTagFrequencyFromFiles(Integer memberId, Integer folderId) List files = folderFilesDto.files(); Map tags = files.stream() - .flatMap(file -> file.tags().stream()) - .map(tag -> tag.getTagName()) + .flatMap(file -> { + List ts = file.tags(); + return (ts == null ? List.of() : ts).stream(); + }) .collect(Collectors.groupingBy( tagName -> tagName, Collectors.counting() diff --git a/src/test/java/org/tuna/zoopzoop/backend/domain/archive/folder/service/FolderServiceTest.java b/src/test/java/org/tuna/zoopzoop/backend/domain/archive/folder/service/FolderServiceTest.java index 54e8dc5a..2d5da3dc 100644 --- a/src/test/java/org/tuna/zoopzoop/backend/domain/archive/folder/service/FolderServiceTest.java +++ b/src/test/java/org/tuna/zoopzoop/backend/domain/archive/folder/service/FolderServiceTest.java @@ -298,7 +298,7 @@ void getFilesInFolderForPersonal_success() { assertThat(f0.summary()).isEqualTo("요약 A"); assertThat(f0.sourceUrl()).isEqualTo("http://src/a"); assertThat(f0.imageUrl()).isEqualTo("http://img/a"); - assertThat(f0.tags()).extracting(Tag::getTagName).containsExactly("tag1", "tag2"); + assertThat(f0.tags()).containsExactly("tag1", "tag2"); } @Test diff --git a/src/test/java/org/tuna/zoopzoop/backend/domain/space/space/controller/ApiV1SpaceControllerTest.java b/src/test/java/org/tuna/zoopzoop/backend/domain/space/space/controller/ApiV1SpaceControllerTest.java index 2641cef5..6bca9b02 100644 --- a/src/test/java/org/tuna/zoopzoop/backend/domain/space/space/controller/ApiV1SpaceControllerTest.java +++ b/src/test/java/org/tuna/zoopzoop/backend/domain/space/space/controller/ApiV1SpaceControllerTest.java @@ -8,7 +8,6 @@ import org.springframework.security.test.context.support.WithUserDetails; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.ResultActions; -import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.tuna.zoopzoop.backend.domain.member.enums.Provider; import org.tuna.zoopzoop.backend.domain.member.service.MemberService;