fix: Timestamp 캐스팅 오류 수정 #21
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user