fix: history/detail API 500 오류 — candidate_count 컬럼 부재 시 안전 처리
mapGroupRow에서 candidate_count를 읽을 때 optionalInt로 변경하여 해당 컬럼이 없는 SQL (history, detail)에서도 정상 동작하도록 수정 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
부모
de11a162b4
커밋
17922bf74c
@ -1409,7 +1409,7 @@ public class GroupPolygonService {
|
||||
.members(members)
|
||||
.color(rs.getString("color"))
|
||||
.resolution(rs.getString("resolution"))
|
||||
.candidateCount(nullableInt(rs, "candidate_count"))
|
||||
.candidateCount(optionalInt(rs, "candidate_count"))
|
||||
.parentInference(mapParentInferenceSummary(rs))
|
||||
.build();
|
||||
}
|
||||
@ -1566,6 +1566,15 @@ public class GroupPolygonService {
|
||||
return ((Number) value).intValue();
|
||||
}
|
||||
|
||||
/** 컬럼이 ResultSet에 존재하지 않으면 null 반환 (history/detail SQL 호환) */
|
||||
private Integer optionalInt(ResultSet rs, String column) throws SQLException {
|
||||
try {
|
||||
return nullableInt(rs, column);
|
||||
} catch (SQLException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, Object> parseJsonObject(String json) {
|
||||
return parseJsonValue(json, new TypeReference<Map<String, Object>>() {}, Map.of());
|
||||
}
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user