Skip to content

Commit

Permalink
fix: 목표 달성 실패 시 title "달성 실패"로 리턴
Browse files Browse the repository at this point in the history
- 내부 테스트 관련 이슈 리스트(#7) 이슈 해결
  • Loading branch information
hee9841 committed Sep 30, 2024
1 parent fb22830 commit 54bf633
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ public GoalAchievement(RunningRecord runningRecord, GoalMetricType goalMetricTyp
goalMetricType.getActualValue(runningRecord) >= achievementValue);
}

public String getTitle() {
public String getTitle(boolean isAchieved) {
String returnTitle = (isAchieved ? " 달성" : " 달성 실패");
if (goalMetricType == DISTANCE) {
return KILO_METER_FORMATTER.format(achievementValue / METERS_IN_A_KILOMETER) + " 달성";
return KILO_METER_FORMATTER.format(achievementValue / METERS_IN_A_KILOMETER) + returnTitle;
}

return formatSecondToKoreanHHMM(achievementValue) + " 달성";
return formatSecondToKoreanHHMM(achievementValue) + returnTitle;
}

public String getDescription() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static RunningRecordAddResultResponse of(RunningRecord runningRecord, Goa
return buildResponse(runningRecord,
null,
new GoalResultDto(
achievement.getTitle(),
achievement.getTitle(achievement.isAchieved()),
achievement.getDescription(),
achievement.getIconUrl(),
achievement.isAchieved()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static RunningRecordQueryResponse of(RunningRecord runningRecord, GoalAch
return buildResponse(runningRecord,
null,
new GoalResultDto(
achievement.getTitle(),
achievement.getTitle(achievement.isAchieved()),
achievement.getDescription(),
achievement.getIconUrl(),
achievement.isAchieved()
Expand Down

0 comments on commit 54bf633

Please sign in to comment.