From 902fb4c0704d7b57958b56e11e59284c7bac8372 Mon Sep 17 00:00:00 2001 From: Mina Choi Date: Mon, 12 Oct 2026 11:23:16 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=85=B8=EC=9D=84=20=EC=BB=A4=EB=B0=8B?= =?UTF-8?q?=EC=97=90=20=EC=84=9E=EC=9D=B8=20=EC=9E=90=EC=99=B8=EC=84=A0=20?= =?UTF-8?q?=ED=8F=AC=EC=8A=A4=ED=8A=B8=20=EB=B3=80=EA=B2=BD=20=EB=B9=BC?= =?UTF-8?q?=EA=B8=B0=20(=EB=8B=A4=EB=A5=B8=20=EC=9E=91=EC=97=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/services/feed_service.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/services/feed_service.py b/backend/services/feed_service.py index b1f72ec..4826c0e 100644 --- a/backend/services/feed_service.py +++ b/backend/services/feed_service.py @@ -627,13 +627,14 @@ class FeedService: return None label = uv_label(top) at = peak.forecast_at.astimezone(KST) - rows = [Row(label=f"{r.forecast_at.astimezone(KST).hour}시", value=uv_label(float(r.uv_index))) for r in c.uv] - when = "점심때" if at.hour == 12 else f"{hour_label(at.hour)} 무렵" - todo = "선크림·모자·선글라스 챙기고 그늘로 다녀요" if top >= UV_HIGH else "선크림·모자 챙겨요" - line = f"오늘 자외선 지수 {label}\n{when} 나가면 {todo}" - return PostData(**base, title=f"자외선 지수 {label}", icon="glasses", caption=f"가장 셀 때 {hour_label(at.hour)}", + rows = [Row(label=f"{r.forecast_at.astimezone(KST).hour}시", value=f"{round(float(r.uv_index))} · {uv_label(float(r.uv_index))}") for r in c.uv] + high = top >= UV_HIGH + if high: + rows.append(Row(label="이렇게 해요", value="선크림 바르고, 모자·선글라스 챙겨요")) + line = f"{hour_label(at.hour)} 무렵 자외선 {label},\n" + ("선크림 꼭 챙겨요" if high else "오래 밖에 있으면 선크림") + return PostData(**base, title=f"자외선 {label}", icon="glasses", caption=f"가장 셀 때 {hour_label(at.hour)} · {round(top)}", slides=[RowsSlide(kind="rows", eyebrow=f"오늘 자외선 · {c.region.short_name}", line=line, icon="glasses", rows=rows)], - share_messages=[f"오늘 자외선 지수 {label}, 선크림 챙겨!"]) + share_messages=[f"오늘 자외선 {label}, 선크림 챙겨!"]) def _air(self, base: dict, c: "_Ctx") -> Optional[PostData]: """가까운 측정소의 지금 초미세먼지·미세먼지. 측정값이 없거나 3시간 넘게 지났으면 끈다."""