Skip to content

Commit

Permalink
fix : 운동 가이드 걸음수 칼로리 계산 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
13wjdgk committed Nov 22, 2023
1 parent 8e75955 commit 317d815
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ public GuideResponse createGuide(AnalysisData analysisData) {
walkGuideContent.getGuideLastWeek(), walkGuideContent.getGuideTTS(), exerciseAnalysisData.getUnit());
return exerciseGuideMapper.toResponse(exerciseGuideRepository.save(existExerciseGuide));
}
}
ExerciseCalorie exerciseCalorie = new ExerciseCalorie(exerciseAnalysisData.getType(), exerciseAnalysisData.getCalorie(),
exerciseAnalysisData.getUnit());
//운동 추가
if (!existExerciseGuide.isDuplicateAboutExerciseCalories(exerciseCalorie)) {
existExerciseGuide.changeExerciseCalories(exerciseCalorie);
return exerciseGuideMapper.toResponse(exerciseGuideRepository.save(existExerciseGuide));
} else {
ExerciseCalorie exerciseCalorie = new ExerciseCalorie(exerciseAnalysisData.getType(), exerciseAnalysisData.getCalorie(),
exerciseAnalysisData.getUnit());
//운동 추가
if (!existExerciseGuide.isDuplicateAboutExerciseCalories(exerciseCalorie)) {
existExerciseGuide.changeExerciseCalories(exerciseCalorie);
return exerciseGuideMapper.toResponse(exerciseGuideRepository.save(existExerciseGuide));
}
}
return exerciseGuideMapper.toResponse(existExerciseGuide);
}
Expand Down

0 comments on commit 317d815

Please sign in to comment.