Skip to content

Commit

Permalink
Merge pull request #347 from LearnsMate/feature/config
Browse files Browse the repository at this point in the history
♻️ 코드 수정 : 강의 endYear, endMonth 일부 필터링 오류 확인을 위해 로그 추가
  • Loading branch information
YuJeeun authored Dec 10, 2024
2 parents e446254 + 45e28c2 commit 2c6ff12
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,19 @@ public ResponseFindLectureDetailVO getLectureDetailsWithConversionRates(String l
.build();
}

private double calculateConversionRate(int clickCount, int purchaseCount) {
if (clickCount == 0) {
private double calculateConversionRate(Integer clickCount, Integer purchaseCount) {
if (clickCount == null || clickCount == 0 || purchaseCount == null) {
return 0.0;
}
return (double) purchaseCount / clickCount * 100;
}

public LectureStatsVO getLectureStatsWithFilterAndRates(String lectureCode, LectureStatsFilterDTO filter) {
log.info(filter.getEndMonth().toString());
log.info(filter.getEndYear().toString());
log.info(filter.getStartMonth().toString());
log.info(filter.getStartYear().toString());

LectureDTO lectureDTO = lectureService.getLectureById(lectureCode);
if (lectureDTO == null) throw new CommonException(StatusEnum.LECTURE_NOT_FOUND);

Expand Down

0 comments on commit 2c6ff12

Please sign in to comment.