Merge pull request 'fix: Timestamp 캐스팅 오류 수정' (#20) from feature/dashboard-phase-1 into develop

This commit is contained in:
htlee 2026-02-19 18:35:35 +09:00
커밋 8911259f29

파일 보기

@ -50,14 +50,8 @@ public class MonitoringController {
""" """
); );
Object aisRaw = aisLatest.get("latest_update_time"); LocalDateTime aisTime = toLocalDateTime(aisLatest.get("latest_update_time"));
LocalDateTime aisTime = null; LocalDateTime queryTime = toLocalDateTime(queryLatest.get("latest_processed_time"));
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");
long delayMinutes = 0; long delayMinutes = 0;
String delayStatus = "NORMAL"; String delayStatus = "NORMAL";
@ -233,4 +227,15 @@ public class MonitoringController {
return quality; 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;
}
} }