Skip to content

Commit 5cbfc6c

Browse files
authored
fix: adjust airkorea warning levels (#3)
1 parent e08fe05 commit 5cbfc6c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

TODO.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@
112112
- [x] 에어코리아 오존 주의보/경보 실패 케이스 최소 대응(타임아웃/빈 데이터/포맷 변경)
113113
- [x] 에어코리아 미세먼지 주의보/경보 region 코드 매핑 추가
114114
- [x] 에어코리아 오존 주의보/경보 region 코드 매핑 추가
115+
- [x] 에어코리아 미세먼지 주의보/경보 레벨 매핑 하향 조정
116+
- [x] 에어코리아 오존 주의보/경보 레벨 매핑 하향 조정 및 중대 등급 반영
115117
- [x] 산림청 산불 발생 정보 엔드포인트 확인 및 요청 파라미터 정리
116118
- [x] 산림청 산불 발생 정보 필드 매핑 합의(title/occurred_at/region_text/level/payload)
117119
- [x] 산림청 산불 발생 정보 폴링 주기 초안 결정

src/modules/ingest/app/sources/airkorea-o3-warning.source.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,15 @@ const buildPayload = (group: O3WarningGroup): EventPayload => {
131131

132132
const mapWarningLevel = (value: string): EventLevels => {
133133
const normalized = normalizeText(value);
134-
if (normalized?.includes('경보')) {
134+
if (normalized?.includes('중대')) {
135135
return EventLevels.Severe;
136136
}
137-
if (normalized?.includes('주의')) {
137+
if (normalized?.includes('경보')) {
138138
return EventLevels.Moderate;
139139
}
140+
if (normalized?.includes('주의')) {
141+
return EventLevels.Minor;
142+
}
140143
return EventLevels.Info;
141144
};
142145

src/modules/ingest/app/sources/airkorea-pm-warning.source.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,15 @@ const buildPayload = (group: PmWarningGroup): EventPayload => {
168168

169169
const mapWarningLevel = (value: string): EventLevels => {
170170
const normalized = normalizeText(value);
171-
if (normalized?.includes('경보')) {
171+
if (normalized?.includes('중대')) {
172172
return EventLevels.Severe;
173173
}
174-
if (normalized?.includes('주의')) {
174+
if (normalized?.includes('경보')) {
175175
return EventLevels.Moderate;
176176
}
177+
if (normalized?.includes('주의')) {
178+
return EventLevels.Minor;
179+
}
177180
return EventLevels.Info;
178181
};
179182

0 commit comments

Comments
 (0)