fix: MonitoringController Timestamp 캐스팅 오류 수정

- JdbcTemplate이 timestamptz를 java.sql.Timestamp로 반환하는 케이스 처리
- toLocalDateTime() 유틸 메서드로 Timestamp/OffsetDateTime/LocalDateTime 통합 변환

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
htlee 2026-02-19 18:34:47 +09:00
부모 986ae7bc14
커밋 508cc264ee

파일 보기

@ -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;
}
}