feat: Open-Meteo 구름 20·100km 구 코드 저장, 보조값 수집, 활동 지수 10개에 자외선·햇빛·가시거리 반영

구름
- 노을·일출 점수를 구 중심 20·100km 두 지점으로 계산 (50km 제외), 모델은 JMA·ICON 두 개만 사용
- cloud_hourly를 (구 코드, 방향, 거리, 시각, 모델) 키로 바꾸고 점수에 쓰는 시각만 저장

보조값
- openmeteo_hourly 신규: 자외선·가시거리·돌풍·기압·지표면 온도(끝 시각 값), 일조(3시간 합), 일사(평균·최대)
- worker가 03·09·15·21시 10분에 구 256곳을 요청 11번으로 일괄 수집, 7일 지난 행 정리
- 새 응답에서 값이 비어 오면 이전 값을 유지(COALESCE)

지수
- 새 축 uv·sun·view 추가 (index_definition/index_score 칼럼, 비중 있는 지수에만 상세에 표시)
- 빨래·멍뭉산책·피크닉·등산·러닝·가드닝·별보기·사진산책에 비중 배분, 자전거·캠핑·멍뭉산책에 돌풍·지표면 온도 0점 조건
- 자외선·가시거리 등 순간값은 가장 가까운 3시간 구간, 일조는 덮는 구간을 계산 창에 연결
- 보조값이 새로 오면 지수를 다시 계산하도록 재계산 기준에 fetched_at 추가

테스트 102개 통과 (PGSSLMODE=disable, JWT는 테스트용 환경변수).
This commit is contained in:
skkim committed 2026-10-06 17:21:59 +09:00
1 parent 7244449b7a
commit 7c12651068
19 files changed
+712 -82

No files matched your search

+150 -18
View File
@@ -19,6 +19,9 @@
"weight_wind": 15,
"weight_humidity": 10,
"weight_air": 10,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"factor_rules": {
"temp": {
@@ -79,11 +82,14 @@
"to": 16
}
],
"weight_temp": 30,
"weight_temp": 25,
"weight_rain": 25,
"weight_wind": 15,
"weight_humidity": 10,
"weight_humidity": 5,
"weight_air": 10,
"weight_uv": 10,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"factor_rules": {
"temp": {
@@ -111,6 +117,10 @@
"sun": 100,
"holiday": 100,
"default": 60
},
"uv": {
"zero": 8,
"full": 2
}
},
"zero_rules": [
@@ -144,6 +154,9 @@
"weight_wind": 15,
"weight_humidity": 15,
"weight_air": 10,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"factor_rules": {
"temp": {
@@ -208,6 +221,9 @@
"weight_wind": 15,
"weight_humidity": 10,
"weight_air": 15,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -282,6 +298,9 @@
"weight_wind": 15,
"weight_humidity": 10,
"weight_air": 45,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -332,11 +351,14 @@
"to": 12
}
],
"weight_temp": 30,
"weight_temp": 25,
"weight_rain": 25,
"weight_wind": 20,
"weight_humidity": 10,
"weight_humidity": 5,
"weight_air": 10,
"weight_uv": 5,
"weight_sun": 0,
"weight_view": 5,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -365,6 +387,14 @@
"sun": 100,
"holiday": 100,
"default": 50
},
"uv": {
"zero": 8,
"full": 2
},
"view": {
"zero": 5,
"full": 20
}
},
"zero_rules": [
@@ -404,6 +434,9 @@
"weight_wind": 10,
"weight_humidity": 10,
"weight_air": 10,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -459,6 +492,9 @@
"weight_wind": 15,
"weight_humidity": 15,
"weight_air": 10,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -494,6 +530,11 @@
"field": "wind_ms",
"op": ">=",
"value": 14
},
{
"field": "gust_ms",
"op": ">=",
"value": 15
}
],
"limit_description": "캠핑장 예약 상황은 반영하지 못해요",
@@ -522,8 +563,11 @@
"weight_temp": 35,
"weight_rain": 20,
"weight_wind": 10,
"weight_humidity": 20,
"weight_humidity": 15,
"weight_air": 10,
"weight_uv": 5,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -545,6 +589,10 @@
"time": {
"type": "fixed",
"value": 100
},
"uv": {
"zero": 8,
"full": 2
}
},
"zero_rules": [
@@ -579,10 +627,13 @@
}
],
"weight_temp": 5,
"weight_rain": 15,
"weight_rain": 10,
"weight_wind": 5,
"weight_humidity": 10,
"weight_air": 20,
"weight_humidity": 5,
"weight_air": 15,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 15,
"weight_time": 45,
"factor_rules": {
"temp": {
@@ -603,6 +654,10 @@
},
"time": {
"type": "moon"
},
"view": {
"zero": 5,
"full": 20
}
},
"zero_rules": [
@@ -640,6 +695,9 @@
"weight_wind": 15,
"weight_humidity": 10,
"weight_air": 5,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -686,6 +744,9 @@
"weight_wind": 10,
"weight_humidity": 15,
"weight_air": 5,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -734,6 +795,9 @@
"weight_wind": 15,
"weight_humidity": 10,
"weight_air": 5,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"factor_rules": {
"temp": {
@@ -775,11 +839,14 @@
"to": 16
}
],
"weight_temp": 20,
"weight_rain": 35,
"weight_wind": 20,
"weight_humidity": 20,
"weight_temp": 15,
"weight_rain": 30,
"weight_wind": 15,
"weight_humidity": 10,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 25,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -799,6 +866,10 @@
"time": {
"type": "fixed",
"value": 100
},
"sun": {
"zero": 0.2,
"full": 0.8
}
},
"zero_rules": [
@@ -808,7 +879,7 @@
"value": 60
}
],
"limit_description": "집 일조량은 반영하지 못해요",
"limit_description": "집 방향·그늘 일조량은 반영하지 못해요",
"sentences": {},
"sort_order": 14
},
@@ -832,6 +903,9 @@
"weight_wind": 30,
"weight_humidity": 5,
"weight_air": 10,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -871,6 +945,11 @@
"field": "wind_ms",
"op": ">=",
"value": 10
},
{
"field": "gust_ms",
"op": ">=",
"value": 15
}
],
"limit_description": "자전거 도로 공사는 반영하지 못해요",
@@ -896,11 +975,14 @@
"to": 20
}
],
"weight_temp": 40,
"weight_temp": 35,
"weight_rain": 25,
"weight_wind": 10,
"weight_humidity": 5,
"weight_air": 15,
"weight_uv": 5,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -925,6 +1007,10 @@
"time": {
"type": "fixed",
"value": 100
},
"uv": {
"zero": 8,
"full": 2
}
},
"zero_rules": [
@@ -937,9 +1023,14 @@
"field": "pm25",
"op": ">=",
"value": 75
},
{
"field": "ground_c",
"op": ">=",
"value": 45
}
],
"limit_description": "노면 온도는 실측하지 못해요",
"limit_description": "지표면 온도는 예보 모델 값이라 실제 노면 온도와 달라요",
"sentences": {},
"sort_order": 16
},
@@ -963,6 +1054,9 @@
"weight_wind": 5,
"weight_humidity": 30,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -1009,6 +1103,9 @@
"weight_wind": 10,
"weight_humidity": 35,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -1055,6 +1152,9 @@
"weight_wind": 5,
"weight_humidity": 15,
"weight_air": 5,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -1103,6 +1203,9 @@
"weight_wind": 10,
"weight_humidity": 5,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 15,
"factor_rules": {
"temp": {
@@ -1151,6 +1254,9 @@
"weight_wind": 10,
"weight_humidity": 5,
"weight_air": 5,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"factor_rules": {
"temp": {
@@ -1195,11 +1301,14 @@
"to": 10
}
],
"weight_temp": 30,
"weight_temp": 25,
"weight_rain": 30,
"weight_wind": 10,
"weight_humidity": 15,
"weight_air": 10,
"weight_uv": 5,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {
@@ -1224,6 +1333,10 @@
"time": {
"type": "fixed",
"value": 100
},
"uv": {
"zero": 8,
"full": 2
}
},
"zero_rules": [
@@ -1252,11 +1365,14 @@
"hours": 1
}
],
"weight_temp": 15,
"weight_temp": 10,
"weight_rain": 25,
"weight_wind": 10,
"weight_humidity": 5,
"weight_air": 15,
"weight_air": 10,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 10,
"weight_time": 30,
"factor_rules": {
"temp": {
@@ -1280,6 +1396,10 @@
},
"time": {
"type": "sunset_score"
},
"view": {
"zero": 5,
"full": 20
}
},
"zero_rules": [
@@ -1313,6 +1433,9 @@
"weight_wind": 10,
"weight_humidity": 5,
"weight_air": 10,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"factor_rules": {
"temp": {
@@ -1371,6 +1494,9 @@
"weight_wind": 10,
"weight_humidity": 5,
"weight_air": 5,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"factor_rules": {
"temp": {
@@ -1420,6 +1546,9 @@
"weight_wind": 15,
"weight_humidity": 5,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 15,
"factor_rules": {
"temp": {
@@ -1468,6 +1597,9 @@
"weight_wind": 10,
"weight_humidity": 0,
"weight_air": 5,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"factor_rules": {
"temp": {