diff --git a/src/main/java/com/moabam/api/application/room/CertificationService.java b/src/main/java/com/moabam/api/application/room/CertificationService.java index e6a56ab3..94f49a73 100644 --- a/src/main/java/com/moabam/api/application/room/CertificationService.java +++ b/src/main/java/com/moabam/api/application/room/CertificationService.java @@ -111,7 +111,8 @@ public Certification findCertification(Long certificationId) { private void validateCertifyTime(LocalDateTime now, int certifyTime) { LocalTime targetTime = LocalTime.of(certifyTime, 0); LocalDateTime targetDateTime = LocalDateTime.of(now.toLocalDate(), targetTime); - if (certifyTime == MIDNIGHT_HOUR) { + + if (certifyTime == MIDNIGHT_HOUR && now.getHour() == ONE_HOUR_BEFORE_MIDNIGHT_HOUR) { targetDateTime = targetDateTime.plusDays(1); } diff --git a/src/main/java/com/moabam/global/common/util/GlobalConstant.java b/src/main/java/com/moabam/global/common/util/GlobalConstant.java index 7b62d447..c4d6ce53 100644 --- a/src/main/java/com/moabam/global/common/util/GlobalConstant.java +++ b/src/main/java/com/moabam/global/common/util/GlobalConstant.java @@ -11,6 +11,7 @@ public class GlobalConstant { public static final String CHARSET_UTF_8 = ";charset=UTF-8"; public static final String SPACE = " "; public static final int MIDNIGHT_HOUR = 0; + public static final int ONE_HOUR_BEFORE_MIDNIGHT_HOUR = 23; public static final int ONE_HOUR = 1; public static final int HOURS_IN_A_DAY = 24; public static final int NOT_COMPLETED_RANK = 500;