From 4ac0c351fdcf933c5650b94aa1148ea8be6cbe67 Mon Sep 17 00:00:00 2001 From: Jeyong Date: Thu, 27 Mar 2025 16:53:09 +0900 Subject: [PATCH] =?UTF-8?q?{fix}=20=EB=AA=A9=ED=91=9C=20=EC=88=98=ED=96=89?= =?UTF-8?q?=20=EA=B8=B0=EB=A1=9D=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/recordSummaryResponseDto.java | 2 +- .../domain/Record/entity/ActivityRecord.java | 12 ++++++------ .../domain/Record/service/RecordService.java | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/dto/response/recordSummaryResponseDto.java b/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/dto/response/recordSummaryResponseDto.java index 2060923..8b4f178 100644 --- a/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/dto/response/recordSummaryResponseDto.java +++ b/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/dto/response/recordSummaryResponseDto.java @@ -31,7 +31,7 @@ public class recordSummaryResponseDto { private int remainingWeeklyGoalDays; // 사용자가 설정한 일간 목표 - private int personalDailyGoal; + private Long personalDailyGoal; // 사용자가 설정한 주간 목표 private int personalWeeklyGoal; diff --git a/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/entity/ActivityRecord.java b/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/entity/ActivityRecord.java index b3256b8..e182944 100644 --- a/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/entity/ActivityRecord.java +++ b/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/entity/ActivityRecord.java @@ -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; diff --git a/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/service/RecordService.java b/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/service/RecordService.java index 8138bfd..38df108 100644 --- a/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/service/RecordService.java +++ b/MathCaptain/weakness/src/main/java/MathCaptain/weakness/domain/Record/service/RecordService.java @@ -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("해당 관계가 존재하지 않습니다.")); @@ -55,7 +55,6 @@ public recordSummaryResponseDto endActivity(Users user, Long groupId, recordEndR } // 주간 목표 달성 여부 조회 - public Map getWeeklyGoalStatus(Users user, Group group, LocalDateTime weekStart) { // 주의 시작과 끝 계산 (월요일 ~ 다음 주 월요일) LocalDateTime startOfWeek = calculateStartOfWeek(weekStart); @@ -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(); }