Skip to content

Commit

Permalink
refactor : WeightGuide MongoTemplate로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
13wjdgk committed Oct 16, 2023
1 parent 3207df7 commit 8caf3a3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;

/**
* 체중 가이드를 생성한다.
Expand All @@ -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));
}

/**
Expand Down

0 comments on commit 8caf3a3

Please sign in to comment.