From 3f2296d67750e4c0b6d4f2e9efeb036bf18f3ba9 Mon Sep 17 00:00:00 2001 From: bongsh0112 Date: Tue, 19 Dec 2023 23:58:58 +0900 Subject: [PATCH] =?UTF-8?q?edit=20:=20=EC=9C=A0=EC=A0=80=EC=9D=98=20?= =?UTF-8?q?=EC=B7=A8=ED=96=A5=20=EB=8B=B5=EB=B3=80=20=EC=97=AC=EB=B6=80=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20API=20=EB=A1=9C=EC=A7=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(=EC=86=8C=EB=B6=84=EB=A5=98=EC=97=90=20=EB=8C=80?= =?UTF-8?q?=ED=95=9C=20=EB=8B=B5=EB=B3=80=EC=9D=B4=20=ED=95=98=EB=82=98?= =?UTF-8?q?=EB=9D=BC=EB=8F=84=20=EC=9E=88=EC=9D=84=20=EC=8B=9C=20=EC=A4=91?= =?UTF-8?q?=EB=B6=84=EB=A5=98=EC=97=90=20=EB=8B=B5=EB=B3=80=ED=96=88?= =?UTF-8?q?=EB=8B=A4=EA=B3=A0=20=EA=B0=84=EC=A3=BC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/RetrieveIsAnsweredUseCase.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Api/src/main/java/tify/server/api/question/service/RetrieveIsAnsweredUseCase.java b/Api/src/main/java/tify/server/api/question/service/RetrieveIsAnsweredUseCase.java index 582797bc..b9c739de 100644 --- a/Api/src/main/java/tify/server/api/question/service/RetrieveIsAnsweredUseCase.java +++ b/Api/src/main/java/tify/server/api/question/service/RetrieveIsAnsweredUseCase.java @@ -42,18 +42,12 @@ public List retrieveIsAnsweredBySmallCategory() { favorAnswerCategoryDTOs.stream() .filter(dto -> dto.getSmallCategory().equals(smallCategory)) .toList() - .size(); // smallCategory와 같은 smallCategory를 가지는 favorAnswerCategoryDTO의 - // 개수 - int size = - favorQuestionCategories.stream() - .filter(category -> category.getSmallCategory().equals(smallCategory)) - .toList() - .size(); // smallCategory와 같은 smallCategory를 가지는 detailCategory의 개수 + .size(); + // smallCategory와 같은 smallCategory를 가지는 favorAnswerCategoryDTO의 개수 categoryIsAnsweredDTOS.add( - RetrieveCategoryIsAnsweredDTO.of( - smallCategory, userAnswerCategorySize == size)); - // 두 size가 같으면 true, 아니면 false + RetrieveCategoryIsAnsweredDTO.of(smallCategory, userAnswerCategorySize > 0)); + // smallCategory를 중분류로 가지는 DetailCategory에 대한 취향 답변이 된 set이 하나라도 있다면 true } return categoryIsAnsweredDTOS;