Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class recordSummaryResponseDto {
private int remainingWeeklyGoalDays;

// 사용자가 설정한 일간 목표
private int personalDailyGoal;
private Long personalDailyGoal;

// 사용자가 설정한 주간 목표
private int personalWeeklyGoal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public class ActivityRecord {

private DayOfWeek dayOfWeek; // 요일

@PrePersist
public void prePersist() {
this.dailyGoalAchieved = false;
this.weeklyGoalAchieved = false;
this.durationInMinutes = 0L;
}
// @PrePersist
// public void prePersist() {
// this.dailyGoalAchieved = false;
// this.weeklyGoalAchieved = false;
// this.durationInMinutes = 0L;
// }

public void updateEndTime(LocalDateTime endTime) {
this.endTime = endTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class RecordService {
// 기록 저장
public recordSummaryResponseDto endActivity(Users user, Long groupId, recordEndRequestDto endRequest) {

// 사용자 식별
// 관계 식별
RelationBetweenUserAndGroup relation = relationRepository.findByMemberAndGroup_Id(user, groupId)
.orElseThrow(() -> new IllegalArgumentException("해당 관계가 존재하지 않습니다."));

Expand All @@ -55,7 +55,6 @@ public recordSummaryResponseDto endActivity(Users user, Long groupId, recordEndR
}

// 주간 목표 달성 여부 조회

public Map<DayOfWeek, Boolean> getWeeklyGoalStatus(Users user, Group group, LocalDateTime weekStart) {
// 주의 시작과 끝 계산 (월요일 ~ 다음 주 월요일)
LocalDateTime startOfWeek = calculateStartOfWeek(weekStart);
Expand Down Expand Up @@ -177,7 +176,7 @@ private recordSummaryResponseDto buildRecordSummaryResponseDto(ActivityRecord ac
.weeklyGoalAchieved(activityRecord.isWeeklyGoalAchieved())
.remainingDailyGoalMinutes(remainingDailyGoalMinutes)
.remainingWeeklyGoalDays(remainingWeeklyGoal)
.personalDailyGoal(relation.getPersonalDailyGoal())
.personalDailyGoal(relation.getPersonalDailyGoal() * 60L)
.personalWeeklyGoal(relation.getPersonalWeeklyGoal())
.build();
}
Expand Down