fix: history/detail API 500 오류 — candidate_count 컬럼 부재 시 안전 처리 #224

병합
htlee hotfix/history-candidate-count 에서 main 로 1 commits 를 머지했습니다 2026-04-04 11:05:14 +09:00

파일 보기

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