fix: Timestamp 캐스팅 오류 수정 #21

병합
htlee develop 에서 main 로 2 commits 를 머지했습니다 2026-02-19 18:36:19 +09:00

파일 보기

@ -50,14 +50,8 @@ public class MonitoringController {
"""
);
Object aisRaw = aisLatest.get("latest_update_time");
LocalDateTime aisTime = null;
if (aisRaw instanceof java.time.OffsetDateTime odt) {
aisTime = odt.toLocalDateTime();
} else if (aisRaw instanceof LocalDateTime ldt) {
aisTime = ldt;
}
LocalDateTime queryTime = (LocalDateTime) queryLatest.get("latest_processed_time");
LocalDateTime aisTime = toLocalDateTime(aisLatest.get("latest_update_time"));
LocalDateTime queryTime = toLocalDateTime(queryLatest.get("latest_processed_time"));
long delayMinutes = 0;
String delayStatus = "NORMAL";
@ -233,4 +227,15 @@ public class MonitoringController {
return quality;
}
private static LocalDateTime toLocalDateTime(Object raw) {
if (raw instanceof java.sql.Timestamp ts) {
return ts.toLocalDateTime();
} else if (raw instanceof java.time.OffsetDateTime odt) {
return odt.toLocalDateTime();
} else if (raw instanceof LocalDateTime ldt) {
return ldt;
}
return null;
}
}