From 8caf3a366bd62eca0a8fd1fa84ebdd04d2d0f0de Mon Sep 17 00:00:00 2001 From: 13wjdgk <13wjdgk@naver.com> Date: Mon, 16 Oct 2023 18:47:12 +0900 Subject: [PATCH] =?UTF-8?q?refactor=20:=20WeightGuide=20MongoTemplate?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../guide/weight/service/WeightGuideGenerateService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/coniverse/dangjang/domain/guide/weight/service/WeightGuideGenerateService.java b/src/main/java/com/coniverse/dangjang/domain/guide/weight/service/WeightGuideGenerateService.java index 8d6f8b6b..dc4d8daf 100644 --- a/src/main/java/com/coniverse/dangjang/domain/guide/weight/service/WeightGuideGenerateService.java +++ b/src/main/java/com/coniverse/dangjang/domain/guide/weight/service/WeightGuideGenerateService.java @@ -1,5 +1,6 @@ package com.coniverse.dangjang.domain.guide.weight.service; +import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.stereotype.Service; import com.coniverse.dangjang.domain.analysis.dto.AnalysisData; @@ -25,6 +26,7 @@ public class WeightGuideGenerateService implements GuideGenerateService { private final WeightGuideSearchService weightGuideSearchService; private final WeightGuideRepository weightGuideRepository; private final WeightMapper weightMapper; + private final MongoTemplate mongoTemplate; /** * 체중 가이드를 생성한다. @@ -38,7 +40,7 @@ public GuideResponse createGuide(AnalysisData analysisData) { WeightAnalysisData data = (WeightAnalysisData)analysisData; String content = createContent(data); WeightGuide weightGuide = weightMapper.toDocument(data, content); - return weightMapper.toResponse(weightGuideRepository.save(weightGuide)); + return weightMapper.toResponse(mongoTemplate.save(weightGuide)); } /**