From 5c0bb4ae237e728ca8590b6b893631c07fde6e84 Mon Sep 17 00:00:00 2001 From: nayonsoso Date: Sat, 14 Dec 2024 03:17:47 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=EC=9E=98=EB=AA=BB=EB=90=9C=20?= =?UTF-8?q?=EC=BA=90=EC=8B=9C=20=ED=82=A4=20=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/reviewme/template/service/mapper/TemplateMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java b/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java index 5225bd7e6..0cf110739 100644 --- a/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java +++ b/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java @@ -39,7 +39,7 @@ public class TemplateMapper { private final OptionGroupRepository optionGroupRepository; private final OptionItemRepository optionItemRepository; - @Cacheable(value = "template_response", key = "#reviewGroup.templateId") + @Cacheable(value = "template_response", key = "#reviewGroup.reviewRequestCode") public TemplateResponse mapToTemplateResponse(ReviewGroup reviewGroup) { Template template = templateRepository.findById(reviewGroup.getTemplateId()) .orElseThrow(() -> new TemplateNotFoundByReviewGroupException( From 68ee45cfee3ea710fd61f7b93bf47200a0822d7a Mon Sep 17 00:00:00 2001 From: nayonsoso Date: Sat, 14 Dec 2024 05:23:59 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=EC=9E=98=EB=AA=BB=EB=90=9C=20?= =?UTF-8?q?=EC=BA=90=EC=8B=9C=20=ED=82=A4=20=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - reviewGroupId 로 --- .../java/reviewme/template/service/mapper/TemplateMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java b/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java index 0cf110739..9ff6d3bc6 100644 --- a/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java +++ b/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java @@ -39,7 +39,7 @@ public class TemplateMapper { private final OptionGroupRepository optionGroupRepository; private final OptionItemRepository optionItemRepository; - @Cacheable(value = "template_response", key = "#reviewGroup.reviewRequestCode") + @Cacheable(value = "template_response", key = "#reviewGroup.id") public TemplateResponse mapToTemplateResponse(ReviewGroup reviewGroup) { Template template = templateRepository.findById(reviewGroup.getTemplateId()) .orElseThrow(() -> new TemplateNotFoundByReviewGroupException( From d9386a1686dfa4d2027c8872c34387dd14b7d798 Mon Sep 17 00:00:00 2001 From: nayonsoso Date: Tue, 17 Dec 2024 01:26:56 +0900 Subject: [PATCH 3/3] =?UTF-8?q?refactor:=20cache=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/service/mapper/TemplateMapper.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java b/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java index 9ff6d3bc6..41f003e8c 100644 --- a/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java +++ b/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java @@ -2,19 +2,18 @@ import java.util.List; import lombok.RequiredArgsConstructor; -import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Component; +import reviewme.reviewgroup.domain.ReviewGroup; import reviewme.template.domain.OptionGroup; import reviewme.template.domain.OptionItem; import reviewme.template.domain.Question; -import reviewme.template.repository.OptionGroupRepository; -import reviewme.template.repository.OptionItemRepository; -import reviewme.template.repository.QuestionRepository; -import reviewme.reviewgroup.domain.ReviewGroup; import reviewme.template.domain.Section; import reviewme.template.domain.SectionQuestion; import reviewme.template.domain.Template; import reviewme.template.domain.TemplateSection; +import reviewme.template.repository.OptionGroupRepository; +import reviewme.template.repository.OptionItemRepository; +import reviewme.template.repository.QuestionRepository; import reviewme.template.repository.SectionRepository; import reviewme.template.repository.TemplateRepository; import reviewme.template.service.dto.response.OptionGroupResponse; @@ -39,7 +38,6 @@ public class TemplateMapper { private final OptionGroupRepository optionGroupRepository; private final OptionItemRepository optionItemRepository; - @Cacheable(value = "template_response", key = "#reviewGroup.id") public TemplateResponse mapToTemplateResponse(ReviewGroup reviewGroup) { Template template = templateRepository.findById(reviewGroup.getTemplateId()) .orElseThrow(() -> new TemplateNotFoundByReviewGroupException(