Compare commits

...
113 Commits
Author SHA1 Message Date
skkim 3baa543313 Merge branch 'fix/now-rain-text' — 지금 비가 오면 '비 오는 중'·'지금 비가 와요'로(실황으로 본 대로), 우산분실각은 지금과 앞으로만 보는 식으로(비 오는 날 종일 0점이던 것) 2026-11-23 16:50:22 +09:00
skkim 62d79702ab fix: 우산분실각이 비 오는 날 하루 종일 0점이던 것 — 지금과 앞으로만 보는 식으로
- 예전 식은 '그 구간에 비 소식이 있으면 0점, 앞서 내린 비가 없으면 0점'이라 구간마다 비 예보가 있는 날은 종일 0점이었고, 앞서 내린 비는 관측이 아니라 저장된 예보로 판단해 실제와 어긋났음
- 새 식: 우산을 챙겼을 정도(지금 비가 오면 100%, 아니면 지금부터 자정까지 가장 높은 비 확률) × 비가 안 오는 시간의 비율(100% − 남은 시각 비 확률 평균). 지난 시각은 보지 않고 0점 조건을 없앰. 내일·토·일 칸은 그날 9~22시로 같은 식
- 설명·요소 이름('우산 안 쓰는 시간')·점수 구간 문장을 새 뜻에 맞춤 (문구는 검토 전), 각 계산 기준 문서 다시 생성
2026-11-23 16:50:22 +09:00
skkim b0e6a01157 fix: 지금 비가 오는데 '비 60%'·'5시쯤 비가 와요'로 나오던 문구 — 실황으로 본 대로
- 지금 구간 한 줄(히어로·각): 실황으로 관측한 시각은 예보 확률 대신 본 대로 씀. 비가 오면 '비 오는 중'(눈·진눈깨비도), 비가 없으면 확률 없이 바람·하늘. 비가 관측됐는데 예보 확률이 낮아 '바람 조금'으로 나오던 것도 같이 고쳐짐. 예보 시각(다른 구간·내일)은 그대로 확률
- 2시간 비 안내: 실황이 지금 비를 관측했으면 앞으로의 예보보다 먼저 '지금 비가 와요. 우산 챙기세요'
- 매시 00~10분은 그 시각 실황이 아직 없어 예보 문구가 나옴
2026-11-23 16:22:50 +09:00
skkim 4fd757e5b4 Merge branch 'fix/remove-time-fit' — 지금 날씨를 초단기실황 관측값으로(히어로·오늘 날씨·각 점수), 각 점수에서 시간대 알맞음 제거·우산각은 남은 하루 비로, 지역 페이지에서 지역이 안 바뀌던 것 고침('지금 위치로 찾기'는 처음 화면으로) 2026-11-23 15:57:47 +09:00
skkim fc9fb57d57 fix: 지역 페이지에서 지역을 바꿔도 그대로이던 것, '지금 위치로 찾기'는 처음 화면으로
- 지역 페이지(/today/…, /tomorrow/…)에서 지역 창으로 지역을 바꾸면 주소가 옮겨 갔다가 바로 되돌아와 지역이 안 바뀌었음. 창이 열릴 때 방문 기록을 하나 쌓고 닫힐 때 뒤로 가는데, 그 뒤로 가기가 방금 옮긴 주소를 되돌렸음 (목록 선택·지금 위치로 찾기 모두). 창이 쌓아 둔 기록 위에서는 그 기록을 새 주소로 바꿔 쓰고, 창을 닫을 때는 그 기록이 맨 위일 때만 뒤로 감
- 지역 페이지에서 '지금 위치로 찾기'를 누르면 그 구의 지역 페이지 대신 위치를 따라가는 처음 화면(/)으로 감. 목록에서 고르면 전처럼 그 지역 주소로
- 로컬 웹 브라우저에서 확인. 앱·토스에서는 확인하지 못함
2026-11-23 15:52:10 +09:00
skkim 4c24d95991 fix: 히어로의 지금 값에 초단기실황 반영, 구간 경계 시각의 우산각 '지금 비'
- 히어로가 DB 예보 행을 직접 읽어 실황이 안 들어가던 것 — 지금 시각 행을 관측값으로 덮음. 피드 캐시도 새 시각 실황이 나오는 매시 10분에 끝나게 함
- 낮이 15:20 에 끝나는 날 15:00~15:20 처럼 구간 경계 직전에는 지금 시각 행이 다음 구간 칸에 들어, 화면이 보여 주는 지금 구간의 우산각이 '지금 비'를 놓치던 것 — 우산각의 지금은 화면이 보여 주는 구간 기준으로 정하고 그 줄 문구도 지금 시각 날씨로
2026-11-23 15:43:50 +09:00
skkim 5ab2381f79 feat: 지금 날씨를 초단기실황 관측값으로, 각 점수에서 시간대 알맞음 제거·우산각 계산식 변경
- 초단기실황(getUltraSrtNcst)을 받아 지금 정시 한 시각의 비·기온·습도·바람을 예보 대신 관측값으로 덮어씀 (체감·불쾌지수는 다시 계산). 지역별 1시간 캐시, 실패하면 초단기예보·단기예보로 되돌아감, 새 시각 실황이 나오면 각 점수를 다시 계산. 가이드대로 ±900 이상은 결측 처리. 테스트가 실제 기상청을 부르지 않게 실황 호출을 기본으로 막음
- 시간대 알맞음 요소를 31개 각에서 빼고 비중을 5% 단위로 나눔. 요소가 3개 미만이 된 뜨아각·파전각·감성노래각·감사각·선크림각에 요소를 더함. 러닝각의 활동 시간대 밖 점수 상한도 없앰. 요소가 하나뿐인 각은 가장 낮은 요소로 깎지 않음
- 우산각은 비 한 가지: 남은 하루(지금~자정) 비 확률 평균이 점수, 지금 비가 오면 70점에서 시작해 평균 × 30점을 더함. 내일·토·일 칸은 그날 6~24시 평균 × 100. 우산분실각도 비 한 가지
- 각 계산 기준 문서는 생성기를 새 규칙에 맞게 고쳐 다시 생성, 점수 계산식·서비스 동작 안내 문서 갱신
2026-11-23 14:51:04 +09:00
skkim 8ea9f8f04b fix: 안드로이드 토스에서 탭바 아래가 약 56px 비어 보이던 것 — 토스 웹뷰는 하단 내비게이션 바 위에서 끝나는데도 safe-area-inset-bottom 을 알려 줘 여백이 두 번 들어갔음. 하단 안전 영역을 --sab 변수 하나로 모으고(탭바·페이지 아래 여백·문의 버튼·창·게임·포스트 오류 문구), 안드로이드 토스일 때만 0 으로 둠. 웹·앱·아이폰 토스는 그대로(아이폰 토스는 확인하지 못함). 갤럭시 Z 플립 5 에서 확인 2026-11-23 09:46:25 +09:00
skkim 2b1fa58f56 feat: 토스판 '광고 보고 날씨각 응원하기' 카드 — 토스 앱이 광고를 지원할 때만 오늘 탭에 보이고, 누르면 보상 없는 전면 광고를 한 번 보여 줌(loadFullScreenAd → showFullScreenAd, 10초 넘게 못 불러오면 실패). 광고 그룹 ID 는 VITE_TOSS_REWARD_AD_ID, 없으면 토스 테스트 ID. GA 토스광고_누름·노출·닫음·실패(stage), 이벤트 문서·TODO 반영. 보상형 광고 그룹이 2026-12-02 에 삭제 예정이라 그 전에 노출시키려는 것 2026-11-23 09:13:37 +09:00
skkim 5bcf962e93 fix: 지역을 목록에서 고르고 다른 탭으로 옮기면 지금 위치로 되돌아가던 것 — navigate 가 화면 이동마다 새 함수가 돼 save 와 위치 맞춤 effect 가 매번 다시 돌았음. navigate 를 ref 에 담아 save 를 고정 2026-11-20 16:46:11 +09:00
skkim 0578c127d5 fix: 해돋이·첫눈 지도 다듬기 — 그림 귀퉁이의 단풍잎 장식이 잘려 보이던 것(오른쪽은 위·아래 귀퉁이만 잘라 독도는 남김), 해돋이 지도 색을 살구빛 바탕·주황빛 땅으로, 처음 화면에서 한 단계 더 축소(울릉도·독도까지 전체 보기) 2026-11-20 11:44:26 +09:00
skkim d7dfc1ba82 feat: 계절 지도 자리에 첫눈 지도·해돋이 지도 — 단풍 지도가 끝나면 첫눈 지도(~12/20, 지점 42곳 평년 첫눈 날짜 + 앞으로 7일 눈 예보, GET /v1/season/first-snow), 12/21부터 해돋이 지도(~2월, 명소 50곳 해 뜨는 시각, 12월엔 새해 첫날 기준). 오늘 탭 아이콘·피드 맨 앞 카드(foliage_post 좋아요·댓글 자리를 이어받음)·/first-snow·/sunrise 페이지·공유 이미지. 지도 확대·이동은 mapView.ts 로 꺼내 단풍 지도와 같이 씀 (GA first_snow_open·first_snow_spot·sunrise_open·sunrise_spot·sunrise_day) 2026-11-20 11:18:54 +09:00
skkim 4e69c4ac44 fix: 단풍 지도 '절정' 표시를 절정 예상일 7일 뒤까지에서 5일 뒤까지로 — 단풍이 끝났는데 절정으로 남는 기간을 줄임 (지도가 보이는 기간도 마지막 절정 + 5일로 같이 짧아짐) 2026-11-20 11:18:49 +09:00
skkim 7478a6fa58 fix: 로딩 화면 토끼 이미지 alt 추가 (빙 SEO 경고) 2026-11-17 17:01:40 +09:00
skkim 28a6b79b00 feat: 유입 추적 스크립트(analytics.webforai.kr) 추가 — weather.o2o.kr 에서만 보냄, 검색어·해시는 주소에서 뺌 2026-11-17 08:43:50 +09:00
skkim 63a786e8e3 chore: 앱 버전 1.1.1 (versionCode 1002) — 웹뷰 셸 2026-11-16 11:32:40 +09:00
skkim dd6ab20aa8 fix: 날씨각 카드 공유 이미지 만들기가 웹·앱 모두 약 30초 걸리던 것 — 캐러셀 밖 슬라이드의 loading="lazy" 이미지는 불러오지 않아 캡처 라이브러리가 로드 이벤트를 타임아웃(30초)까지 기다렸음. 캡처 전에 eager 로 바꿔 바로 불러옴(최대 8초 대기). 운영 데스크톱 Chrome 에서 27초 → 두 번째 슬라이드를 미리 불러오면 즉시, eager 전환은 150ms 에 로드 확인 2026-11-16 11:12:59 +09:00
skkim 9b01ca554c fix: 앱 공유 이미지 인코딩을 toBlob 대신 toDataURL 로 — toBlob 은 브라우저가 한가한 틈에만 처리해 화면 애니메이션이 도는 폰에서 PNG·JPEG 모두 13초 걸렸고, toDataURL 은 0.05~0.1초. 측정용 임시 줄(TMPTRACE) 제거 2026-11-16 11:07:27 +09:00
skkim 22cfa2fc6a Merge branch 'main' into feat/app-webview-shell — main 최신 반영(위치로 맞춘 사람은 새로고침·탭 복귀 때 다시 위치로)
# Conflicts:
#	frontend/src/b/region.tsx
2026-11-16 11:05:52 +09:00
skkim c4eeae9252 Merge branch 'feat/region-follow-location-web' — 위치로 맞춘 사람은 새로고침·탭 복귀 때 지금 위치로 다시 맞춤(목록에서 고른 지역은 그대로, 1분 간격) 2026-11-16 10:31:21 +09:00
skkim 95ac3de7fe feat: 위치로 맞춘 사람은 새로고침하거나 탭으로 돌아올 때 지금 위치로 다시 맞춤 — 목록에서 고른 지역은 그대로, 토스도 같은 규칙, 위치는 1분마다 새로 읽음, 지역_변경에 method auto 추가 2026-11-16 10:31:20 +09:00
skkim 9e3e750b6c chore: (작업 중) 앱 공유 이미지 JPEG 를 toBlob 대신 toDataURL 로 인코딩 — 측정용 TMPTRACE 로그와 domToCanvas debug 가 남아 있어 머지 전에 지워야 함 2026-11-16 09:53:08 +09:00
skkim c59c2b0f56 docs: 11/13 검색 노출 — 구글 전부 빠짐·색인 약 2, 네이버 분당구 오늘 날씨 12 새로·구 5개 빠짐, 네이버 원본 기록 추가 2026-11-16 09:53:08 +09:00
skkim d880307d85 fix: 앱 공유하기가 느리던 것 — 앱에서는 공유 이미지를 처음부터 JPEG 로 만들어, 누른 뒤 PNG 를 읽어 다시 JPEG 로 줄이던 4초가 0.14초가 됨 (일반 웹은 PNG 그대로) 2026-11-13 17:17:03 +09:00
skkim b03a3d501d fix: 개발 도구 실행 링크(nalssigak://expo-development-client/…)를 웹 경로로 열어 앱이 빈 화면이 되던 것 — 사이트 주소로 바꾸는 링크 변환에서 제외 2026-11-13 17:09:00 +09:00
skkim 2b6657c951 Merge branch 'main' into feat/app-webview-shell — main 최신 반영(홈 첫 로드 가볍게·쇼츠 미리보기·사이트맵 줄이기·주말 순위 비 상한 등) 2026-11-13 16:42:02 +09:00
skkim ceb700f0a8 Merge branch 'fix/home-pagespeed' — 홈 첫 로드 가볍게(쇼츠 플레이어 지연·아이콘 WebP·계절 사진 재압축), 지역 페이지 소개 글 접기 2026-11-13 16:33:57 +09:00
skkim 8457333a92 fix: 지역 날씨 페이지 맨 아래 소개 글(요약·각 순위·자주 묻는 질문)을 접어 둠 — 글은 그대로 두고 한 줄만 보이게, 지역안내_펼침 이벤트 추가 2026-11-13 16:33:45 +09:00
skkim de39195a61 feat: 홈 쇼츠 미리보기 — 데스크톱은 마우스를 올린 카드만 재생(0.2초 머물 때), 터치 기기는 첫 터치 뒤 첫 카드. 쇼츠_미리보기에 trigger(hover·auto) 추가 2026-11-13 16:33:45 +09:00
skkim 38ae9374fd fix: 홈 첫 로드 가볍게 — 쇼츠 유튜브 플레이어를 첫 조작 뒤에 불러오고 첫 표지는 먼저 받음(LCP), 아이콘은 WebP 사본(4.6MB → 0.8MB)·계절 사진 재압축, 쇼츠_미리보기 이벤트 추가 2026-11-13 16:19:58 +09:00
skkim 6383911fb3 Merge branch 'fix/sitemap-trim' — 사이트맵에 기본 페이지 11개만 남김 2026-11-13 15:49:53 +09:00
skkim fc0ac46b57 fix: 사이트맵에서 지역 오늘 페이지(/today/…)도 제외 — 홈과 /faq·/gak 같은 기본 페이지 11개만 남김, 페이지는 그대로 만들고 noindex 는 넣지 않음 2026-11-13 15:49:36 +09:00
skkim 99033d13db fix: 사이트맵에서 내일 페이지(/tomorrow/…)와 시도별 FAQ(/faq/{시도}) 제외 — 페이지는 그대로 만들고 noindex 는 넣지 않음 2026-11-13 15:49:35 +09:00
skkim 3e3432ea4f docs: 검색 노출 — 서치 콘솔에서 확인한 색인·노출 흐름(11/10), 가설 추가, 11/13 사이트맵 줄이기 기록 2026-11-13 15:49:35 +09:00
skkim 7fcd9380ae fix: 사이트맵에서 지역 오늘 페이지(/today/…)도 제외 — 홈과 /faq·/gak 같은 기본 페이지 11개만 남김, 페이지는 그대로 만들고 noindex 는 넣지 않음 2026-11-13 15:48:56 +09:00
skkim 6abeabf5a0 chore: 각 카드 그림(boiler·kite), 문의 아이콘 원본·AI O2O CI 이미지, watch gradle 데몬 JVM 설정 추가 2026-11-13 15:46:14 +09:00
skkim f14f178f8b docs: 지역 주소 목록 — region.json 의 name·path 269개 2026-11-13 15:46:14 +09:00
skkim 9ff44143b5 fix: 사이트맵에서 내일 페이지(/tomorrow/…)와 시도별 FAQ(/faq/{시도}) 제외 — 페이지는 그대로 만들고 noindex 는 넣지 않음 2026-11-13 15:46:14 +09:00
skkim 1dd74bda05 docs: 검색 노출 — 서치 콘솔에서 확인한 색인·노출 흐름(11/10), 가설 추가, 11/13 사이트맵 줄이기 기록 2026-11-13 15:44:48 +09:00
skkim 02cd64a18c chore: 안드로이드 스튜디오 개인 설정(.idea/)과 루트 디버그 빌드 산출물(/app/build/)을 git 에서 제외 2026-11-13 15:44:48 +09:00
skkim c02f91c6d8 fix: 주말 전국 날씨 순위가 전국 비인 날 전부 47점이던 것 — 나들이 점수의 비 상한(최대 30점)을 없애 비 오는 날도 기온·하늘·바람에 따라 점수가 갈림. 바꾸기 표 다시 생성, 순위 캐시 키 v3 (main 939edee 와 같은 내용) 2026-11-13 15:44:48 +09:00
skkim da71ad5bad Merge branch 'fix/outing-rain-cap' — 주말 순위 비 상한 없애 전부 47점이던 것 고침 2026-11-13 14:01:41 +09:00
skkim 939edeedb6 fix: 주말 전국 날씨 순위가 전국 비인 날 전부 47점이던 것 — 나들이 점수의 비 상한(최대 30점)을 없애 비 오는 날도 기온·하늘·바람에 따라 점수가 갈림. 바꾸기 표 다시 생성, 순위 캐시 키 v3 2026-11-13 13:59:08 +09:00
skkim e64b001bf9 fix: 웹뷰가 날씨각과 정확히 같은 origin 만 열게 — originWhitelist 는 접두사 일치라 weather.o2o.kr.evil.com·weather.o2o.kr@evil.com 도 통과해, onShouldStartLoadWithRequest 로 다시 거르고 나머지는 휴대폰 브라우저로 2026-11-13 13:50:23 +09:00
skkim a228fcf560 feat: 앱을 날씨각 웹(weather.o2o.kr)을 띄우는 웹뷰 셸로 전환 (안드로이드) — 전체 화면 웹뷰·뒤로 가기·실패 화면, 구글 로그인·위치·공유 브리지, 앱 링크(assetlinks·인텐트 필터)·nalssigak:// 링크 열기, 안전 영역은 웹이 처리하도록 패딩 없음. 푸시·iOS 는 제외, expo-file-system 추가 2026-11-13 13:45:57 +09:00
skkim 2a94ebe85b feat: 웹이 앱(웹뷰 셸) 안인지 알아보고 앱 브리지로 구글 로그인·위치·공유를 처리 — user agent NalssigakApp/ 로 감지, 공유 이미지는 JPEG 로 줄여 전달, 앱 안에서는 설치 배너 숨김 (GA app_launch android_app, app_bridge_error, platform android_app) 2026-11-13 13:45:52 +09:00
skkim a80f039444 Merge branch 'feat/holiday-suneung-newyear' — 수능 응원·연말·새해 기념일 꾸밈 2026-11-12 13:56:51 +09:00
skkim c8287b4bf3 feat: 수능 응원·연말·새해 기념일 꾸밈 — 수능(2026-11-18~19)과 12-31~01-01 기간에만 이야기 주제·구름 합치기 그림·네 귀퉁이 소품이 바뀜 (GA talk_post topic 10·11, game_start theme suneung·newyear) 2026-11-12 13:47:22 +09:00
skkim e0e9f169d7 Merge branch 'feat/top-button' — 문의 창 문구를 제휴 문의 안내로 2026-11-11 11:06:54 +09:00
skkim 864cdf2448 fix: 문의 창 문구를 제휴 문의 안내로 — 제목 '날씨각과 함께할까요?', 광고·지역 행사 소개·콘텐츠 협업 문의 안내 2026-11-11 11:06:54 +09:00
skkim eaa62751cd Merge branch 'feat/top-button' — 오른쪽 아래 문의·맨 위로 버튼과 문의 창 2026-11-11 10:56:03 +09:00
skkim 4a2da04f98 feat: 오른쪽 아래 문의·맨 위로 버튼과 문의 창 — 맨 위에서는 문의(전화·이메일 안내 창), 내리면 맨 위로 버튼으로 바뀜. 쇼츠 화면은 제외 (GA top_button·contact_click, sheet_open contact) 2026-11-11 10:55:20 +09:00
skkim f5bf98fb34 Merge branch 'fix/remove-hidden-region-links' — 닫힌 지역 바꾸기 창의 숨은 지역 링크 제거 2026-11-10 13:44:43 +09:00
skkim 775c28e6ca fix: 닫힌 지역 바꾸기 창의 숨은 지역 링크 269개 제거 — 구글 색인 급감(566개 중 46개) 원인 후보, 검색 로봇용으로만 넣은 링크라 숨긴 링크 정책 소지. 11/10 검색 노출 기록·원인 분석 2026-11-10 13:43:45 +09:00
skkimandClaude 189d51f1ce chore: 앱 버전 1.1.0 (웹 기능 이식)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-05 11:38:40 +09:00
skkimandClaude 9a7e0ddc75 fix: 게임 웹뷰가 날씨각 사이트 안에서만 움직이게 — 로그인 토큰은 사이트 주소에서만 넣고, 다른 주소(외부 링크)는 휴대폰 브라우저로
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-05 11:34:14 +09:00
skkimandClaude e5cdfa2642 feat: 앱 단풍 지도 — /foliage 지도(두 손가락 확대·이동, 눌러 가까운 명소)·단계별 명소 목록, 단풍철 오늘 피드 맨 앞 카드(foliage_post 좋아요·댓글)와 아이콘. 명소 데이터·계산을 shared/lib/foliage.ts 로 (GA foliage_open·foliage_spot)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:52:23 +09:00
skkimandClaude 6daa2f4d2a feat: 앱 오늘 탭 아이콘 줄 — 날씨 사주(오늘 안 봤으면 빨간 점)·날씨 게임·쇼츠·내 각(그 줄로 내려감)·동네 이야기, 타로는 웹처럼 숨김 (GA today_icon)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:49:01 +09:00
skkimandClaude 02ebcda0ea feat: 앱 날씨 사주 — /saju 생년월일 입력(연·월·일 칩, 시각 −/+), 오늘 점수 링·할 일 카드, 사주 명식, 레벨로 열리는 이번 주·금전·연애·이달·올해, 궁합(Lv.5), 기기·계정 생년월일 저장, ?open= 으로 그 칸 (GA saju_input·saju_view)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:46:31 +09:00
skkimandClaude 47526c1cef feat: 앱 기념일 꾸밈 — 할로윈·빼빼로데이·크리스마스·추석 기간에만 하늘 네 귀퉁이 소품 (이야기 주제·게임 그림은 앞 커밋에서)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:43:42 +09:00
skkimandClaude 697c4bfb20 feat: 앱 쇼츠·구름 합치기 게임 — 오늘 피드 쇼츠 줄, /shorts 위아래로 넘겨 보기(유튜브 플레이어를 사이트 주소 기준 웹뷰로, 앞뒤 미리 받기, 눌러 소리), /game 은 웹 게임을 웹뷰로 띄우고 앱 지역·로그인을 넘김(react-native-webview) (GA shorts_open·shorts_view·shorts_sound)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:42:32 +09:00
skkimandClaude 5a88b08a44 feat: 앱 내 각 — 오늘 피드 내 각 줄, 만들기 창(있는 각 불러오기·아이콘·조건·시간대·미리보기 점수), 상세 창(시간대·조건별 점수, 링크 공유·지우기), 로그인 전 기기에 하나 저장 후 로그인하면 계정으로, ?my= 받은 각 열기 (GA my_gak_save)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:38:40 +09:00
skkimandClaude f6884fe9c9 chore: package-lock 은 expo-image-picker 항목만 더함 (로컬 npm 이 다시 쓴 libc·선택 의존성 변경은 되돌림)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:35:50 +09:00
skkimandClaude c15f045c64 feat: 앱 동네 이야기 — /talk 주제별 글·내 글, 오늘 피드 쓰기 칸과 포스트 두 장마다 사람 글, 사진 올리기(expo-image-picker, 카메라·마이크 권한 없음), 이야기 댓글·좋아요·신고·안 보기·지우기, 내 정보 내 글. 기념일 목록을 shared로 (GA talk_post·talk_comment·feed_item_view, like·report·block talk)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:35:23 +09:00
skkimandClaude e40a9a0539 feat: 앱 계정 레벨 — 하루 출석 각, 아바타 Lv 표시, 내 정보 레벨 카드, 내 레벨·레벨업 창, 공유하면 하루 한 번 각, 각을 주는 일 뒤 레벨 다시 받기. 아이콘 목록을 웹 아이콘 전부로 (GA sheet_open level·levelUp)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:26:21 +09:00
skkimandClaude 01b5f917b9 feat: 앱 오늘 피드를 웹과 맞춤 — 히어로 오늘/내일 전환·좋아요·댓글·보내기·점수 근거 창, 오늘의 각 카드(gak_post), 날씨각 카드(그림 슬라이드), 행사·TOP5 띠 없앰, 좋아요·댓글 로그인 없이 (GA hero_day_switch, like hero_post·gak_post)
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 17:23:44 +09:00
skkim e8b8cc79b6 Merge branch 'fix/app-text-node-crash' into feat/app-web-parity 2026-11-04 16:54:28 +09:00
skkimandClaude 709dcf742e fix: 앱이 켜자마자 꺼지던 것 — 서버가 빈 문자열(노을 line 등)을 주면 '&&'가 빈 글자를 View 안에 그려 안드로이드에서 'Text strings must be rendered within a <Text>'로 종료됨. 문자열 조건을 !!로 감쌈
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 16:54:28 +09:00
skkimandClaude cab3336859 feat: 앱 GA4 이벤트 틀(track, 웹과 같은 이벤트 목록을 shared로) — 기존 앱 기능에 창_열기·각_보기·글_열기·로그인·지역_변경·좋아요·댓글·신고·차단·약관_동의·공유, 전송은 Firebase 연결 뒤. 탭 밖 화면용 루트 스택
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-04 16:52:08 +09:00
minaChoi fcc7ed804c Merge branch 'docs/ctr-deployed' 2026-10-30 15:04:54 +09:00
minaChoi a8efb36041 docs: TODO 검색 결과 새 문구 10/30 배포, 11/13쯤 그룹별 클릭률 비교 2026-10-30 15:04:54 +09:00
minaChoi afa83d8b79 Merge branch 'feat/seo-ctr-copy' — 지역 페이지 절반에 검색 결과 새 문구, 클릭률 비교
# Conflicts:
#	docs/이벤트_추적.md
#	frontend/src/lib/analytics.ts
2026-10-30 15:01:31 +09:00
minaChoi d7fffc80a4 feat: GA search_landing — 구글·네이버 검색으로 지역 페이지에 들어오면 검색 결과 문구(새·예전)별로 보냄 2026-10-30 14:43:39 +09:00
minaChoi ce1d222216 feat: 지역 오늘·내일 페이지 절반에 검색 결과 새 문구 — 날짜·지역 먼저인 설명, 내일 제목에 내일 1위 각, 나머지 반은 예전 문구로 두고 클릭률 비교 2026-10-30 14:43:39 +09:00
minaChoi ed2ab86404 docs: TODO 에 검색 클릭률 비교·보류한 본문 채우기·주말 순위 비는 문제·오늘 설명 비/한강각 어긋남 기록 2026-10-30 14:43:39 +09:00
minaChoi ec9e3a52c4 Merge remote-tracking branch 'origin/main' into sns 2026-10-30 12:00:39 +09:00
minaChoi 7a73c33c73 docs: 10/30 할로윈 느낌 코디 게시 기록 2026-10-30 12:00:39 +09:00
minaChoi 5dc61770f4 feat: 코디 스냅을 그날 분위기 색으로 먼저 고르기(snap.mjs --prefer), 코디 해시태그 앞에 copy.tags(할로윈 등) 2026-10-30 12:00:39 +09:00
minaChoi 82ca286ea4 feat: GA 이벤트 이름을 한국어로 — 코드 키는 그대로, analytics.ts GA_NAME 이 바꿔 보냄(로그인·회원가입·공유 포함), 첫화면_멈춤도 2026-10-30 12:00:38 +09:00
minaChoi 442441931f fix: 구글·토스로 처음 들어와 계정이 생기면 GA sign_up — 서버 응답 is_new, 다시 들어오면 login 2026-10-30 11:49:01 +09:00
minaChoi 1f040bc6d4 Merge remote-tracking branch 'origin/main' into sns 2026-10-30 11:37:28 +09:00
minaChoi df34d0a1b4 docs: 10/30 나들이 타로 게시 기록 2026-10-30 11:37:28 +09:00
minaChoi b436ee0e0a feat: 타로 해시태그 — 대주제 배경과 안 맞는 주제는 copy.tags 로 주제 태그를 바꿈(나들이 등) 2026-10-30 11:37:28 +09:00
minaChoi 9f6a6b477b feat: 할로윈 꾸밈을 10/30부터 2026-10-30 11:19:35 +09:00
minaChoi cfd45c3b3a fix: 기념일 소품 조각 안쪽 가장자리를 흐리게 — 크리스마스·빼빼로 소품이 조각 경계에서 일자로 잘려 보이던 것 2026-10-30 11:12:39 +09:00
minaChoi 70286030b1 fix: 기념일 소품을 헤더부터 네 귀퉁이에 — 폰은 반씩 폭을 채우고 웹은 300px로 양옆에 붙어 안 잘림, 헤더 칸은 흐림 막 위에 한 번 더 그려 선명하게 2026-10-30 11:06:09 +09:00
minaChoi 89ad5e1600 fix: 기념일 배경을 하늘 위 투명 소품으로 — 하늘색·노치·색 덩어리는 원래대로, 소품 그림은 상단바 아래·화면 아래 두 조각으로 폭에 맞춤 2026-10-30 11:00:51 +09:00
minaChoi 1c9e15500b feat: 기념일 배경을 행사 그림으로 — 할로윈(달·유령·호박), 빼빼로, 크리스마스(전구·눈사람), 추석(보름달·토끼·송편)을 화면 전체 하늘 위에 깔고 밤엔 어둡게, 떠다니는 아이콘은 뺌 2026-10-30 10:52:53 +09:00
minaChoi cff44be771 feat: 기념일엔 앱 배경도 바뀜 — 할로윈 주황·보라(밤엔 보라 밤하늘), 크리스마스 초록·빨강, 빼빼로 초코·분홍, 추석 노랑·달빛, 노치 색과 떠다니는 기념일 그림 2026-10-30 10:46:56 +09:00
minaChoi 26624f0888 feat: 빼빼로데이·크리스마스 게임 그림을 빼빼로·크리스마스 소품으로 — 하트·편지(발렌타인 느낌), 눈송이·종(겨울 느낌) 대신 2026-10-30 10:22:22 +09:00
minaChoi 4a110c70de feat: 빼빼로데이·크리스마스 게임 그림을 빼빼로·크리스마스 소품으로 — 하트·편지(발렌타인 느낌), 눈송이·종(겨울 느낌) 대신 2026-10-30 10:00:50 +09:00
minaChoi 19d84397ce Merge branch 'feat/tomorrow-page' — 내일 날씨 페이지를 내일 내용으로 2026-10-30 09:58:17 +09:00
minaChoi 9431dc31c2 feat: 내일 날씨 페이지(/tomorrow/...) 히어로 아래를 내일 것으로 — 내일의 각 5개·내일 3시간 예보·내일 열리는 행사·오늘 소식 버튼(GA tomorrow_to_today), 오늘 피드는 빼서 같은 지역 오늘 페이지와 본문이 97% 겹쳐 구글이 하나만 색인하던 것을 줄임 2026-10-30 09:58:17 +09:00
minaChoi 08f9275c45 Merge branch 'docs/search-1030' 2026-10-30 09:57:13 +09:00
minaChoiandClaude Opus 5.5 66f0bf8072 docs: 10/30 검색 노출 — 구글·네이버 대표 검색어 순위 열 추가, 변화 없음(구글은 제주 날씨부터 CAPTCHA로 16개 못 잼)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 09:57:12 +09:00
minaChoi 4fec164364 feat: 기념일 꾸밈 — 할로윈·빼빼로데이·크리스마스·추석 기간에만 이야기 주제와 구름 합치기 그림이 바뀜
frontend/src/b/holiday.ts 한 곳에 기간·주제·배경·게임 그림. ?holiday=<key> 로 미리 보기.
GA: game_start theme 추가, talk_post topic 6~9.
2026-10-30 09:15:53 +09:00
minaChoi 3c58552852 Merge branch 'fix/keep-old-assets' — 배포 때 예전 빌드 파일 남기기 2026-10-30 09:00:39 +09:00
minaChoi 4b321c1991 fix: 배포 때 예전 빌드 파일을 2주 남김 — 열어 둔 탭(폰 크롬)과 구글 렌더가 예전 HTML 로 지워진 파일을 불러 '날씨 불러오는 중'에서 멈추던 것 2026-10-30 09:00:39 +09:00
minaChoi 48299e3ac5 Merge branch 'fix/now-slot-summary-hour' — 지금 구간 날씨 줄을 지금 시각으로, 단풍 지도 좋아요·댓글 복구 2026-10-29 16:16:08 +09:00
minaChoi 4f36451da0 fix: 단풍 지도 카드에 좋아요·댓글이 다시 보이게 — 10/27 카드 위치를 옮기며 빠진 foliage_post 연결 복구 2026-10-29 16:12:40 +09:00
minaChoi 751beb6e33 fix: 오늘의 각 줄 날씨가 지금 시각이 아니라 남은 구간 가운데 시각(4시 10분인데 '오후 5시')으로 보이던 것 — 지금 구간은 지금 시각 날씨로 2026-10-29 16:12:40 +09:00
minaChoi e0c3cbf6ea Merge branch 'feat/feed-mix-talks-events' — 사람 글·행사를 피드 포스트로, 사람 글 댓글 2026-10-29 15:25:15 +09:00
minaChoi c5b0806cbc Merge branch 'fix/running-gak-too-often' — 러닝각 활동 시간대 밖·비·추위 상한 2026-10-29 15:25:15 +09:00
minaChoi dba3d78f14 feat: 오늘 피드 — 사람 글을 묶음 대신 포스트처럼 두 장마다 한 장씩(큰 카드·댓글), 행사는 띠 대신 축제 전부와 팝업·전시·공연 2개씩 포스트로
- 사람 글 큰 카드: 머리줄·4:5 본문(사진, 없으면 글을 크게)·좋아요·댓글·보내기
- 사람 글 댓글: 로그인한 사람만, comment 표에 talk_id, talk.comment_count (init.sql)
- '오늘 내 글'·'동네 사람들'·주제별 묶음, '이번 주 가까운 행사' 띠 제거
- 행사 포스트 자리 최대 40개, 앞쪽 절반에 다 못 들어가면 끝까지 한 장씩 걸러
- GA: feed_item_view(talk·event 노출), talk_comment
2026-10-29 15:25:11 +09:00
minaChoi d082e71316 fix: 러닝각이 비·추위·낮 시간에도 위에 뜨던 것 — 활동 시간대(6~8시·19~22시) 밖 구간은 최대 50점, 비 확률 60% 이상 30점·70% 이상 0점, 체감 5° 미만 40점·0° 미만 0점, 강풍·돌풍·미세먼지·더위 상한, 점수 구간 문구 교체
- 지수 0점 조건에서 time_matches(활동 시간대 일치)를 볼 수 있게 함 (다른 각은 그대로)
- 편한 체감 5~18°(최적 12°), 바람 잔잔 기준 3m/s·한계 8m/s
- FAQ·각 계산기준 문서 갱신 (검토: Codex gpt-6-astra)
2026-10-29 15:25:06 +09:00
minaChoiandClaude Opus 5.5 b8b5bcf31a fix: '날씨 불러오는 중'에서 두 번째로 다시 불러올 때부터 폰에 남은 빌드 파일을 새로 받아 덮고 서비스 워커를 걷어낸 뒤 다시 불러옴 — 1년 캐시된 파일이 깨져 새로고침해도 계속 멈추던 경우를 스스로 풂
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 15:19:54 +09:00
minaChoi fabf9b3910 Merge branch 'feat/weather-saju' — /ga-report 스킬 저장소로 2026-10-29 15:17:25 +09:00
minaChoi 49df651cfe feat: /ga-report 스킬을 저장소로 — GA4·운영 DB 사용 현황 분석, 키는 각자 secrets/ga-key.json 2026-10-29 15:17:24 +09:00
minaChoi f6cb6f2deb Merge branch 'feat/weather-saju' — 10/29 GA 분석 기록 2026-10-29 14:01:56 +09:00
minaChoi 9f6bb16285 docs: 10/29 GA 분석 — 구글 검색 유입 3배, 사용자 70%는 테스트 트래픽(추정), 설치 카드 0명 2026-10-29 14:01:55 +09:00
minaChoi fb12a7dfb4 Merge branch 'fix/boot-stuck-report' 2026-10-29 13:35:19 +09:00
minaChoiandClaude Opus 5.5 8f5df2d352 fix: '날씨 불러오는 중'에서 8초 넘게 멈추면 첫 오류 문구와 다시 불러오기 버튼을 띄우고 GA boot_stuck 으로 보냄, 연달아 3번 다시 불러와도 그대로면 자동 새로고침 멈춤
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:35:19 +09:00
minaChoi 263f01b4f1 fix: 신강·신약을 득령 먼저 보고 판정 — 월령 오행이 일간을 도우면 +0.15, 45~55%는 중화 (未월 己土가 시주 하나로 신약이 되던 문제) 2026-10-29 13:30:50 +09:00
442 changed files with 11667 additions and 1695 deletions

No files matched your search

+75
View File
@@ -0,0 +1,75 @@
---
name: ga-report
description: 날씨각 GA4 와 운영 DB 숫자로 지난 기간 사용 현황을 분석해 바뀐 것·원인·다음 할 일을 짧게 보고한다
argument-hint: "<일수> 예) 7 · 28 (비우면 7일)"
---
날씨각(weather.o2o.kr·토스판) 사용 현황을 GA4 와 운영 DB 로 보고, 바로 앞 같은 길이 기간과 비교해 판단과 다음 할 일을 낸다. 인자 `$ARGUMENTS` = 일수(비우면 7). 기간은 어제까지(오늘은 하루가 안 끝나 뺀다). 아래 경로는 모두 저장소 루트 기준이다.
## 0. 처음 한 번 (PC마다)
- GA 키: 팀에서 받은 JSON 을 저장소 원본 폴더의 `secrets/ga-key.json` 으로 둔다(`secrets/` 는 `.gitignore` 라 커밋되지 않는다). 키는 사람마다 따로 발급한다(GCP `nalssigak` → 서비스 계정 `nalssigak-ga` → 키 추가). 키를 메신저·메일·git 으로 다시 돌리지 않는다.
- `uv` 가 없으면 `brew install uv`.
- 키가 없으면 1번 스크립트가 "GA 키가 없어요" 로 멈춘다. 그때는 사용자에게 키를 받으라고 알리고 멈춘다.
- (선택) Claude Code 에서 GA 를 직접 묻고 싶으면 `claude mcp add analytics-mcp --scope user -e GOOGLE_APPLICATION_CREDENTIALS=<저장소 원본 폴더>/secrets/ga-key.json -e GOOGLE_CLOUD_PROJECT=nalssigak -- uvx analytics-mcp` 후 Claude Code 를 다시 시작한다.
## 1. GA4 받기
```
uvx --from analytics-mcp python .claude/skills/ga-report/ga_pull.py <일수> > /tmp/ga_report.json
```
- 키는 스크립트가 저장소 원본 폴더의 `secrets/ga-key.json` 에서 찾는다(워크트리에서 불러도 같음).
- 속성 `558046406`(날씨각 웹, 계정 AIO2O). 서비스 계정 `nalssigak-ga@nalssigak.iam.gserviceaccount.com`, 권한은 GA 뷰어뿐. 키 파일 내용은 열거나 옮기지 않는다.
- 결과 JSON: 값마다 `[이번, 앞 기간]`. `totals`·`daily`·`platform`·`host`·`channels`·`sources`·`landing`·`pages`·`devices`·`new_vs_returning`·`cities`·`events`·`gak_views`·`region_changes`, 퍼널 4개(`funnel_saju`·`funnel_game`·`funnel_install`·`funnel_login`, 이번 기간만), `cohorts`(첫 방문 주별 재방문).
- `errors` 가 비어 있지 않으면 그 항목은 못 받은 것이다. 보고에 적고 넘어간다.
- 더 파고들 게 있으면 `analytics-mcp` MCP 도구(`run_report`·`run_funnel_report`·`run_realtime_report`)를 쓴다. 이 세션에 도구가 없으면 같은 키로 `google.analytics.data_v1beta` 를 직접 부른다.
- 이벤트 뜻은 저장소 `docs/이벤트_추적.md` 이벤트 목록을 기준으로 읽는다.
## 2. 운영 DB 숫자 (읽기만, 집계만)
GA 는 로그인·레벨·사주 저장을 모른다. 같은 기간을 운영 DB 에서 센다. 개인 값(닉네임·아이디·생년월일)은 뽑지 않는다.
```
ssh King_admin 'docker exec -i o2o-weather-postgres-1 sh -c "psql -U \$POSTGRES_USER -d \$POSTGRES_DB"' <<'SQL'
\set s '<시작 YYYY-MM-DD>'
\set e '<끝 YYYY-MM-DD>'
SELECT provider, count(*) AS signups FROM users WHERE NOT deleted AND (created_at AT TIME ZONE 'Asia/Seoul')::date BETWEEN :'s' AND :'e' GROUP BY provider ORDER BY provider;
SELECT action, count(*) AS n, count(DISTINCT user_id) AS users FROM point_log WHERE day BETWEEN :'s' AND :'e' AND action <> 'admin' GROUP BY action ORDER BY n DESC;
SELECT count(DISTINCT user_id) AS active_earners FROM point_log WHERE day BETWEEN :'s' AND :'e' AND action <> 'admin';
SELECT lv, count(*) FROM (SELECT CASE WHEN p >= 1000 THEN 7 WHEN p >= 700 THEN 6 WHEN p >= 400 THEN 5 WHEN p >= 200 THEN 4 WHEN p >= 100 THEN 3 WHEN p >= 30 THEN 2 ELSE 1 END AS lv
FROM (SELECT u.user_id, COALESCE(sum(l.points) FILTER (WHERE l.action <> 'admin'), 0) AS p FROM users u LEFT JOIN point_log l USING (user_id) WHERE NOT u.deleted GROUP BY u.user_id) t) x GROUP BY lv ORDER BY lv;
SELECT count(*) FILTER (WHERE birth_date IS NOT NULL) AS birth_saved, count(*) AS users FROM users WHERE NOT deleted;
SQL
```
- provider: 1 아이디, 2 구글, 3 토스. 앞 기간도 같은 쿼리로 센다.
- `point_log` 의 `action='admin'` 은 관리자가 레벨을 올려 준 것이라 늘 뺀다. 레벨 경계는 `backend/services/level_service.py` `LEVELS` 를 따른다(바뀌었으면 쿼리도 맞춘다).
## 3. 그 기간에 바뀐 것
`git log origin/main --first-parent --since=<시작> --until=<끝+1일> --format='%ad %s' --date=short` 로 배포된 변화를 뽑는다. 숫자 변화와 날짜가 겹치는 변화를 후보 원인으로만 적는다.
## 4. 읽는 규칙
- **결론부터, 판단으로.** 숫자를 늘어놓지 말고 "무엇이 좋아졌고 나빠졌는지 → 왜 그렇게 보는지(근거 숫자) → 그래서 할 일" 순서로 쓴다. 전제에서 결론까지 고리를 빠짐없이 적는다.
- **작은 수는 사람 수로.** 한 칸이 30명 미만이면 비율(전환율·참여율)로 말하지 않고 "12명 중 3명"처럼 적는다. 앞 기간이 10명 미만이면 증감 %를 쓰지 않는다.
- **우리 팀 트래픽을 가린다.** 회사가 성남(분당)이라 `cities` 의 Seongnam-si, `region_changes` 에서 소수가 수십 번 바꾼 지역(예: 분당구 108번·7명)은 팀 테스트일 가능성이 크다. 그 몫을 빼고 봤을 때도 결론이 같은지 함께 적는다. 추정이면 "추정"이라고 표시한다.
- **한 기간 변화로 원인을 단정하지 않는다.** 배포·홍보(인스타·검색)와 날짜가 겹치면 "후보"로 두고, 2기간 이상 같은 방향일 때만 원인이라고 쓴다.
- **퍼널은 개발 서버 이벤트가 섞여 있다**(퍼널 API 에 호스트 거름을 안 걸었다). 큰 그림만 보고, 단계 사이 사람 수가 1~2명이면 판단하지 않는다.
- **못 보는 것은 못 본다고 쓴다.** 지금 GA 맞춤 측정기준은 `gak_name`·`platform`·`region_name` 셋뿐이라, `today_icon` 의 `icon`·`sheet_open` 의 `sheet`·`saju_view` 의 `score` 같은 값별 나눔은 GA 에서 안 나온다. 필요하면 "GA4 관리 → 맞춤 정의에 ○○ 등록"을 할 일로 낸다(등록 전 데이터는 소급 안 됨).
- `platform` 이 `(not set)` 인 몫은 그 값이 붙기 전 이벤트(자동 수집 `page_view`·`session_start` 등)다. 웹·토스 비교는 `host`(weather.o2o.kr vs nalssigak.apps.tossmini.com)로 본다.
## 5. 기록
- 저장소 `docs/이벤트_추적.md` 맨 아래 `## 분석 기록` 표(없으면 만든다: 날짜 · 기간 · 활성 사용자(앞 기간) · 신규 · 가입(DB) · 바뀐 것 · 할 일)에 한 줄 더한다.
- 결정이 필요한 것(맞춤 측정기준 등록, 내부 트래픽 필터, 기능 손보기)은 `TODO.md` 에 `[결정 필요]` 행으로 적는다.
- main 에 바로 커밋하지 않는다. 작업 브랜치에서 커밋해 main 에 합친다. 커밋은 `docs: <날짜> GA 분석 — <한 줄>`.
- 코드·문구는 고치지 않는다. 제안만 한다.
## 6. 보고 (채팅, 짧게)
1. **결론 3줄 이내**: 이번 기간 핵심 변화와 그 판단.
2. **바뀐 것 (앞 기간 대비)**: 사용자·신규·재방문, 유입 경로, 기능별 사용(사주·게임·오늘 한 장·쇼츠·단풍·동네 이야기·각 상세), 가입·레벨(DB). 기능마다 한 줄, 사람 수로.
3. **다음 할 일 1~3개**: 무엇을 · 왜(근거 숫자) · 기대 효과. 측정이 안 돼서 판단 못 한 건 "측정 먼저"로 낸다.
4. 못 받은 항목(`errors`)·못 보는 것이 있으면 한 줄.
+143
View File
@@ -0,0 +1,143 @@
"""날씨각 GA4 숫자를 한 번에 받아 JSON 으로 낸다. 이번 기간과 바로 앞 같은 길이 기간을 함께 받는다.
실행: uvx --from analytics-mcp python .claude/skills/ga-report/ga_pull.py [일수]
키는 저장소 원본 폴더의 secrets/ga-key.json (워크트리에서 불러도 원본 폴더 것을 쓴다). GOOGLE_APPLICATION_CREDENTIALS 가 있으면 그걸 쓴다.
개발 서버(localhost 등)에서 나간 이벤트는 모두 뺀다.
"""
import json
import os
import subprocess
import sys
from datetime import date, timedelta
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS"):
common = subprocess.run(["git", "rev-parse", "--path-format=absolute", "--git-common-dir"], cwd=os.path.dirname(os.path.abspath(__file__)),
capture_output=True, text=True, check=True).stdout.strip()
key = os.path.join(os.path.dirname(common), "secrets", "ga-key.json")
if not os.path.exists(key):
sys.exit(f"GA 키가 없어요: {key} (팀에서 받은 키 파일을 이 이름으로 두세요)")
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = key
from google.analytics.data_v1alpha import AlphaAnalyticsDataClient
from google.analytics.data_v1alpha import types as A
from google.analytics.data_v1beta import BetaAnalyticsDataClient
from google.analytics.data_v1beta.types import (
CohortSpec, Cohort, CohortsRange, DateRange, Dimension, Filter, FilterExpression, FilterExpressionList, Metric, OrderBy, RunReportRequest,
)
PROPERTY = "properties/558046406"
DAYS = int(sys.argv[1]) if len(sys.argv) > 1 else 7
END = date.today() - timedelta(days=1) # 오늘은 하루가 안 끝나 빼고 어제까지
CUR = (END - timedelta(days=DAYS - 1), END)
PREV = (CUR[0] - timedelta(days=DAYS), CUR[0] - timedelta(days=1))
DEV_HOSTS = ["localhost", "127.0.0.1", "192.168."]
beta = BetaAnalyticsDataClient()
alpha = AlphaAnalyticsDataClient()
out: dict = {"days": DAYS, "cur": [str(CUR[0]), str(CUR[1])], "prev": [str(PREV[0]), str(PREV[1])], "errors": []}
def not_dev() -> FilterExpression:
return FilterExpression(not_expression=FilterExpression(or_group=FilterExpressionList(expressions=[
FilterExpression(filter=Filter(field_name="hostName", string_filter=Filter.StringFilter(match_type=Filter.StringFilter.MatchType.CONTAINS, value=h)))
for h in DEV_HOSTS
])))
def event_is(name: str) -> FilterExpression:
return FilterExpression(filter=Filter(field_name="eventName", string_filter=Filter.StringFilter(value=name)))
def both(a: FilterExpression, b: FilterExpression) -> FilterExpression:
return FilterExpression(and_group=FilterExpressionList(expressions=[a, b]))
def report(key: str, dims: list[str], metrics: list[str], limit: int = 30, compare: bool = True, where: FilterExpression | None = None) -> None:
"""이번·앞 기간 표. 행마다 {dims..., metric: [이번, 앞]}"""
ranges = [DateRange(start_date=str(CUR[0]), end_date=str(CUR[1]), name="cur")]
if compare:
ranges.append(DateRange(start_date=str(PREV[0]), end_date=str(PREV[1]), name="prev"))
try:
r = beta.run_report(RunReportRequest(
property=PROPERTY, date_ranges=ranges, dimensions=[Dimension(name=d) for d in dims], metrics=[Metric(name=m) for m in metrics],
dimension_filter=both(not_dev(), where) if where else not_dev(), limit=limit * 2,
order_bys=[OrderBy(metric=OrderBy.MetricOrderBy(metric_name=metrics[0]), desc=True)],
))
except Exception as e:
out["errors"].append(f"{key}: {e}")
return
rows: dict[tuple, dict] = {}
for row in r.rows:
vals = [v.value for v in row.dimension_values]
rng = vals[-1] if compare else "cur"
k = tuple(vals[:len(dims)])
item = rows.setdefault(k, {**dict(zip(dims, k)), **{m: [0, 0] for m in metrics}})
for m, v in zip(metrics, row.metric_values):
item[m][0 if rng == "cur" else 1] = round(float(v.value), 3)
out[key] = sorted(rows.values(), key=lambda x: -x[metrics[0]][0])[:limit]
def funnel(key: str, steps: list[tuple[str, str, str | None]]) -> None:
"""(단계 이름, 이벤트, page_location 에 들어갈 글자) 순서대로. 이번 기간만"""
def step(name: str, event: str, path: str | None) -> A.FunnelStep:
f = A.FunnelEventFilter(event_name=event)
if path:
f.funnel_parameter_filter_expression = A.FunnelParameterFilterExpression(funnel_parameter_filter=A.FunnelParameterFilter(
event_parameter_name="page_location", string_filter=A.StringFilter(match_type=A.StringFilter.MatchType.CONTAINS, value=path)))
return A.FunnelStep(name=name, filter_expression=A.FunnelFilterExpression(funnel_event_filter=f))
try:
r = alpha.run_funnel_report(A.RunFunnelReportRequest(
property=PROPERTY, date_ranges=[A.DateRange(start_date=str(CUR[0]), end_date=str(CUR[1]))],
funnel=A.Funnel(steps=[step(*s) for s in steps]),
))
except Exception as e:
out["errors"].append(f"{key}: {e}")
return
table = r.funnel_table
heads = [h.name for h in table.metric_headers]
out[key] = [{"step": row.dimension_values[0].value, **{h: round(float(v.value), 3) for h, v in zip(heads, row.metric_values)}} for row in table.rows]
def cohorts() -> None:
"""첫 방문 주별 4개 묶음이 그다음 주들에 몇 명 다시 왔는지"""
monday = END - timedelta(days=END.weekday())
groups = [Cohort(name=f"week_{i}", dimension="firstSessionDate", date_range=DateRange(
start_date=str(monday - timedelta(weeks=i)), end_date=str(monday - timedelta(weeks=i) + timedelta(days=6)))) for i in range(4, 0, -1)]
try:
r = beta.run_report(RunReportRequest(
property=PROPERTY, dimensions=[Dimension(name="cohort"), Dimension(name="cohortNthWeek")], metrics=[Metric(name="cohortActiveUsers")],
cohort_spec=CohortSpec(cohorts=groups, cohorts_range=CohortsRange(granularity=CohortsRange.Granularity.WEEKLY, end_offset=3)),
))
except Exception as e:
out["errors"].append(f"cohorts: {e}")
return
table: dict[str, dict] = {}
for g in groups:
table[g.name] = {"first_week": g.date_range.start_date}
for row in r.rows:
c, n = row.dimension_values[0].value, int(row.dimension_values[1].value)
table[c][f"week+{n}"] = int(row.metric_values[0].value)
out["cohorts"] = list(table.values())
report("totals", [], ["activeUsers", "newUsers", "sessions", "engagedSessions", "engagementRate", "averageSessionDuration", "screenPageViews", "eventCount"])
report("daily", ["date"], ["activeUsers", "newUsers", "sessions"], limit=DAYS, compare=False)
report("platform", ["customEvent:platform"], ["activeUsers", "sessions", "eventCount"])
report("host", ["hostName"], ["activeUsers", "sessions"], limit=10)
report("channels", ["sessionDefaultChannelGroup"], ["sessions", "activeUsers", "engagementRate"])
report("sources", ["sessionSource", "sessionMedium"], ["sessions", "activeUsers", "engagementRate"], limit=15)
report("landing", ["landingPage"], ["sessions", "engagementRate", "averageSessionDuration"], limit=20)
report("pages", ["pagePath"], ["screenPageViews", "activeUsers", "userEngagementDuration"], limit=25)
report("devices", ["deviceCategory", "operatingSystem"], ["activeUsers", "sessions", "engagementRate"], limit=10)
report("new_vs_returning", ["newVsReturning"], ["activeUsers", "sessions", "engagementRate"])
report("cities", ["city"], ["activeUsers"], limit=15)
report("events", ["eventName"], ["eventCount", "totalUsers"], limit=60)
report("gak_views", ["customEvent:gak_name"], ["eventCount", "totalUsers"], limit=15, where=event_is("view_gak"))
report("region_changes", ["customEvent:region_name"], ["eventCount", "totalUsers"], limit=15, where=event_is("region_change"))
funnel("funnel_saju", [("사주 페이지", "page_view", "/saju"), ("생년월일 넣음", "saju_input", None), ("결과 봄", "saju_view", None)])
funnel("funnel_game", [("게임 페이지", "page_view", "/game"), ("첫 판 시작", "game_start", None), ("라운드 깸", "game_round", None), ("끝까지 함", "game_over", None)])
funnel("funnel_install", [("설치 카드 봄", "install_banner_view", None), ("설치 누름", "install_click", None), ("설치 완료", "install_done", None)])
funnel("funnel_login", [("첫 방문", "first_visit", None), ("창 열기", "sheet_open", None), ("로그인", "login", None)])
cohorts()
print(json.dumps(out, ensure_ascii=False, indent=1))
+6
View File
@@ -27,6 +27,12 @@ backend/uploads/
.impeccable/
/zzz
# 안드로이드 스튜디오 개인 설정
.idea/
# 루트에 생기는 안드로이드 디버그 빌드 산출물 (소스 없음)
/app/build/
# 인증서·키: 서버와 각자 PC 에만 둔다 (토스 mTLS 등)
secrets/
*.pem
+31 -1
View File
@@ -238,7 +238,7 @@
| [ ] | **[결정 필요]** 포스트 시도 단위가 17이 아니라 16 — `region.code` 앞 2자리에서 광주·전남이 둘 다 `12`(전남광주통합특별시)라 같은 댓글창을 씀. 그대로 둘지, 이름 앞머리로 광주·전남을 나눌지 | 포스트 시도 나누기 (10/8) | `backend/services/feed_service.py` (`sido_of`), `backend/seed/region.csv` |
| [ ] | 광주·전남 구는 행사가 안 잡힐 수 있음 — 구 코드 시도는 `12`인데 행사 수집·`event.sido_code`는 `29`(광주)·`46`(전남). 좌표 없는 행사는 `is_nearby`·`nearby_sidos`에서 빠짐 | 포스트 시도 나누기 중 발견 (10/8) | `backend/services/week_service.py:125,144`, `backend/services/external/culture_api.py:28` |
| [ ] | **[결정 필요]** 앱인토스 입점 여부 — 검토안은 "웹 출시 후 보기 전용 토스판으로 시험, 첫 달 포인트·알림 20~30만 원, 5주차에 포인트 없는 주의 7일 재방문율 20%를 기준으로 계속/중단" (https://claude.ai/artifact/QgA7iq3CCesTRYcFyZck71) | 앱인토스 검토 | |
| [ ] | **[결정 필요]** 토스판 광고 — 앱인토스 수익은 토스 광고·인앱결제뿐인데 웹은 '광고 없음'으로 정함. 안 붙이면 토스판은 비용만 드는 홍보 채널 | 앱인토스 검토 | |
| [ ] | 토스판 광고 — 결정함(11/23): 토스판에만 보상 없는 '광고 보고 응원하기' 카드(`tossAd.tsx`), 웹·앱은 계속 '광고 없음'. 광고 그룹 `보상형 광고 1차(각)`가 2026-12-02 에 삭제 예정이라 그 전에 `build:toss` 번들을 콘솔에 올려 노출시켜야 함(검수 3~5영업일). 운영 번들은 `frontend/.env.toss` 에 `VITE_TOSS_REWARD_AD_ID`(라이브 ID)를 넣고 만들 것 — 없으면 테스트 ID 로 동작 | 앱인토스 메일(11/23) | `frontend/src/b/tossAd.tsx` |
| [ ] | 앱인토스 사전 확인 — 시간대별 밤 배경이 '라이트 모드' 규칙에 걸리는지, 네이버 지도 링크가 '단순 정보 확인' 예외인지 채널톡 문의 | 앱인토스 검토 | `frontend/src/b/BLayout.tsx`, `frontend/src/b/ui.tsx` |
| [ ] | **[결정 필요]** 각 34개 정리 — 계절 밖 각(10월 물놀이·냉면) 노출 막기(각별 '보여 줄 달'), 나쁜 일 예고 각(택시대란·배달폭주·김서림·화장붕괴)을 순위에서 빼고 '조심' 카드로, 날씨 관계 약한 재미 각(공부·넷플릭스·짬뽕·막걸리·뜨아·군밤·집콕) 축소 또는 '재미' 표시 (https://claude.ai/artifact/4WgpUjdNqdSNnMN4ASB4BB) | 토스판 전략 검토 | `backend/seed/index_definition.json`, `backend/services/index_service.py` |
| [ ] | 글 재고 부족 — 25편(한 문장 8·시 3·상식 4·계절 9)이라 매일 보면 1~2주 안에 반복, 계절 글은 10월분뿐. 기획의 'AI 주 1회 생성'이 스케줄러에 없음. 8주치 재고 또는 생성·검토 파이프라인 | 토스판 전략 검토 | `backend/seed/article.json`, `backend/scheduler/jobs.py` |
@@ -328,6 +328,8 @@
| [x] | 10/28 세미정장 코디(철회: 20-30대 남자에 나팔바지라는 피드백, 포스트 4903 10/28 삭제함(deleted=true)·인스타 앱에서 삭제 필요) — 킹서버 카드 23→포스트 4903, 인스타 https://www.instagram.com/p/DfBIhUdAbbV/. 참고 스냅 f20 https://www.musinsa.com/snap/1560205304641814679 · m20 https://www.musinsa.com/snap/1551785083122597386 · f40 https://www.musinsa.com/snap/1551572173880406114 · m40 https://www.musinsa.com/snap/1556284432455808475. 4장 1:1 검수. 크롬이 2번째 장 렌더에서 멈춰 장마다 프로필을 따로 써서 다시 찍음, 인스타 API는 request limit을 돌려줬지만 실제 게시됨(ig_media_id 미기록) | 사용자 요청 (10/28) | `admin/scripts/card.mjs` |
| [x] | 10/28 세미정장 코디 다시(20-30대 남자만 교체: 오피서 코트·헨리넥 니트·다크 브라운 와이드 팬츠·헤비 부츠·토트백, 코디 구성을 먼저 확인받고 그림) — 킹서버 카드 24→포스트 4904, 인스타 https://www.instagram.com/p/DfBJ4SlAaok/. 참고 스냅 m20 https://www.musinsa.com/snap/1562338908609136514 (나머지 3명은 카드 23과 같음). 첫 그림은 상품 썸네일을 따라 바지가 베이지로 나와 스냅 색(브라운)으로 다시 그림 | 사용자 요청 (10/28) | `admin/scripts/daily-ootd.mjs` |
| [x] | 10/28 연애 타로(단풍각·데이트각·별보기각, 새 표지: 주제 배지 + 큰 질문) — 킹서버 카드 26→포스트 4906, 인스타 https://www.instagram.com/p/DfBQCW0ARgL/ (ig_media_id 17953447719320497). 처음 올린 카드 25→포스트 4905(인스타 DfBPIHJAR0m)는 행운 포인트가 날씨 정보뿐이라는 피드백으로 철회: 포스트 4905 deleted=true, 인스타 글은 앱에서 삭제됨. 행운 포인트를 "시각 · 행운 아이템"(리딩 속 행동에 쓰는 물건)으로 바꿔 다시 게시. 문구를 먼저 확인받음: 첫 기획의 행운 포인트(6시 1도·10시 바람)를 예보 slot 값으로 고치고, 연애와 관련 없는 카드(해돋이각·테니스각)를 데이트각·별보기각으로 바꿈. 5장 1:1 검수. 인스타 API는 두 번 다 request limit을 돌려줬지만 실제 게시됨(최신 글 확인 후 재시도 안 함) | 사용자 요청 (10/28) | `admin/src/cards/templates.tsx`, `admin/scripts/plan.mjs` |
| [x] | 10/30 나들이 타로(억새각·캠핑각·야장각, 질문 "이번 주말, 어디로 놀러 갈까요?", 행운 시각은 토요일 서울 예보) — 킹서버 카드 29→포스트 6713, 인스타 https://www.instagram.com/p/DfGhl5YgUqE/ . 인스타 API가 'Application request limit reached'를 돌려줬지만 실제로 올라가 다시 안 올림(card_set.ig_media_id 는 비어 있음). '나들이'는 대주제 배경(skin)이 없어 star 태그(#공부 #직장인)가 붙던 것을 copy.tags 로 #주말나들이 #주말뭐하지 #가을나들이 #나들이타로 로 바꿈. 관리자 서버가 옛 로컬 백엔드(9810, /v1/index/list 500)를 보고 있어 운영 API(weather.o2o.kr)로 다시 켬 | 인스타 홍보 | `admin/src/cards/templates.tsx` |
| [x] | 10/30 할로윈 느낌 캐주얼 코디(블랙·브라운 톤 — 무신사 인기 스냅에 주황 코디가 거의 없어 할로윈 색 중 블랙·브라운으로) — 킹서버 카드 31→포스트 6714, 인스타 https://www.instagram.com/p/DfGj0zRAdhx/ (ig 17864943492694006, 첫 시도 ReadTimeout·둘째 'request limit' 응답이었지만 한 번만 올라감, card_set.ig_media_id 는 비어 있음). 참고 스냅: 20-30대 여자 https://www.musinsa.com/snap/1559108562982052217 · 20-30대 남자 https://www.musinsa.com/snap/1561961004027044406 · 40대~ 여자 https://www.musinsa.com/snap/1564225528677543586 · 40대~ 남자 https://www.musinsa.com/snap/1555156723956691019. 검수에서 스냅 사진과 달라 다시 그림: 20대 여자 플랫 검정→브라운, 40대 여자 부츠 발목→무릎 슬라우치, 40대 남자 하이넥 아이보리→브라운·신발 레이스업→스웨이드 첼시. 첫 카드 30은 반려 | 인스타 홍보 | `admin/scripts/snap.mjs` `--prefer` |
| [x] | 각 카드 그림 미리 생성 — 가을에 나올 만한 28장(피크닉·캠핑·놀이공원·빨래·단풍·억새·테니스·골프·군고구마·붕어빵·군밤·사진산책·별보기·환기·세차·이불빨래·데이트·치맥·막걸리·파전·우산·넷플릭스·집콕·한강밤바람·멍뭉산책·센치·감성노래·낚시) + 기존 8 = 36/68. 여름·한겨울 전용 32장은 철 되면 생성 | 사용자 요청 (10/26) | `admin/src/assets/gak-card/` |
| [ ] | 카드 자동화 다음 단계 — ① 생성 직후 자동 검사(Claude 비전: 옷 개수·사람·글자·추가 옷, 불합격 1회 재생성) ② 승인 대기 카드 메일/Teams 알림 + 서명 토큰 승인 링크(`GET /v1/card/{id}/approve`) ③ 맥 launchd 매일 06:30 `claude -p "/daily-cards"` ④ 그림 세트가 차면 킹서버로 이전 | 사용자 요청 (10/26) | `backend/router/v1/card/card.py`, `admin/scripts/` |
| [ ] | 앱 헤더가 400~448px 폭에서 컨테이너를 넘쳐 로그인 버튼이 잘림(`frontend/src/b/BLayout.tsx` TopBar). 캡처는 456px로 찍어 피했지만 실제 폰(430·440px)에서도 잘릴 수 있음 | 10/24 캡처 중 발견 | `frontend/src/b/BLayout.tsx` |
@@ -439,3 +441,31 @@ docs를 6개로 합칠 때 옛 내용을 그대로 옮겼다. 아래는 코드
| [ ] | 5단계: `.ait` 번들을 콘솔에 올리고 검수 요청 (3~5영업일, 반려 시 다시 3~5일) | 출시 | |
| [ ] | **[결정 필요]** 6단계(출시 후): 스마트 발송(알림) — 금요일 주말 판정, 노을 좋은 날. 노을 알림은 위 '노을 알림 재검토' 행 | 출시 후 별도 결정 | |
| [ ] | **[결정 필요]** 6단계(출시 후): 포인트 — 출시 후 2주만 쓰고 끊는다. 포인트를 끊은 주의 재방문율로 계속할지 판단 | 출시 후 별도 결정 | |
## GA 분석 (`/ga-report`, 기록은 `docs/이벤트_추적.md` '분석 기록')
| 상태 | 할 일 | 이유 | 관련 파일 |
|---|---|---|---|
| [ ] | **[결정 필요]** 자동 화면 테스트 트래픽을 GA에서 빼기 — ① 운영 사이트를 여는 Playwright 스크립트에서 GA 요청(googletagmanager·google-analytics)을 막기 ② GA4 관리 → 데이터 스트림 → 내부 트래픽 정의(사무실 IP) + 데이터 필터 활성 | 10/22~10/28 활성 206명 중 약 146명이 성남·아이폰 390x844(Playwright iPhone 기본 크기)·근무시간·참여 2~3초. 이대로면 사용자 수·전환율이 모두 틀림 | `/tmp/sweep/*.mjs` 등 Playwright 스크립트, GA4 관리 |
| [ ] | **[결정 필요]** GA4 맞춤 측정기준(이벤트 범위) 추가 등록 — `icon`(today_icon)·`sheet`(sheet_open)·`from`·`method`·`content_type`·`round`(game) | 지금 등록된 건 `gak_name`·`platform`·`region_name` 뿐이라 오늘 탭 아이콘별·창별·게임 라운드별 사용을 GA에서 못 나눔. 등록 전 데이터는 소급 안 됨 | GA4 관리 → 맞춤 정의 |
| [ ] | **[결정 필요]** '홈 화면에 추가' 카드 손보기 — 띄우는 조건(몇 번째 방문부터)·문구, 또는 빼기 | 10/22~10/28 테스트 트래픽 뺀 77명이 봤고 누른 사람 0 (앞 주 8명 중 1명 설치) | `frontend/src/b/installBanner.tsx` |
## 기념일 꾸밈 (`frontend/src/b/holiday.ts`)
| 상태 | 할 일 | 이유 | 관련 파일 |
|---|---|---|---|
| [ ] | `feat/halloween` main 병합 → 킹서버 배포(백엔드 `TalkTopic` 6~9 포함). 10/31 00시 전에 올라가야 할로윈이 켜짐 | 10/30 킹서버 작업 중이라 배포 보류 | `deploy.sh` |
| [ ] | 할로윈 타로·코디 카드 (`/daily-tarot 할로윈`, `/daily-ootd`) — 킹서버 게시라 보류 | 10/30 킹서버 작업 중 | |
| [ ] | 2028년부터 추석 날짜 추가 (음력이라 해마다 `ranges` 에 한 줄) | 2027-09-14~16만 들어 있음 | `frontend/src/b/holiday.ts` |
| [ ] | 수능 응원·연말·새해 기념일 배포 — 백엔드 `TalkTopic` 10·11 이 11/18 00시 전에 킹서버에 올라가야 수능 주제 글이 올라감. 앱은 새 빌드가 나가야 소품·게임 그림이 보임 | 11/12 수능(2026-11-18~19)·연말·새해(12-31~01-01) 추가 | `deploy.sh`, `shared/lib/holiday.ts` |
| [ ] | 2027년 수능 날짜 추가 (11월 셋째 목요일, 해마다 `ranges` 에 한 줄) | 2026-11-18~19만 들어 있음 | `shared/lib/holiday.ts` |
## 검색 클릭률 (10/30)
| 상태 | 할 일 | 이유 | 관련 파일 |
|---|---|---|---|
| [ ] | `/today`·`/tomorrow` 검색 결과 새 문구(내일 제목 '○○ 내일 날씨 · 내일 1위는 ○○각', 날짜·지역 먼저인 설명)를 지역 절반에만 배포하고, 배포 2주 뒤 Search Console에서 두 그룹 클릭률 비교 + GA `search_landing` 의 `copy` 별 유입. 기준(10/7~27 클릭률): 내일 새 그룹 0.044%·예전 그룹 0.047%, 오늘 새 그룹 0.044%·예전 그룹 0.026% | 10/30 사용자: 색인 늘리기보다 클릭률. 10/30 배포, 11/13쯤 비교 (구글이 다시 가져가야 검색 결과 문구가 바뀜) | `backend/services/seo_service.py`, `backend/services/seo_copy_test.json` |
| [ ] | (보류) `/foliage`·`/sky`·`/week` 서버 HTML에 실제 내용 넣기 — 새 URL 없이, 단풍 상태는 화면과 같은 4단계(단풍 전·첫 단풍·절정·절정 지남), 앱이 뜬 뒤에도 화면 아래에 글 남김. 지역 단풍·지역 주말 페이지는 안 만듦 | 10/30 사용자: 클릭률 먼저 | `frontend/vite.config.ts`, `frontend/nginx.conf`, `backend/services/seo_service.py` |
| [ ] | 주말 순위가 Redis 13시간 보관이라 06:40·18:40 갱신이 두 번 연속 실패하면 비어 보임 — 마지막 정상값 따로 보관 | 10/30 조사 중 발견 | `backend/services/weekend_rank.py`, `backend/worker_main.py` |
| [ ] | 오늘 페이지 설명에 "강수확률 60%, 비" 와 "낮은 한강각"이 같이 나옴(10/30 성남) — 하루 중 한 시간이라도 비면 "비"로 적는 요약과 시간대별 1위 각이 어긋나 보임. 계산이 맞는지 확인 | 10/30 클릭률 조사 중 발견 | `backend/services/seo_service.py` |
+8 -4
View File
@@ -1,5 +1,6 @@
// 무신사 스냅(공개 API)에서 오늘 날씨에 맞는 인기 코디를 사람별로 하나씩 고른다. 사진·상품 썸네일은 그림 참고용으로만 내려받고 어디에도 올리지 않는다.
// 사용(확인용): node scripts/snap.mjs --band mild --out out/2026-10-26/snaps
// 그날 분위기 색을 먼저 고르려면 --prefer '오렌지|브라운|카멜' (태그·글·상품명에 그 말이 있는 스냅을 앞에 둔다)
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
import { join, resolve } from 'node:path'
@@ -147,8 +148,9 @@ function fits(snap, band) {
return hasTop && hasBottom && slots.has('shoes') && !!snap.image
}
function score(snap, persona) {
function score(snap, persona, prefer) {
let s = Math.log10(snap.likes + 10)
if (prefer && (prefer.test(`${snap.tags.join(' ')} ${snap.text}`) || (snap.goods ?? []).some((g) => prefer.test(g.name)))) s += 3
const tagBlob = snap.tags.join(' ')
const goods = snap.goods ?? []
if (PERSONAS[persona].mature) {
@@ -173,7 +175,7 @@ async function download(url, path) {
}
/** 사람별로 스냅 하나씩: { f20: {...snap, files: { image, thumbs[] }}, ... }. style 을 주면 네 사람 모두 그 스타일 태그가 붙은 스냅에서 고른다 */
export async function pickSnaps({ band, style, outDir, pages = 2, log = console.log }) {
export async function pickSnaps({ band, style, prefer, outDir, pages = 2, log = console.log }) {
mkdirSync(outDir, { recursive: true })
const rule = BAND[band] ?? BAND.mild
const styleTags = STYLE_TAGS[style] ?? []
@@ -182,6 +184,7 @@ export async function pickSnaps({ band, style, outDir, pages = 2, log = console.
for (const tag of styleTags) add(await listSnaps({ tags: tag }, pages * 3))
for (const tag of rule.tags) add(await listSnaps({ tags: tag }, pages))
for (const gender of ['WOMEN', 'MEN']) for (const kw of MATURE_KEYWORDS[gender]) add(await listSnaps({ keyword: kw }, 1))
for (const kw of prefer ? prefer.source.split('|') : []) add(await listSnaps({ keyword: kw }, 1))
const hasStyle = (s) => styleTags.length === 0 || s.tags.some((t) => styleTags.some((st) => t.includes(st)))
log(`무신사 스냅 후보 ${pool.size}개 (구간 ${band}${styleTags.length ? ` · 스타일 #${styleTags.join(' #')} ${[...pool.values()].filter(hasStyle).length}개` : ''}). 상품 정보를 받아 거르는 중…`)
@@ -194,7 +197,7 @@ export async function pickSnaps({ band, style, outDir, pages = 2, log = console.
// 스타일 태그가 붙은 스냅을 먼저, 모자라면 나머지 (스타일 태그 없는 스냅은 뒤로)
const candidates = [...pool.values()]
.filter((s) => s.gender === gender && !used.has(s.id))
.sort((a, b) => Number(hasStyle(b)) - Number(hasStyle(a)) || score(b, persona) - score(a, persona))
.sort((a, b) => Number(hasStyle(b)) - Number(hasStyle(a)) || score(b, persona, prefer) - score(a, persona, prefer))
.slice(0, 60)
let best = null
for (const c of candidates) {
@@ -238,5 +241,6 @@ if (process.argv[1]?.endsWith('snap.mjs')) {
const flag = (n) => (args.includes(n) ? args[args.indexOf(n) + 1] : null)
const band = flag('--band') ?? 'mild'
const outDir = flag('--out') ?? `out/${new Date(Date.now() + 9 * 3600_000).toISOString().slice(0, 10)}/snaps`
await pickSnaps({ band, style: flag('--style') ?? undefined, outDir, pages: Number(flag('--pages') ?? 2) })
const prefer = flag('--prefer') ? new RegExp(flag('--prefer'), 'i') : undefined
await pickSnaps({ band, style: flag('--style') ?? undefined, prefer, outDir, pages: Number(flag('--pages') ?? 2) })
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

+4 -2
View File
@@ -95,7 +95,8 @@ const ootd: Template = {
post: (d, c) => ({
title: `오늘의 코디 · ${styleLabel(c.style)}`,
caption: `낮 최고 ${d.maxC}도, 20대부터 40대~까지 오늘 입을 옷을 넘겨 보세요`,
hashtags: tags(STYLE_TAGS[c.style ?? DEFAULT_STYLE] ?? [], [seasonTag(), '#여자코디', '#남자코디', '#20대코디', '#40대코디'], ['#날씨각', '#오늘의코디', '#OOTD', '#데일리룩', '#코디추천', '#오늘날씨']),
// 그날 분위기(할로윈 등) 태그는 copy.tags(띄어쓰기로 구분)로 맨 앞에 붙인다
hashtags: tags(c.tags ? c.tags.split(' ') : [], STYLE_TAGS[c.style ?? DEFAULT_STYLE] ?? [], [seasonTag(), '#여자코디', '#남자코디', '#20대코디', '#40대코디'], ['#날씨각', '#오늘의코디', '#OOTD', '#데일리룩', '#코디추천', '#오늘날씨']),
}),
warnings: (d, c) => {
if (dailyOutfits(c)) return []
@@ -146,7 +147,8 @@ const tarot: Template = {
post: (_d, c) => ({
title: `오늘의 ${c.title.replaceAll('\n', ' ').replaceAll('*', '')}`,
caption: `Q. ${c.question} 1·2·3 중 한 장을 골라 보세요`,
hashtags: tags(SKIN_TAGS[c.skin ?? ''] ?? [], [c.n1, c.n2, c.n3].map((n) => (n ? `#${n.replace(/각$/, '').replace(/\s/g, '')}` : undefined)), ['#날씨각', '#날씨타로', '#타로', '#오늘의타로', '#오늘의운세', '#오늘날씨']),
// 대주제 배경(skin)과 태그가 안 맞는 주제(나들이 등)는 copy.tags(띄어쓰기로 구분)로 주제 태그를 바꾼다
hashtags: tags(c.tags ? c.tags.split(' ') : (SKIN_TAGS[c.skin ?? ''] ?? []), [c.n1, c.n2, c.n3].map((n) => (n ? `#${n.replace(/각$/, '').replace(/\s/g, '')}` : undefined)), ['#날씨각', '#날씨타로', '#타로', '#오늘의타로', '#오늘의운세', '#오늘날씨']),
}),
name: '날씨 타로',
autoPlan: true,
+4 -1
View File
@@ -401,7 +401,9 @@ class Comment(Base):
__tablename__ = "comment"
comment_id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
post_id: Mapped[int] = mapped_column(BigInteger)
# 포스트 댓글은 post_id, 사람 글 댓글은 talk_id 하나만 채운다
post_id: Mapped[Optional[int]] = mapped_column(BigInteger, nullable=True)
talk_id: Mapped[Optional[int]] = mapped_column(BigInteger, nullable=True)
user_id: Mapped[Optional[uuid.UUID]] = mapped_column(UUID(as_uuid=True), nullable=True)
ip_hash: Mapped[Optional[str]] = mapped_column(String(64), nullable=True)
region_name: Mapped[Optional[str]] = mapped_column(String(20), nullable=True)
@@ -504,6 +506,7 @@ class Talk(Base):
image: Mapped[Optional[str]] = mapped_column(String(200), nullable=True)
topic: Mapped[int] = mapped_column(SmallInteger, default=1)
like_count: Mapped[int] = mapped_column(Integer, default=0)
comment_count: Mapped[int] = mapped_column(Integer, default=0)
report_count: Mapped[int] = mapped_column(Integer, default=0)
hidden: Mapped[bool] = mapped_column(Boolean, default=False)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
+6
View File
@@ -125,6 +125,12 @@ class TalkTopic(CodeEnum):
RAIN = 3 # 비·눈
FOLIAGE = 4 # 단풍·꽃
OUTFIT = 5 # 오늘 옷차림
HALLOWEEN = 6 # 기념일 주제: 그 기간에만 고를 수 있다 (frontend holiday.ts)
PEPERO = 7
CHRISTMAS = 8
CHUSEOK = 9
SUNEUNG = 10
NEWYEAR = 11
class TalkReport(CodeEnum):
+8
View File
@@ -5,6 +5,7 @@ KST = timezone(timedelta(hours=9))
VILAGE_BASE_HOURS = (2, 5, 8, 11, 14, 17, 20, 23)
VILAGE_DELAY = timedelta(minutes=10)
ULTRA_DELAY = timedelta(minutes=15)
NCST_DELAY = timedelta(minutes=10)
def now_kst() -> datetime:
@@ -32,6 +33,13 @@ def next_vilage_available(now: datetime) -> datetime:
return latest_vilage_base(now) + timedelta(hours=3) + VILAGE_DELAY
def latest_ncst_base(now: datetime) -> datetime:
"""지금 받을 수 있는 가장 최근 초단기실황 발표 시각 (정시 발표, 10분 뒤부터 제공)."""
now = now.astimezone(KST)
base = now.replace(minute=0, second=0, microsecond=0)
return base if base + NCST_DELAY <= now else base - timedelta(hours=1)
def latest_ultra_base(now: datetime) -> datetime:
"""지금 받을 수 있는 가장 최근 초단기예보 발표 시각 (매시 30분 발표, 45분부터 제공)."""
now = now.astimezone(KST)
+29 -17
View File
@@ -6,12 +6,20 @@ from sqlalchemy import delete, func, or_, select, update
from sqlalchemy.dialects.postgresql import insert
from sqlalchemy.ext.asyncio import AsyncSession
from common.database.model.models import Comment, CommentLike, CommentLikeAnon, CommentReport, Post, PostLike, PostLikeAnon, PostSave, User, UserBlock
from common.database.model.models import Comment, CommentLike, CommentLikeAnon, CommentReport, Post, PostLike, PostLikeAnon, PostSave, Talk, User, UserBlock
from common.liker import Liker
HIDE_AT = 3 # 신고가 이만큼 쌓이면 모두에게서 숨긴다
async def _count(s: AsyncSession, post_id: Optional[int], talk_id: Optional[int], delta: int) -> None:
"""댓글이 달린 곳(사람 글 또는 포스트)의 댓글 수를 고친다."""
if talk_id is not None:
await s.execute(update(Talk).where(Talk.talk_id == talk_id).values(comment_count=Talk.comment_count + delta))
elif post_id is not None:
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count + delta))
async def toggle_like_row(s: AsyncSession, who: Liker, member: type, anon: type, id_name: str, id_value: int, on: bool) -> bool:
"""로그인했으면 member 표에 user_id 로, 아니면 anon 표에 ip_hash 로 넣거나 지운다. 실제로 바뀌었으면 True."""
model, keys = (member, {id_name: id_value, "user_id": who.user_id}) if who.user_id is not None else (anon, {id_name: id_value, "ip_hash": who.ip_hash})
@@ -54,10 +62,13 @@ class ReactionCRUD:
stmt = stmt.where(Post.post_id < cursor)
return list((await s.execute(stmt.order_by(Post.post_id.desc()).limit(limit))).all())
async def comments(self, s: AsyncSession, post_id: int, viewer: Optional[uuid.UUID], cursor: Optional[int], limit: int) -> list[tuple[Comment, Optional[str], Optional[str], Optional[str], Optional[str]]]:
"""로그인 없이 쓴 댓글은 User 칸이 모두 None 이다. 숨긴 댓글은 빼고, 보는 사람이 신고한 댓글·차단한 사람의 댓글도 뺀다."""
async def comments(
self, s: AsyncSession, post_id: Optional[int], viewer: Optional[uuid.UUID], cursor: Optional[int], limit: int, talk_id: Optional[int] = None,
) -> list[tuple[Comment, Optional[str], Optional[str], Optional[str], Optional[str]]]:
"""포스트(post_id) 또는 사람 글(talk_id)의 댓글. 로그인 없이 쓴 댓글은 User 칸이 모두 None 이다. 숨긴 댓글은 빼고, 보는 사람이 신고한 댓글·차단한 사람의 댓글도 뺀다."""
target = Comment.talk_id == talk_id if talk_id is not None else Comment.post_id == post_id
stmt = select(Comment, User.nickname, User.character, User.color, User.mood).outerjoin(User, User.user_id == Comment.user_id).where(
Comment.post_id == post_id, Comment.deleted.is_(False), Comment.is_hidden.is_(False)
target, Comment.deleted.is_(False), Comment.is_hidden.is_(False)
)
if viewer is not None:
stmt = stmt.where(
@@ -76,10 +87,11 @@ class ReactionCRUD:
stmt = select(CommentLikeAnon.comment_id).where(CommentLikeAnon.ip_hash == ip_hash, CommentLikeAnon.comment_id.in_(comment_ids))
return set((await s.scalars(stmt)).all())
async def add_comment(self, s: AsyncSession, post_id: int, who: Liker, body: str, region_name: Optional[str]) -> Comment:
c = Comment(post_id=post_id, user_id=who.user_id, body=body) if who.user_id is not None else Comment(post_id=post_id, ip_hash=who.ip_hash, region_name=region_name, body=body)
async def add_comment(self, s: AsyncSession, post_id: Optional[int], who: Liker, body: str, region_name: Optional[str], talk_id: Optional[int] = None) -> Comment:
c = (Comment(post_id=post_id, talk_id=talk_id, user_id=who.user_id, body=body) if who.user_id is not None
else Comment(post_id=post_id, talk_id=talk_id, ip_hash=who.ip_hash, region_name=region_name, body=body))
s.add(c)
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count + 1))
await _count(s, post_id, talk_id, 1)
await s.flush()
return c
@@ -90,14 +102,14 @@ class ReactionCRUD:
owner = Comment.user_id == who.user_id if who.user_id is not None else (Comment.user_id.is_(None) & (Comment.ip_hash == who.ip_hash))
res = await s.execute(
update(Comment).where(Comment.comment_id == comment_id, owner, Comment.deleted.is_(False))
.values(deleted=True).returning(Comment.post_id, Comment.is_hidden)
.values(deleted=True).returning(Comment.post_id, Comment.talk_id, Comment.is_hidden)
)
row = res.first()
if row is None:
return False
# 숨긴 댓글은 이미 댓글 수에서 빠져 있다
if not row.is_hidden:
await s.execute(update(Post).where(Post.post_id == row.post_id).values(comment_count=Post.comment_count - 1))
await _count(s, row.post_id, row.talk_id, -1)
return True
async def toggle_comment_like(self, s: AsyncSession, comment_id: int, who: Liker, on: bool) -> Optional[int]:
@@ -120,22 +132,22 @@ class ReactionCRUD:
await s.execute(update(Comment).where(Comment.comment_id == comment_id).values(report_count=Comment.report_count + 1))
res = await s.execute(
update(Comment).where(Comment.comment_id == comment_id, Comment.report_count >= HIDE_AT, Comment.is_hidden.is_(False), Comment.deleted.is_(False))
.values(is_hidden=True).returning(Comment.post_id)
.values(is_hidden=True).returning(Comment.post_id, Comment.talk_id)
)
post_id = res.scalar()
if post_id is not None:
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count - 1))
row = res.first()
if row is not None:
await _count(s, row.post_id, row.talk_id, -1)
async def set_hidden(self, s: AsyncSession, comment_id: int, hidden: bool) -> bool:
"""운영자가 댓글을 숨기거나 되살린다. 실제로 바뀌었을 때만 댓글 수를 고친다."""
res = await s.execute(
update(Comment).where(Comment.comment_id == comment_id, Comment.is_hidden.is_(not hidden), Comment.deleted.is_(False))
.values(is_hidden=hidden).returning(Comment.post_id)
.values(is_hidden=hidden).returning(Comment.post_id, Comment.talk_id)
)
post_id = res.scalar()
if post_id is None:
row = res.first()
if row is None:
return False
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count + (-1 if hidden else 1)))
await _count(s, row.post_id, row.talk_id, -1 if hidden else 1)
return True
async def block(self, s: AsyncSession, user_id: uuid.UUID, blocked_id: uuid.UUID) -> None:
+9 -4
View File
@@ -6,7 +6,7 @@ from typing import Optional
from sqlalchemy import delete, func, select, update
from sqlalchemy.ext.asyncio import AsyncSession
from common.database.model.models import Comment, CommentLike, CommentReport, PointLog, Post, PostLike, PostSave, User, UserBlock
from common.database.model.models import Comment, CommentLike, CommentReport, PointLog, Post, PostLike, PostSave, Talk, User, UserBlock
class UserCRUD:
@@ -74,12 +74,17 @@ class UserCRUD:
if reported:
await s.execute(update(Comment).where(Comment.comment_id.in_(reported)).values(report_count=Comment.report_count - 1))
await s.execute(delete(UserBlock).where((UserBlock.user_id == user_id) | (UserBlock.blocked_id == user_id)))
mine = (await s.execute(delete(Comment).where(Comment.user_id == user_id).returning(Comment.comment_id, Comment.post_id, Comment.deleted, Comment.is_hidden))).all()
mine = (await s.execute(
delete(Comment).where(Comment.user_id == user_id).returning(Comment.comment_id, Comment.post_id, Comment.talk_id, Comment.deleted, Comment.is_hidden)
)).all()
if mine:
ids = [c for c, _, _, _ in mine]
ids = [c for c, *_ in mine]
await s.execute(delete(CommentLike).where(CommentLike.comment_id.in_(ids)))
await s.execute(delete(CommentReport).where(CommentReport.comment_id.in_(ids)))
# 이미 지웠거나 숨긴 댓글은 댓글 수에서 빠져 있다
for post_id, n in Counter(p for _, p, deleted, hidden in mine if not deleted and not hidden).items():
shown = [(p, t) for _, p, t, deleted, hidden in mine if not deleted and not hidden]
for post_id, n in Counter(p for p, t in shown if t is None).items():
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count - n))
for talk_id, n in Counter(t for _, t in shown if t is not None).items():
await s.execute(update(Talk).where(Talk.talk_id == talk_id).values(comment_count=Talk.comment_count - n))
await s.execute(delete(User).where(User.user_id == user_id))
+1 -1
View File
@@ -70,7 +70,7 @@ td.n{white-space:nowrap;font-weight:600}
<tr><td class="n">등산 <span class="core">가을</span></td><td class="w">7~12시</td><td class="w">30·25·20·10·10·5</td><td>범위 10~20° (정상 기준 −6°)</td><td>마를수록</td><td>잔잔 ≤4, 한계 12</td><td>범위</td><td>주말 100, 평일 50</td><td>비 확률 70% 이상, 강풍주의보</td><td>등산로 통제, 낙석</td></tr>
<tr><td class="n">세차</td><td class="w">오늘 + 앞으로 이틀</td><td class="w">5·60·10·10·10·5</td><td>범위 5~28°</td><td>마를수록 (이틀 최대)</td><td>잔잔 ≤4, 한계 10</td><td>낮을수록</td><td>낮 100, 밤 40</td><td>이틀 안 비 70% 이상 → 20점 아래</td><td>황사·꽃가루</td></tr>
<tr><td class="n">캠핑 <span class="core">가을</span></td><td class="w">18~다음날 8시</td><td class="w">30·25·15·15·10·5</td><td>범위 12~22°</td><td>마를수록</td><td>잔잔 ≤3, 한계 9</td><td>낮을수록 (이슬)</td><td>금·토 100, 평일 60</td><td>비 확률 60% 이상, 강풍</td><td>캠핑장 예약</td></tr>
<tr><td class="n">러닝</td><td class="w">6~8시, 19~22시 중 좋은 쪽</td><td class="w">35·20·10·20·10·5</td><td>범위 8~18°</td><td>마를수록</td><td>잔잔 ≤4, 한계 10</td><td>낮을수록</td><td>아침·저녁 100, 늦은 밤 40</td><td>체감 35° 이상, 비 확률 90% 이상</td><td>노면 상태</td></tr>
<tr><td class="n">러닝</td><td class="w">6~8시, 19~22시 (지금 순위는 구간별, 하루 점수는 좋은 쪽)</td><td class="w">35·20·10·15·15·5</td><td>범위 5~18°, 최적 12° (5~8°도 좋음)</td><td>마를수록</td><td>잔잔 ≤3, 한계 8</td><td>낮을수록</td><td>활동 시간대와 겹치면 100, 아니면 0 (시간 비중 5%). 현재 구간은 남은 시간만 평가</td><td>0점: 비 소식, 비 확률 70% 이상, 체감 0° 미만·35° 이상, 바람 8m/s 이상, 돌풍 15m/s 이상, 강풍 특보, 초미세먼지 75㎍/㎥ 이상<br>최대 30점: 비 확률 60% 이상, 바람 6m/s 이상, 초미세먼지 36㎍/㎥ 이상, 체감 28° 이상<br>최대 40점: 체감 5° 미만<br>최대 50점: 활동 시간대와 겹치지 않는 구간 (더 낮은 상한 우선)</td><td>노면 상태</td></tr>
<tr><td class="n">별보기 <span class="core">가을</span></td><td class="w">21~02시</td><td class="w">5·15·5·10·20·45</td><td>범위 5~25°</td><td>마를수록</td><td>잔잔 ≤5, 한계 12</td><td>낮을수록</td><td>달이 어두울수록 100 (보름 20)</td><td>하늘 흐림(전체 구름) 80% 이상</td><td>도시 불빛 (지역 평균만)</td></tr>
<tr><td class="n">짬뽕각 <span class="fun">재미</span></td><td class="w">11~14시, 17~20시</td><td class="w">40·25·15·10·5·5</td><td>낮을수록 (25° 0점 → 5° 100점)</td><td>올수록</td><td>셀수록</td><td>높을수록</td><td>식사 시간 100</td><td>없음</td><td>실제 주문량 검증 전</td></tr>
<tr><td class="n">막걸리각 <span class="fun">재미</span></td><td class="w">17~22시</td><td class="w">15·50·10·15·5·5</td><td>낮을수록 (28° 0점 → 10° 100점)</td><td>올수록</td><td>셀수록</td><td>높을수록</td><td>금·토 100, 평일 50</td><td>없음</td><td>실제 판매량 검증 전</td></tr>
+88 -118
View File
@@ -7,7 +7,8 @@
- 각마다 6가지 요소(기온·비·바람·습도·미세먼지·시간)를 0~100점으로 매기고, 아래 비중(%)으로 섞습니다.
- 최종 점수 = 비중대로 섞은 점수 × (0.75 + 0.25 × 가장 낮은 요소 점수 ÷ 100). 비중 0%인 요소는 '가장 낮은 요소'에서 뺍니다. 가장 낮은 요소가 0점이면 25%가 깎입니다.
- '0점 조건'에 걸리면 0점, '최대 N점' 조건에 걸리면 N점을 넘지 못합니다.
- 시간대가 여러 개면 그중 가장 좋은 시간대 점수를 씁니다.
- 요소가 하나뿐인 각(우산각·우산분실각)은 '가장 낮은 요소'로 깎지 않습니다. 그 요소가 곧 점수입니다.
- 시간대가 여러 개면 그중 가장 좋은 시간대 점수를 씁니다. 시간대는 내일·토·일 점수에 볼 시각을 정할 뿐, 오늘 점수는 지금 구간의 날씨로 내며 시간대에 해당하는지는 점수에 반영하지 않습니다.
- 미세먼지는 초미세먼지 15㎍/㎥ 이하 100점 → 75㎍/㎥ 이상 0점입니다. 집콕각처럼 규칙을 따로 적은 각만 거꾸로(탁할수록 좋음) 셉니다.
- 바람·미세먼지·노을 정보가 없으면 70점으로 둡니다.
- 최종 점수는 원점수 × 중요도 배율(상 1.0 · 중 0.85 · 하 0.7)을 정수로 반올림한 값입니다. 순위와 화면 표시 모두 이 최종 점수를 사용합니다.
@@ -19,30 +20,30 @@
| 1 | 야장각 | `yajang` | 먹고 마시기 | 중 | 18~24시 | 30% | 25% | 15% | 10% | 10% | 10% | ○ | |
| 2 | 피크닉각 | `picnic` | 밖에서 놀기 | 상 | 11~16시 | 20% | 20% | 15% | 5% | 10% | 10% | | ○ |
| 3 | 치맥각 | `chimaek` | 먹고 마시기 | 중 | 18~23시 | 30% | 20% | 15% | 15% | 10% | 10% | ○ | |
| 4 | 산책각 | `walk` | 밖에서 놀기 | 상 | 18~22시 | 30% | 25% | 15% | 10% | 15% | 5% | | |
| 5 | 환기각 | `vent` | 집안일 | 하 | 10~12시 / 12~14시 / 14~16시 / 16~18시 | 10% | 15% | 15% | 20% | 35% | 5% | | |
| 4 | 산책각 | `walk` | 밖에서 놀기 | 상 | 18~22시 | 35% | 25% | 15% | 10% | 15% | 0% | | |
| 5 | 환기각 | `vent` | 집안일 | 하 | 10~12시 / 12~14시 / 14~16시 / 16~18시 | 10% | 15% | 15% | 20% | 40% | 0% | | |
| 6 | 등산각 | `hiking` | 밖에서 놀기 | 상 | 7~12시 | 20% | 20% | 15% | 5% | 10% | 5% | | ○ |
| 7 | 세차각 | `carwash` | 집안일 | 하 | 9~18시 (비는 2일 뒤까지 봄) | 5% | 40% | 10% | 10% | 10% | 5% | | |
| 7 | 세차각 | `carwash` | 집안일 | 하 | 9~18시 (비는 2일 뒤까지 봄) | 5% | 45% | 10% | 10% | 10% | 0% | | |
| 8 | 캠핑각 | `camping` | 밖에서 놀기 | 상 | 18~다음 날 8시 | 40% | 25% | 15% | 5% | 10% | 5% | | ○ |
| 9 | 러닝각 | `running` | 밖에서 놀기 | 상 | 6~8시 / 19~22시 | 35% | 20% | 10% | 15% | 15% | 5% | | |
| 9 | 러닝각 | `running` | 밖에서 놀기 | 상 | 6~8시 / 19~22시 | 40% | 20% | 10% | 15% | 15% | 0% | | |
| 10 | 별보기각 | `stars` | 밖에서 놀기 | 중 | 21~다음 날 2시 | 5% | 10% | 5% | 5% | 15% | 45% | | ○ |
| 11 | 짬뽕각 | `jjamppong` | 먹고 마시기 | 하 | 9~24시 | 50% | 25% | 5% | 10% | 5% | 5% | ○ | |
| 11 | 짬뽕각 | `jjamppong` | 먹고 마시기 | 하 | 9~24시 | 55% | 25% | 5% | 10% | 5% | 0% | ○ | |
| 12 | 막걸리각 | `makgeolli` | 먹고 마시기 | 하 | 9~24시 | 15% | 55% | 5% | 15% | 5% | 5% | ○ | |
| 13 | 뜨아각 | `iced_hot` | 먹고 마시기 | 하 | 7~10시 | 90% | 0% | 0% | 0% | 0% | 10% | ○ | |
| 14 | 빨래각 | `laundry` | 집안일 | 상 | 9~16시 | 15% | 30% | 15% | 10% | 0% | 5% | | |
| 13 | 뜨아각 | `iced_hot` | 먹고 마시기 | 하 | 7~10시 | 80% | 10% | 10% | 0% | 0% | 0% | ○ | |
| 14 | 빨래각 | `laundry` | 집안일 | 상 | 9~16시 | 15% | 35% | 15% | 10% | 0% | 0% | | |
| 15 | 자전거각 | `bike` | 밖에서 놀기 | 상 | 9~19시 | 20% | 20% | 20% | 5% | 10% | 5% | | |
| 16 | 멍뭉산책각 | `dog` | 밖에서 놀기 | 중 | 7~9시 / 17~20시 | 40% | 25% | 10% | 5% | 15% | 5% | | |
| 17 | 김서림각 | `glasses` | 생활 고민 | 중 | 7~9시 | 70% | 10% | 0% | 15% | 0% | 5% | | |
| 18 | 화장붕괴각 | `makeup` | 생활 고민 | 중 | 10~18시 | 55% | 5% | 0% | 35% | 0% | 5% | | |
| 19 | 냉면각 | `naengmyeon` | 먹고 마시기 | 하 | 11~14시 | 65% | 15% | 5% | 5% | 5% | 5% | ○ | |
| 16 | 멍뭉산책각 | `dog` | 밖에서 놀기 | 중 | 7~9시 / 17~20시 | 45% | 25% | 10% | 5% | 15% | 0% | | |
| 17 | 김서림각 | `glasses` | 생활 고민 | 중 | 7~9시 | 75% | 10% | 0% | 15% | 0% | 0% | | |
| 18 | 화장붕괴각 | `makeup` | 생활 고민 | 중 | 10~18시 | 60% | 5% | 0% | 35% | 0% | 0% | | |
| 19 | 냉면각 | `naengmyeon` | 먹고 마시기 | 하 | 11~14시 | 70% | 15% | 5% | 5% | 5% | 0% | ○ | |
| 20 | 택시대란각 | `taxi` | 생활 고민 | 중 | 22~다음 날 2시 | 20% | 65% | 0% | 0% | 0% | 15% | | |
| 21 | 배달폭주각 | `delivery` | 생활 고민 | 중 | 17~21시 | 20% | 65% | 5% | 0% | 0% | 10% | | |
| 22 | 가드닝각 | `garden` | 집안일 | 하 | 7~10시 | 20% | 25% | 10% | 10% | 10% | 5% | | |
| 22 | 가드닝각 | `garden` | 집안일 | 하 | 7~10시 | 20% | 30% | 10% | 10% | 10% | 0% | | |
| 23 | 사진산책각 | `photo` | 밖에서 놀기 | 중 | 일몰 앞뒤 1시간 | 10% | 25% | 10% | 5% | 10% | 30% | | |
| 24 | 야구각 | `baseball` | 밖에서 놀기 | 하 | 18~22시 | 35% | 35% | 10% | 0% | 10% | 10% | ○ | |
| 25 | 공부각 | `study` | 집안일 | 하 | 9~24시 | 40% | 35% | 5% | 5% | 5% | 10% | ○ | |
| 26 | 넷플릭스각 | `netflix` | 집안일 | 하 | 9~24시 | 30% | 50% | 5% | 0% | 0% | 15% | ○ | |
| 27 | 군밤각 | `chestnut` | 먹고 마시기 | 하 | 17~21시 | 60% | 25% | 5% | 0% | 5% | 5% | ○ | |
| 27 | 군밤각 | `chestnut` | 먹고 마시기 | 하 | 17~21시 | 65% | 25% | 5% | 0% | 5% | 0% | ○ | |
| 28 | 골프각 | `golf` | 밖에서 놀기 | 중 | 7~12시 / 12~17시 | 30% | 30% | 25% | 5% | 5% | 5% | | |
| 29 | 집콕각 | `jipkok` | 집안일 | 하 | 9~24시 | 35% | 30% | 5% | 5% | 20% | 5% | ○ | |
| 30 | 낚시각 | `fishing` | 밖에서 놀기 | 중 | 5~9시 / 16~19시 | 25% | 25% | 35% | 0% | 5% | 10% | | |
@@ -52,38 +53,38 @@
| 34 | 김장각 | `kimjang` | 집안일 | 하 | 9~16시 | 50% | 25% | 10% | 0% | 5% | 10% | | |
| 35 | 꽃구경각 | `flower` | 밖에서 놀기 | 중 | 10~17시 | 20% | 25% | 10% | 0% | 15% | 5% | | |
| 36 | 이불빨래각 | `blanket` | 집안일 | 중 | 9~16시 | 10% | 30% | 15% | 15% | 10% | 0% | | |
| 37 | 빙수각 | `bingsu` | 먹고 마시기 | 하 | 13~18시 | 70% | 10% | 5% | 10% | 0% | 5% | ○ | |
| 38 | 실내건조각 | `indoordry` | 집안일 | 하 | 9~21시 | 15% | 60% | 0% | 20% | 0% | 5% | | |
| 37 | 빙수각 | `bingsu` | 먹고 마시기 | 하 | 13~18시 | 75% | 10% | 5% | 10% | 0% | 0% | ○ | |
| 38 | 실내건조각 | `indoordry` | 집안일 | 하 | 9~21시 | 15% | 65% | 0% | 20% | 0% | 0% | | |
| 39 | 한강밤바람각 | `riverwind` | 밖에서 놀기 | 중 | 19~23시 | 30% | 30% | 20% | 10% | 5% | 5% | | |
| 40 | 단풍각 | `foliage` | 밖에서 놀기 | 중 | 9~16시 | 15% | 25% | 10% | 0% | 10% | 5% | | |
| 41 | 억새각 | `silvergrass` | 밖에서 놀기 | 하 | 일몰 앞뒤 2시간 | 10% | 25% | 15% | 0% | 10% | 30% | | |
| 42 | 군고구마각 | `sweetpotato` | 먹고 마시기 | 하 | 16~21시 | 65% | 20% | 5% | 0% | 5% | 5% | ○ | |
| 42 | 군고구마각 | `sweetpotato` | 먹고 마시기 | 하 | 16~21시 | 70% | 20% | 5% | 0% | 5% | 0% | ○ | |
| 43 | 해돋이각 | `sunrise` | 밖에서 놀기 | 중 | 일몰 앞뒤 1시간 | 10% | 20% | 10% | 0% | 5% | 40% | | |
| 44 | 눈사람각 | `snowman` | 밖에서 놀기 | 하 | 9~16시 | 50% | 10% | 20% | 0% | 0% | 20% | ○ | |
| 45 | 붕어빵각 | `bungeoppang` | 먹고 마시기 | 하 | 15~21시 | 70% | 15% | 5% | 0% | 5% | 5% | ○ | |
| 46 | 귤까먹기각 | `tangerine` | 집안일 | 하 | 19~24시 | 75% | 5% | 10% | 0% | 5% | 5% | ○ | |
| 47 | 우산각 | `umbrella` | 생활 고민 | 중 | 6~24시 | 0% | 90% | 0% | 0% | 0% | 10% | | |
| 48 | 파전각 | `pajeon` | 먹고 마시기 | 하 | 9~24시 | 20% | 70% | 0% | 0% | 0% | 10% | ○ | |
| 49 | 감성노래각 | `mood_song` | 집안일 | 하 | 9~24시 | 25% | 60% | 0% | 0% | 0% | 15% | ○ | |
| 45 | 붕어빵각 | `bungeoppang` | 먹고 마시기 | 하 | 15~21시 | 75% | 15% | 5% | 0% | 5% | 0% | ○ | |
| 46 | 귤까먹기각 | `tangerine` | 집안일 | 하 | 19~24시 | 80% | 5% | 10% | 0% | 5% | 0% | ○ | |
| 47 | 우산각 | `umbrella` | 생활 고민 | 중 | 6~24시 | 0% | 100% | 0% | 0% | 0% | 0% | | |
| 48 | 파전각 | `pajeon` | 먹고 마시기 | 하 | 9~24시 | 20% | 65% | 0% | 15% | 0% | 0% | ○ | |
| 49 | 감성노래각 | `mood_song` | 집안일 | 하 | 9~24시 | 30% | 55% | 0% | 15% | 0% | 0% | ○ | |
| 50 | 트로트각 | `trot` | 밖에서 놀기 | 하 | 10~17시 | 30% | 25% | 0% | 0% | 0% | 30% | ○ | |
| 51 | 싱잉인더레인각 | `singing_rain` | 밖에서 놀기 | 하 | 6~24시 | 30% | 50% | 15% | 0% | 0% | 5% | ○ | |
| 52 | 우산분실각 | `umbrella_lost` | 생활 고민 | 중 | 9~11시 / 11~13시 / 13~15시 / 15~17시 / 17~19시 / 19~22시 | 0% | 80% | 0% | 0% | 0% | 20% | | |
| 51 | 싱잉인더레인각 | `singing_rain` | 밖에서 놀기 | 하 | 6~24시 | 30% | 55% | 15% | 0% | 0% | 0% | ○ | |
| 52 | 우산분실각 | `umbrella_lost` | 생활 고민 | 중 | 9~22시 | 0% | 100% | 0% | 0% | 0% | 0% | | |
| 53 | 교통체증각 | `traffic` | 생활 고민 | 중 | 7~10시 / 17~20시 | 10% | 70% | 0% | 0% | 0% | 20% | | |
| 54 | 한강각 | `hangang` | 밖에서 놀기 | 상 | 14~22시 | 30% | 25% | 15% | 5% | 10% | 15% | | |
| 55 | 놀이공원각 | `themepark` | 밖에서 놀기 | 중 | 10~20시 | 30% | 35% | 15% | 0% | 5% | 15% | | |
| 56 | 데이트각 | `date` | 밖에서 놀기 | 중 | 14~22시 | 30% | 30% | 10% | 0% | 15% | 15% | ○ | |
| 57 | 곱슬머리각 | `frizz` | 생활 고민 | 중 | 8~20시 | 10% | 25% | 0% | 60% | 0% | 5% | | |
| 58 | 보일러각 | `boiler` | 집안일 | 중 | 21~다음 날 7시 | 70% | 10% | 0% | 15% | 0% | 5% | | |
| 59 | 선크림각 | `sunscreen` | 생활 고민 | 중 | 10~16시 | 15% | 0% | 0% | 0% | 0% | 5% | | |
| 60 | 모기각 | `mosquito` | 생활 고민 | 중 | 19~24시 | 50% | 0% | 20% | 25% | 0% | 5% | | |
| 61 | 테니스각 | `tennis` | 밖에서 놀기 | 중 | 7~11시 / 17~21시 | 30% | 25% | 25% | 5% | 10% | 5% | | |
| 57 | 곱슬머리각 | `frizz` | 생활 고민 | 중 | 8~20시 | 10% | 25% | 0% | 65% | 0% | 0% | | |
| 58 | 보일러각 | `boiler` | 집안일 | 중 | 21~다음 날 7시 | 75% | 10% | 0% | 15% | 0% | 0% | | |
| 59 | 선크림각 | `sunscreen` | 생활 고민 | 중 | 10~16시 | 15% | 0% | 0% | 0% | 0% | 0% | | |
| 60 | 모기각 | `mosquito` | 생활 고민 | 중 | 19~24시 | 55% | 0% | 20% | 25% | 0% | 0% | | |
| 61 | 테니스각 | `tennis` | 밖에서 놀기 | 중 | 7~11시 / 17~21시 | 35% | 25% | 25% | 5% | 10% | 0% | | |
| 62 | 효도각 | `hyodo` | 밖에서 놀기 | 중 | 10~16시 | 30% | 25% | 10% | 0% | 15% | 20% | ○ | |
| 63 | 감사각 | `thanks` | 생활 고민 | 하 | 18~22시 | 50% | 30% | 0% | 0% | 0% | 20% | ○ | |
| 63 | 감사각 | `thanks` | 생활 고민 | 하 | 18~22시 | 50% | 30% | 20% | 0% | 0% | 0% | ○ | |
| 64 | 선물각 | `gift` | 생활 고민 | 하 | 11~19시 | 40% | 35% | 15% | 0% | 0% | 10% | ○ | |
| 65 | 파티각 | `party` | 집안일 | 하 | 18~24시 | 25% | 25% | 0% | 0% | 0% | 50% | ○ | |
| 66 | 게임각 | `game` | 집안일 | 하 | 20~다음 날 2시 | 30% | 40% | 0% | 0% | 15% | 15% | ○ | |
| 67 | 셀카각 | `selfie` | 생활 고민 | 하 | 10~17시 | 0% | 20% | 15% | 30% | 0% | 10% | ○ | |
| 68 | 센치각 | `sentimental` | 생활 고민 | 하 | 18~23시 | 35% | 30% | 10% | 10% | 0% | 15% | ○ | |
| 67 | 셀카각 | `selfie` | 생활 고민 | 하 | 10~17시 | 0% | 20% | 15% | 35% | 0% | 0% | ○ | |
| 68 | 센치각 | `sentimental` | 생활 고민 | 하 | 18~23시 | 40% | 35% | 15% | 10% | 0% | 0% | ○ | |
## 각별 자세히
@@ -155,12 +156,11 @@
- 분류: 밖에서 놀기 · 중요도 상 · 아이콘 `walk` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 18~22시
- 요소별 규칙 (비중):
- 기온 30%: 체감 15~23°가 좋음
- 기온 35%: 체감 15~23°가 좋음
- 비 25%: 비 안 올수록 좋음
- 바람 15%: 잔잔할수록 좋음 (초속 3m까지 괜찮음, 10m면 0점)
- 습도 10%: 30~60%가 좋음 (최적 35%)
- 미세먼지 15%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 55점
- 점수 깎이는 조건: 비 소식이 있으면 0점, 비 확률 70% 이상이면 0점, 초미세먼지 75㎍/㎥ 이상이면 0점
- 반영 못 하는 것: 길 공사, 조명은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -179,8 +179,7 @@
- 비 15%: 비 안 올수록 좋음
- 바람 15%: 적당한 바람(초속 2~5m)이 좋음
- 습도 20%: 30~60%가 좋음 (최적 35%)
- 미세먼지 35%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 미세먼지 40%: 초미세먼지 낮을수록 좋음
- 점수 깎이는 조건: 비 소식이 있으면 0점, 초미세먼지 75㎍/㎥ 이상이면 0점, 비 확률 70% 이상이면 최대 20점, 습도 85% 이상이면 최대 40점
- 반영 못 하는 것: 집 방향과 주변 공사 먼지는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -219,13 +218,12 @@
- 시간대: 9~18시 (비는 2일 뒤까지 봄)
- 요소별 규칙 (비중):
- 기온 5%: 체감 5~28°가 좋음
- 비 40%: 비 안 올수록 좋음
- 비 45%: 비 안 올수록 좋음
- 바람 10%: 잔잔할수록 좋음 (초속 4m까지 괜찮음, 10m면 0점)
- 습도 10%: 낮을수록 좋음 (90%=0점 → 40%=100점)
- 미세먼지 10%: 초미세먼지 낮을수록 좋음
- 자외선 10%: 자외선 2 이하면 만점, 8 이상이면 0점 (Open-Meteo)
- 햇빛 10%: 해 난 비율 80% 이상이면 만점, 20% 이하면 0점 (Open-Meteo)
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 비 소식이 있으면 0점, 비 확률 70% 이상이면 최대 20점
- 반영 못 하는 것: 황사·꽃가루 같은 하늘 먼지는 일부만 반영해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -260,19 +258,18 @@
- 분류: 밖에서 놀기 · 중요도 상 · 아이콘 `running` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 6~8시 / 19~22시
- 요소별 규칙 (비중):
- 기온 35%: 체감 8~18°가 좋음
- 기온 40%: 체감 5~18°가 좋음
- 비 20%: 비 안 올수록 좋음
- 바람 10%: 잔잔할수록 좋음 (초속 4m까지 괜찮음, 10m면 0점)
- 바람 10%: 잔잔할수록 좋음 (초속 3m까지 괜찮음, 8m면 0점)
- 습도 15%: 낮을수록 좋음 (90%=0점 → 40%=100점)
- 미세먼지 15%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 비 소식이 있으면 0점, 체감 35° 이상이면 0점, 비 확률 70% 이상이면 0점
- 점수 깎이는 조건: 비 소식이 있으면 0점, 체감 35° 이상이면 0점, 비 확률 70% 이상이면 0점, 체감 0° 미만이면 0점, wind 특보가 있으면, 바람 8m/s 이상이면 0점, 돌풍 15m/s 이상이면 0점, 초미세먼지 75㎍/㎥ 이상이면 0점, 비 확률 60% 이상이면 최대 30점, 바람 6m/s 이상이면 최대 30점, 초미세먼지 36㎍/㎥ 이상이면 최대 30점, 체감 28° 이상이면 최대 30점, 체감 5° 미만이면 최대 40점
- 반영 못 하는 것: 노면 상태는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
- 0~29점: 체감 35° 넘거나 비가 쏟아져요. 오늘은 러닝머신으로!
- 30~59점: 덥거나 눅눅해서 금방 지쳐요. 거리 줄이고 물 꼭!
- 0~29점: 밖에서 뛰기엔 날씨가 험해요. 오늘은 러닝머신으로!
- 30~59점: 지금은 뛰기 애매해요. 아침·저녁에 짧게 가볍게!
- 60~79점: 뛸 만해요! 아침·저녁 중 시원한 쪽 고르기.
- 80~100점: 8~18°에 공기 보송, 기록 갱신각 🏃
- 80~100점: 선선하고 공기 보송, 기록 갱신각 🏃
### 별보기각 (`stars`)
@@ -301,12 +298,11 @@
- 분류: 먹고 마시기 · 중요도 하 · 아이콘 `jjamppong` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 9~24시
- 요소별 규칙 (비중):
- 기온 50%: 추울수록 좋음 (25°=0점 → 5°=100점)
- 기온 55%: 추울수록 좋음 (25°=0점 → 5°=100점)
- 비 25%: 비 올수록 좋음
- 바람 5%: 셀수록 좋음 (초속 8m=100점)
- 습도 10%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 5%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 실제 주문량으로 검증하기 전이에요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -341,12 +337,11 @@
- 분류: 먹고 마시기 · 중요도 하 · 아이콘 `iced_hot` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 7~10시
- 요소별 규칙 (비중):
- 기온 90%: 추울수록 좋음 (22°=0점 → 8°=100점)
- 비 0%: 비 올수록 좋음
- 바람 0%: 셀수록 좋음 (초속 8m=100점)
- 기온 80%: 추울수록 좋음 (22°=0점 → 8°=100점)
- 비 10%: 비 올수록 좋음
- 바람 10%: 셀수록 좋음 (초속 8m=100점)
- 습도 0%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 10%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 사람마다 달라서 재미로 봐 주세요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -362,12 +357,11 @@
- 시간대: 9~16시
- 요소별 규칙 (비중):
- 기온 15%: 더울수록 좋음 (10°=0점 → 25°=100점)
- 비 30%: 비 안 올수록 좋음
- 비 35%: 비 안 올수록 좋음
- 바람 15%: 적당한 바람(초속 2~5m)이 좋음
- 습도 10%: 낮을수록 좋음 (90%=0점 → 40%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 햇빛 25%: 해 난 비율 80% 이상이면 만점, 20% 이하면 0점 (Open-Meteo)
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 비 소식이 있으면 0점, 비 확률 60% 이상이면 0점
- 반영 못 하는 것: 집 방향·그늘 일조량은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -404,12 +398,11 @@
- 분류: 밖에서 놀기 · 중요도 중 · 아이콘 `dog` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 7~9시 / 17~20시
- 요소별 규칙 (비중):
- 기온 40%: 체감 5~22°가 좋음
- 기온 45%: 체감 5~22°가 좋음
- 비 25%: 비 안 올수록 좋음
- 바람 10%: 잔잔할수록 좋음 (초속 5m까지 괜찮음, 12m면 0점)
- 습도 5%: 30~60%가 좋음 (최적 35%)
- 미세먼지 15%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 비 소식이 있으면 0점, 체감 33° 이상이면 0점, 초미세먼지 75㎍/㎥ 이상이면 0점, 지면 온도 45° 이상이면 0점, 비 확률 70% 이상이면 최대 20점
- 반영 못 하는 것: 지표면 온도는 예보 모델 값이라 실제 노면 온도와 달라요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -424,12 +417,11 @@
- 분류: 생활 고민 · 중요도 중 · 아이콘 `glasses` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 7~9시
- 요소별 규칙 (비중):
- 기온 70%: 추울수록 좋음 (15°=0점 → -5°=100점)
- 기온 75%: 추울수록 좋음 (15°=0점 → -5°=100점)
- 비 10%: 비 올수록 좋음
- 바람 0%: 상관없음 (50점 고정)
- 습도 15%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 실내 온도는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -444,12 +436,11 @@
- 분류: 생활 고민 · 중요도 중 · 아이콘 `makeup` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 10~18시
- 요소별 규칙 (비중):
- 기온 55%: 더울수록 좋음 (20°=0점 → 32°=100점)
- 기온 60%: 더울수록 좋음 (20°=0점 → 32°=100점)
- 비 5%: 비 올수록 좋음
- 바람 0%: 셀수록 좋음 (초속 8m=100점)
- 습도 35%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 피부 타입은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -464,12 +455,11 @@
- 분류: 먹고 마시기 · 중요도 하 · 아이콘 `naengmyeon` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 11~14시
- 요소별 규칙 (비중):
- 기온 65%: 더울수록 좋음 (18°=0점 → 32°=100점)
- 기온 70%: 더울수록 좋음 (18°=0점 → 32°=100점)
- 비 15%: 비 안 올수록 좋음
- 바람 5%: 잔잔할수록 좋음 (초속 4m까지 괜찮음, 12m면 0점)
- 습도 5%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 5%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 실제 주문량으로 검증하기 전이에요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -525,13 +515,12 @@
- 시간대: 7~10시
- 요소별 규칙 (비중):
- 기온 20%: 체감 12~25°가 좋음
- 비 25%: 비 안 올수록 좋음
- 비 30%: 비 안 올수록 좋음
- 바람 10%: 잔잔할수록 좋음 (초속 4m까지 괜찮음, 10m면 0점)
- 습도 10%: 30~60%가 좋음 (최적 35%)
- 미세먼지 10%: 초미세먼지 낮을수록 좋음
- 자외선 10%: 자외선 2 이하면 만점, 8 이상이면 0점 (Open-Meteo)
- 햇빛 10%: 해 난 비율 80% 이상이면 만점, 20% 이하면 0점 (Open-Meteo)
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 비 소식이 있으면 0점, 비 확률 70% 이상이면 0점
- 반영 못 하는 것: 식물 종류는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -576,10 +565,10 @@
- 점수 깎이는 조건: 비 소식이 있으면 0점, 비 확률 70% 이상이면 0점
- 반영 못 하는 것: 경기 일정과 시즌(3~10월)은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
- 0~29점: 비 70% 넘어요. 우천 취소 각!
- 30~59점: 쌀쌀하거나 비 기운이 있어요. 담요랑 우비 챙겨요.
- 60~79점: 직관 괜찮아요! 밤엔 선선하니 겉옷 하나.
- 80~100점: 15~25°에 비 걱정 없음, 응원가 목청껏 부르는 날 ⚾
- 0~29점: 비 소식이 짙어요. 오늘 직관은 쉬어 가요!
- 30~59점: 바람이 차거나 비 기운이 맴돌아요. 담요랑 우비 꼭 챙겨요!
- 60~79점: 직관 가기 괜찮은 저녁! 겉옷 하나 걸치고 출발~
- 80~100점: 선선한 바람에 비 걱정 없음! 응원가 목청껏 부르는 날 ⚾
### 공부각 (`study`)
@@ -627,12 +616,11 @@
- 분류: 먹고 마시기 · 중요도 하 · 아이콘 `chestnut` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 17~21시
- 요소별 규칙 (비중):
- 기온 60%: 추울수록 좋음 (18°=0점 → 0°=100점)
- 기온 65%: 추울수록 좋음 (18°=0점 → 0°=100점)
- 비 25%: 비 안 올수록 좋음
- 바람 5%: 셀수록 좋음 (초속 8m=100점)
- 습도 0%: 상관없음 (50점 고정)
- 미세먼지 5%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 체감 18° 이상이면 최대 20점
- 반영 못 하는 것: 군밤 노점이 있는지는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -817,7 +805,6 @@
- 습도 15%: 낮을수록 좋음 (90%=0점 → 40%=100점)
- 미세먼지 10%: 초미세먼지 낮을수록 좋음
- 햇빛 20%: 해 난 비율 90% 이상이면 만점, 30% 이하면 0점 (Open-Meteo)
- 시간·요일 0%: 고정 100점
- 점수 깎이는 조건: 비 소식이 있으면 0점, 비 확률 40% 이상이면 0점
- 반영 못 하는 것: 베란다 방향·햇빛 드는 시간은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -832,12 +819,11 @@
- 분류: 먹고 마시기 · 중요도 하 · 아이콘 `bingsu` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 13~18시
- 요소별 규칙 (비중):
- 기온 70%: 더울수록 좋음 (22°=0점 → 33°=100점)
- 기온 75%: 더울수록 좋음 (22°=0점 → 33°=100점)
- 비 10%: 비 안 올수록 좋음
- 바람 5%: 잔잔할수록 좋음 (초속 4m까지 괜찮음, 12m면 0점)
- 습도 10%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 재미로 보는 지수예요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -853,11 +839,10 @@
- 시간대: 9~21시
- 요소별 규칙 (비중):
- 기온 15%: 더울수록 좋음 (15°=0점 → 28°=100점)
- 비 60%: 비 올수록 좋음
- 비 65%: 비 올수록 좋음
- 바람 0%: 상관없음 (50점 고정)
- 습도 20%: 낮을수록 좋음 (90%=0점 → 40%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 비 확률 40% 미만이면 최대 20점
- 반영 못 하는 것: 집 안 습도·환기·제습기 여부는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -935,12 +920,11 @@
- 분류: 먹고 마시기 · 중요도 하 · 아이콘 `sweet_potato` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 16~21시
- 요소별 규칙 (비중):
- 기온 65%: 추울수록 좋음 (18°=0점 → 2°=100점)
- 기온 70%: 추울수록 좋음 (18°=0점 → 2°=100점)
- 비 20%: 비 안 올수록 좋음
- 바람 5%: 셀수록 좋음 (초속 8m=100점)
- 습도 0%: 상관없음 (50점 고정)
- 미세먼지 5%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 재미로 보는 지수예요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -996,12 +980,11 @@
- 분류: 먹고 마시기 · 중요도 하 · 아이콘 `bungeoppang` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 15~21시
- 요소별 규칙 (비중):
- 기온 70%: 추울수록 좋음 (12°=0점 → -5°=100점)
- 기온 75%: 추울수록 좋음 (12°=0점 → -5°=100점)
- 비 15%: 비 안 올수록 좋음
- 바람 5%: 셀수록 좋음 (초속 8m=100점)
- 습도 0%: 상관없음 (50점 고정)
- 미세먼지 5%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 붕어빵 노점이 있는지는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1016,12 +999,11 @@
- 분류: 집안일 · 중요도 하 · 아이콘 `tangerine` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 19~24시
- 요소별 규칙 (비중):
- 기온 75%: 추울수록 좋음 (12°=0점 → -5°=100점)
- 기온 80%: 추울수록 좋음 (12°=0점 → -5°=100점)
- 비 5%: 비 올수록 좋음
- 바람 10%: 셀수록 좋음 (초속 8m=100점)
- 습도 0%: 상관없음 (50점 고정)
- 미세먼지 5%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 재미로 보는 지수예요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1037,11 +1019,10 @@
- 시간대: 6~24시
- 요소별 규칙 (비중):
- 기온 0%: 체감 0~40°가 좋음
- 비 90%: 비 올수록 좋음
- 비 100%: 지금부터 자정까지 남은 시각의 비 확률 평균 × 100점. 지금 비가 오면 70점에서 시작해 평균 × 30점을 더함 (남은 시각이 모두 100%면 100점). 내일·토·일 칸은 그날 6~24시 평균 × 100점
- 바람 0%: 상관없음 (50점 고정)
- 습도 0%: 상관없음 (50점 고정)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 10%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 소나기처럼 갑자기 오는 비는 놓칠 수 있어요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1057,11 +1038,10 @@
- 시간대: 9~24시
- 요소별 규칙 (비중):
- 기온 20%: 추울수록 좋음 (26°=0점 → 10°=100점)
- 비 70%: 비 올수록 좋음
- 비 65%: 비 올수록 좋음
- 바람 0%: 상관없음 (50점 고정)
- 습도 0%: 상관없음 (50점 고정)
- 습도 15%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 10%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 실제 판매량으로 검증하기 전이에요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1076,12 +1056,11 @@
- 분류: 집안일 · 중요도 하 · 아이콘 `rain` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 9~24시
- 요소별 규칙 (비중):
- 기온 25%: 추울수록 좋음 (26°=0점 → 8°=100점)
- 비 60%: 비 올수록 좋음
- 기온 30%: 추울수록 좋음 (26°=0점 → 8°=100점)
- 비 55%: 비 올수록 좋음
- 바람 0%: 상관없음 (50점 고정)
- 습도 0%: 상관없음 (50점 고정)
- 습도 15%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 15%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 음악 취향은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1118,11 +1097,10 @@
- 시간대: 6~24시
- 요소별 규칙 (비중):
- 기온 30%: 체감 15~25°가 좋음
- 비 50%: 비 올수록 좋음
- 비 55%: 비 올수록 좋음
- 바람 15%: 잔잔할수록 좋음 (초속 3m까지 괜찮음, 10m면 0점)
- 습도 0%: 상관없음 (50점 고정)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 빗길 미끄러움은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1133,23 +1111,22 @@
### 우산분실각 (`umbrella_lost`)
- 설명: 오전 9시~밤 10시, 비가 그쳐서 우산을 두고 오기 쉬운 정도
- 설명: 챙겨 나온 우산을 쓸 일이 적어 두고 오기 쉬운 정도
- 분류: 생활 고민 · 중요도 중 · 아이콘 `umbrella` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 9~11시 / 11~13시 / 13~15시 / 15~17시 / 17~19시 / 19~22시
- 시간대: 9~22시
- 요소별 규칙 (비중):
- 기온 0%: 체감 0~40°가 좋음
- 비 80%: 비 안 올수록 좋음
- 비 100%: 우산을 챙겼을 정도 × 비가 안 오는 시간의 비율. 챙겼을 정도는 지금 비가 오면 100%, 아니면 지금부터 자정까지 가장 높은 비 확률. 비가 안 오는 시간의 비율은 100% − 남은 시각의 비 확률 평균. 지난 시각은 보지 않음. 내일·토·일 칸은 그날 시간대로 같은 식
- 바람 0%: 상관없음 (50점 고정)
- 습도 0%: 상관없음 (50점 고정)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 20%: 고정 100점
- 점수 깎이는 조건: 앞서 내린 비가 없으면 0점, 비 소식이 있으면 0점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 비가 언제 그칠지는 예보만큼만 맞아요
- 점수 구간별 설명 (상세 창에 나옴):
- 0~29점: 우산 두고 올 일 없는 날이에요.
- 30~59점: 비가 오락가락해요. 우산 손에 꼭 쥐어요.
- 60~79점: 비가 그쳤어요. 카페·버스에 우산 두고 오기 딱 좋아요.
- 80~100점: 비 끝, 하늘 맑음! 일어날 때 우산부터 챙겨요 ☂️
- 30~59점: 우산 쓸 일이 꽤 있어요. 손에 꼭 쥐어요.
- 60~79점: 우산을 들고만 다니는 시간이 길어요. 카페·버스에 두고 오기 딱 좋아요.
- 80~100점: 우산 쓸 일이 거의 없어요. 일어날 때 우산부터 챙겨요 ☂️
### 교통체증각 (`traffic`)
@@ -1240,9 +1217,8 @@
- 기온 10%: 더울수록 좋음 (15°=0점 → 28°=100점)
- 비 25%: 비 올수록 좋음
- 바람 0%: 상관없음 (50점 고정)
- 습도 60%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 습도 65%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 실내 습도와 머릿결은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1257,12 +1233,11 @@
- 분류: 집안일 · 중요도 중 · 아이콘 `boiler` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 21~다음 날 7시
- 요소별 규칙 (비중):
- 기온 70%: 추울수록 좋음 (20°=0점 → 3°=100점)
- 기온 75%: 추울수록 좋음 (20°=0점 → 3°=100점)
- 비 10%: 비 올수록 좋음
- 바람 0%: 상관없음 (50점 고정)
- 습도 15%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 집 단열과 실내 온도는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1282,8 +1257,8 @@
- 바람 0%: 상관없음 (50점 고정)
- 습도 0%: 상관없음 (50점 고정)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 자외선 80%: 자외선 7 이상이면 만점, 1 이하면 0점 (Open-Meteo)
- 시간·요일 5%: 고정 100점
- 자외선 70%: 자외선 7 이상이면 만점, 1 이하면 0점 (Open-Meteo)
- 햇빛 15%: 해 난 비율 80% 이상이면 만점, 20% 이하면 0점 (Open-Meteo)
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 그늘·실내에 있는 시간은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1298,12 +1273,11 @@
- 분류: 생활 고민 · 중요도 중 · 아이콘 `mosquito` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 19~24시
- 요소별 규칙 (비중):
- 기온 50%: 더울수록 좋음 (16°=0점 → 27°=100점)
- 기온 55%: 더울수록 좋음 (16°=0점 → 27°=100점)
- 비 0%: 비 안 올수록 좋음
- 바람 20%: 잔잔할수록 좋음 (초속 2m까지 괜찮음, 6m면 0점)
- 습도 25%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 물웅덩이·풀숲 같은 동네 환경은 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1318,12 +1292,11 @@
- 분류: 밖에서 놀기 · 중요도 중 · 아이콘 `tennis` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 7~11시 / 17~21시
- 요소별 규칙 (비중):
- 기온 30%: 체감 10~25°가 좋음
- 기온 35%: 체감 10~25°가 좋음
- 비 25%: 비 안 올수록 좋음
- 바람 25%: 잔잔할수록 좋음 (초속 3m까지 괜찮음, 8m면 0점)
- 습도 5%: 30~65%가 좋음 (최적 45%)
- 미세먼지 10%: 초미세먼지 낮을수록 좋음
- 시간·요일 5%: 고정 100점
- 점수 깎이는 조건: 비 소식이 있으면 0점, 비 확률 60% 이상이면 0점, 바람 8m/s 이상이면 0점
- 반영 못 하는 것: 앞서 내린 비로 젖은 코트는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1360,10 +1333,9 @@
- 요소별 규칙 (비중):
- 기온 50%: 체감이 15~24°에서 멀수록(덥거나 추울수록) 좋음
- 비 30%: 비 올수록 좋음
- 바람 0%: 상관없음 (50점 고정)
- 바람 20%: 셀수록 좋음 (초속 8m=100점)
- 습도 0%: 상관없음 (50점 고정)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 20%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 어제보다 날씨가 얼마나 바뀌었는지는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1441,10 +1413,9 @@
- 기온 0%: 체감 0~40°가 좋음
- 비 20%: 비 안 올수록 좋음
- 바람 15%: 잔잔할수록 좋음 (초속 3m까지 괜찮음, 10m면 0점)
- 습도 30%: 낮을수록 좋음 (90%=0점 → 40%=100점)
- 습도 35%: 낮을수록 좋음 (90%=0점 → 40%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 햇빛 25%: 해 난 비율 70% 이상이면 만점, 10% 이하면 0점 (Open-Meteo)
- 시간·요일 10%: 고정 100점
- 햇빛 30%: 해 난 비율 70% 이상이면 만점, 10% 이하면 0점 (Open-Meteo)
- 점수 깎이는 조건: 비 소식이 있으면 0점
- 반영 못 하는 것: 실내 조명과 장소는 반영하지 못해요
- 점수 구간별 설명 (상세 창에 나옴):
@@ -1459,12 +1430,11 @@
- 분류: 생활 고민 · 중요도 하 · 아이콘 `sentimental` · 재미 각 예 · 계절 핵심 아니오 · 계산 근거 화면 있음
- 시간대: 18~23시
- 요소별 규칙 (비중):
- 기온 35%: 체감 8~18°가 좋음
- 비 30%: 비 올수록 좋음
- 바람 10%: 적당한 바람(초속 2~5m)이 좋음
- 기온 40%: 체감 8~18°가 좋음
- 비 35%: 비 올수록 좋음
- 바람 15%: 적당한 바람(초속 2~5m)이 좋음
- 습도 10%: 높을수록 좋음 (40%=0점 → 90%=100점)
- 미세먼지 0%: 초미세먼지 낮을수록 좋음
- 시간·요일 15%: 고정 100점
- 점수 깎이는 조건: 없음
- 반영 못 하는 것: 흐린 정도는 비 확률로만 짐작해요
- 점수 구간별 설명 (상세 창에 나옴):
+5
View File
@@ -378,6 +378,11 @@ CREATE INDEX IF NOT EXISTS idx_talk_user_day ON public.talk (user_id, created_at
-- 글 주제 (TalkTopic: 1 동네 이야기, 2 하늘·노을, 3 비·눈, 4 단풍·꽃, 5 오늘 옷차림)
ALTER TABLE public.talk ADD COLUMN IF NOT EXISTS topic SMALLINT NOT NULL DEFAULT 1;
CREATE INDEX IF NOT EXISTS idx_talk_recent ON public.talk (created_at DESC) WHERE deleted = FALSE AND hidden = FALSE;
-- 사람 글 댓글은 comment 표를 같이 쓰고 talk_id 로 가른다 (post_id 는 비움). 숨긴 댓글은 댓글 수에서 빠진다
ALTER TABLE public.talk ADD COLUMN IF NOT EXISTS comment_count INTEGER NOT NULL DEFAULT 0;
ALTER TABLE public.comment ALTER COLUMN post_id DROP NOT NULL;
ALTER TABLE public.comment ADD COLUMN IF NOT EXISTS talk_id BIGINT NULL;
CREATE INDEX IF NOT EXISTS idx_comment_talk ON public.comment (talk_id, created_at) WHERE deleted = FALSE AND talk_id IS NOT NULL;
CREATE TABLE IF NOT EXISTS public.talk_like (
talk_id BIGINT NOT NULL,
+7 -7
View File
@@ -21,17 +21,17 @@ def _me(u: User) -> Me:
return Me(login_id=u.login_id, nickname=u.nickname, character=u.character, color=u.color, mood=u.mood, provider=AuthProvider(u.provider), terms_agreed=u.terms_agreed_at is not None)
def _auth(err: ErrorType, user, service: AuthService) -> Res_Auth:
def _auth(err: ErrorType, user, service: AuthService, is_new: bool = False) -> Res_Auth:
if err is not ErrorType.SUCCESS:
return Res_Auth(result=error_info(err))
access, refresh = service.tokens(user)
return Res_Auth(access_token=access, refresh_token=refresh, me=_me(user))
return Res_Auth(access_token=access, refresh_token=refresh, me=_me(user), is_new=is_new)
@router.post("/signup", response_model=Res_Auth, response_model_exclude_none=True, summary="회원가입 (아이디 영문 소문자·숫자·_ 4~20자, 비밀번호 8자 이상, 닉네임 2~12자)")
async def signup(req: Req_Signup, service: AuthService = Depends()) -> Res_Auth:
err, user = await service.signup(req.login_id, req.password, req.nickname.strip())
return _auth(err, user, service)
return _auth(err, user, service, is_new=True)
@router.post("/login", response_model=Res_Auth, response_model_exclude_none=True, summary="로그인")
@@ -42,8 +42,8 @@ async def login(req: Req_Login, service: AuthService = Depends()) -> Res_Auth:
@router.post("/toss", response_model=Res_Auth, response_model_exclude_none=True, summary="토스 로그인 (앱인토스 TossAuth.login 의 authorizationCode·referrer)")
async def toss(req: Req_TossLogin, service: AuthService = Depends()) -> Res_Auth:
err, user = await service.toss_login(req.authorization_code, req.referrer)
return _auth(err, user, service)
err, user, created = await service.toss_login(req.authorization_code, req.referrer)
return _auth(err, user, service, is_new=created)
def _check_toss_basic(authorization: Optional[str]) -> None:
@@ -68,8 +68,8 @@ async def toss_unlink(req: Req_TossUnlink, authorization: Optional[str] = Header
@router.post("/google", response_model=Res_Auth, response_model_exclude_none=True, summary="구글 로그인 (처음이면 자동 닉네임으로 가입)")
async def google_login(req: Req_Google, service: AuthService = Depends()) -> Res_Auth:
err, user = await service.google(req.credential)
return _auth(err, user, service)
err, user, created = await service.google(req.credential)
return _auth(err, user, service, is_new=created)
@router.get("/config", response_model=Res_AuthConfig, response_model_exclude_none=True, summary="로그인 화면 설정 (구글 클라이언트 ID)")
+1
View File
@@ -55,6 +55,7 @@ class Res_Auth(Res_WebPacketProtocol):
access_token: Optional[str] = None
refresh_token: Optional[str] = None
me: Optional[Me] = None
is_new: Optional[bool] = Field(None, description="이번 요청으로 새로 가입한 계정이면 true (GA sign_up)")
class Res_TossUnlink(Res_WebPacketProtocol):
+12 -1
View File
@@ -183,12 +183,23 @@ class WeatherWhy(WebPacketProtocol):
note: str = Field(description="지금 값 (예: 체감 19°, 편한 범위 18~24° 안)")
class TomorrowEvent(WebPacketProtocol):
event_id: int
name: str
place: str
icon: str
start_date: date
end_date: date
class HeroTomorrow(WebPacketProtocol):
"""히어로 '내일' 스위치. 3시간 칸 날씨는 /v1/weather/today?day=tomorrow 로 따로 받는다."""
"""히어로 '내일' 스위치와 내일 페이지(/tomorrow/...). 3시간 칸 날씨는 /v1/weather/today?day=tomorrow 로 따로 받는다."""
day: date
weather_slots: dict[str, int] = Field(default_factory=dict, description="내일 구간별 날씨 점수 {morning·day·evening·night: 점수}")
weather_why: dict[str, list[WeatherWhy]] = Field(default_factory=dict, description="내일 구간별 날씨 점수 근거")
top1: Optional[TopIndex] = Field(default=None, description="내일 하루 점수로 1위인 각. score·summary 는 내일 값")
ranked: list[TopIndex] = Field(default_factory=list, description="내일 하루 점수 순위 5개 (내일 페이지 '내일의 각'). top1 이 첫째")
events: list[TomorrowEvent] = Field(default_factory=list, description="내일 열리는 같은 시도 근처 행사 최대 3개 (내일 페이지)")
class Hero(WebPacketProtocol):
+23 -4
View File
@@ -24,6 +24,12 @@ def _comment(v: CommentView) -> CommentData:
return CommentData(comment_id=c.comment_id, nickname=v.nickname, character=v.character, color=v.color, mood=v.mood, body=c.body, like_count=c.like_count, liked=v.liked, mine=v.mine, official=v.official, created_at=c.created_at.astimezone(KST))
def _comment_list(err: ErrorType, items: list[CommentView]) -> Res_CommentList:
if err is not ErrorType.SUCCESS:
return Res_CommentList(result=error_info(err))
return Res_CommentList(comments=[_comment(v) for v in items], next_cursor=items[-1].comment.comment_id if len(items) == PAGE else None)
async def _like(post_id: int, who: Liker, on: bool, service: ReactionService) -> Res_PostLike:
err, count = await service.like_post(post_id, who, on)
return Res_PostLike(result=error_info(err)) if err is not ErrorType.SUCCESS else Res_PostLike(liked=on, like_count=count)
@@ -65,10 +71,7 @@ async def list_comments(
post_id: int = Path(...), cursor: Optional[int] = Query(None), user: Optional[User] = Depends(optional_user), who: Liker = Depends(liker),
service: ReactionService = Depends(),
) -> Res_CommentList:
err, items = await service.comments(post_id, user, who.ip_hash, cursor)
if err is not ErrorType.SUCCESS:
return Res_CommentList(result=error_info(err))
return Res_CommentList(comments=[_comment(v) for v in items], next_cursor=items[-1].comment.comment_id if len(items) == PAGE else None)
return _comment_list(*await service.comments(post_id, user, who.ip_hash, cursor))
@router.post("/post/{post_id}/comment", response_model=Res_Comment, response_model_exclude_none=True, summary="댓글 쓰기 (60자, 로그인 없으면 '동네 익명'으로 IP 당 하루 20개, 로그인했는데 이용약관 동의 전이면 TERMS_REQUIRED)")
@@ -79,6 +82,22 @@ async def add_comment(
return Res_Comment(result=error_info(err)) if err is not ErrorType.SUCCESS else Res_Comment(comment=_comment(v))
@router.get("/talk/{talk_id}/comment/list", response_model=Res_CommentList, response_model_exclude_none=True, summary="사람 글 댓글 목록 (로그인 없이 보기)")
async def list_talk_comments(
talk_id: int = Path(...), cursor: Optional[int] = Query(None), user: Optional[User] = Depends(optional_user), who: Liker = Depends(liker),
service: ReactionService = Depends(),
) -> Res_CommentList:
return _comment_list(*await service.comments(None, user, who.ip_hash, cursor, talk_id))
@router.post("/talk/{talk_id}/comment", response_model=Res_Comment, response_model_exclude_none=True, summary="사람 글 댓글 쓰기 (로그인한 사람만, 60자, 링크·전화번호 불가, 이용약관 동의 전이면 TERMS_REQUIRED). 지우기·좋아요·신고·차단은 /comment/{comment_id} 그대로")
async def add_talk_comment(
talk_id: int = Path(...), req: Req_Comment = ..., user: User = Depends(current_user), who: Liker = Depends(liker), service: ReactionService = Depends(),
) -> Res_Comment:
err, v = await service.add_talk_comment(talk_id, user, who, req.body)
return Res_Comment(result=error_info(err)) if err is not ErrorType.SUCCESS else Res_Comment(comment=_comment(v))
@router.delete("/comment/{comment_id}", response_model=Res_WebPacketProtocol, response_model_exclude_none=True, summary="내 댓글 지우기 (로그인 없이 쓴 댓글은 같은 IP 에서)")
async def delete_comment(comment_id: int = Path(...), who: Liker = Depends(liker), service: ReactionService = Depends()) -> Res_WebPacketProtocol:
return Res_WebPacketProtocol(result=error_info(await service.delete_comment(comment_id, who)))
+1
View File
@@ -54,6 +54,7 @@ class SajuMe(WebPacketProtocol):
elements: dict[str, float] = Field({}, description="오행 세력 점수 木火土金水 (월지 30·일지 20·나머지 10, 지지는 지장간 날 수로 나눔)")
top_element: Optional[str] = Field(None, description="가장 센 오행")
strong: Optional[bool] = Field(None, description="신강이면 true, 신약이면 false")
strength: Optional[str] = Field(None, description="신강 · 중화 · 신약 (득령이면 돕는 몫에 가산, 45~55% 사이는 중화)")
support: Optional[float] = Field(None, description="일간을 뺀 점수 중 일간을 돕는 기운 몫 0~1")
+1 -1
View File
@@ -31,7 +31,7 @@ def _res(r: Reading) -> Res_Saju:
pillars=[SajuPillar(position=pos, stem=p.stem, branch=p.branch, stem_ko=ko(p.stem), branch_ko=ko(p.branch), stem_element=stem_element(p.stem), branch_element=branch_element(p.branch),
stem_ten_god=gods[pos]["stem"], branch_ten_god=gods[pos]["branch"]) for pos, p in pillars],
hour_known=c.hour is not None, jeol_warning=c.jeol_on_birth_day, scene=r.scene[0], scene_desc=r.scene[1], scene_icon=r.scene_icon, need=r.need,
elements=strength.elements, top_element=strength.top, strong=strength.strong, support=strength.support,
elements=strength.elements, top_element=strength.top, strong=strength.strong, strength=strength.label, support=strength.support,
),
today=SajuToday(
day=today.day, pillar=ko(today.facts.pillar.stem + today.facts.pillar.branch), ten_god=today.facts.stem_ten_god, title=T.TEN_GOD_TEXT[today.facts.stem_ten_god][0],
+16
View File
@@ -42,3 +42,19 @@ class Res_ArticleList(Res_WebPacketProtocol):
class Res_Article(Res_WebPacketProtocol):
article: Optional[ArticleSummary] = None
body: list[str] = []
class FirstSnowSpot(WebPacketProtocol):
name: str
region: str # 시·도
lat: float
lon: float
normal: str # 평년 첫눈 날짜 "MM-DD" (1991~2020 평균)
top: bool = False # 처음 화면에 이름까지 보이는 대표 지점
snow_date: Optional[date] = None # 앞으로 7일 안에 눈 예보가 있는 첫 날. 없으면 비움
snow_cm: Optional[float] = None # 그날 눈 오는 양(cm)
class Res_FirstSnow(Res_WebPacketProtocol):
forecast: bool = False # 눈 예보를 받았는지. False 면 snow_date 는 모두 비어 있다(평년 날짜만)
spots: list[FirstSnowSpot] = []
+9 -1
View File
@@ -5,7 +5,9 @@ from fastapi import APIRouter, Depends, Path, Query
from common.database.model.models import Article
from common.enums import ArticleCategory, ErrorType
from common.models.errors import error_info
from router.v1.season.protocol import ArticleSummary, Res_Article, Res_ArticleList, Res_SeasonWeek, TermData
from common.utils.kma_time import now_kst
from router.v1.season.protocol import ArticleSummary, FirstSnowSpot, Res_Article, Res_ArticleList, Res_FirstSnow, Res_SeasonWeek, TermData
from services.first_snow_service import FirstSnowService
from services.season_service import SeasonService
router = APIRouter(prefix="/v1/season", tags=["season"])
@@ -44,3 +46,9 @@ async def get_article(article_id: int = Path(...), service: SeasonService = Depe
if err is not ErrorType.SUCCESS:
return Res_Article(result=error_info(err))
return Res_Article(article=_summary(a), body=a.body)
@router.get("/first-snow", response_model=Res_FirstSnow, response_model_exclude_none=True, summary="첫눈 지도: 지점별 평년 첫눈 날짜와 앞으로 7일 눈 예보")
async def get_first_snow(service: FirstSnowService = Depends()) -> Res_FirstSnow:
forecast, spots = await service.spots(now_kst())
return Res_FirstSnow(forecast=forecast, spots=[FirstSnowSpot(**s.__dict__) for s in spots])
+1
View File
@@ -19,6 +19,7 @@ class TalkData(WebPacketProtocol):
image: Optional[str] = Field(None, description="올린 사진 주소")
topic: TalkTopic = TalkTopic.LOCAL
like_count: int
comment_count: int = 0
liked: bool
mine: bool
created_at: datetime
+1 -1
View File
@@ -23,7 +23,7 @@ def _data(v: TalkView) -> TalkData:
t, u = v.talk, v.author
return TalkData(
talk_id=t.talk_id, nickname=u.nickname, character=u.character, color=u.color, mood=u.mood, region_name=v.region_name, weather=t.weather,
body=t.body, image=t.image, topic=TalkTopic(t.topic), like_count=t.like_count, liked=v.liked, mine=v.mine, created_at=t.created_at.astimezone(KST),
body=t.body, image=t.image, topic=TalkTopic(t.topic), like_count=t.like_count, comment_count=t.comment_count, liked=v.liked, mine=v.mine, created_at=t.created_at.astimezone(KST),
ago=ago_text(t.created_at, now_kst()),
)
+11 -1
View File
@@ -39,6 +39,13 @@ def temp(r):
def rain(r):
if r.get("kind") == "unused":
return ("우산을 챙겼을 정도 × 비가 안 오는 시간의 비율. 챙겼을 정도는 지금 비가 오면 100%, 아니면 지금부터 자정까지 가장 높은 비 확률. "
"비가 안 오는 시간의 비율은 100% − 남은 시각의 비 확률 평균. 지난 시각은 보지 않음. 내일·토·일 칸은 그날 시간대로 같은 식")
if r.get("span") == "rest_of_day":
base = r["now_base"]
return (f"지금부터 자정까지 남은 시각의 비 확률 평균 × 100점. 지금 비가 오면 {base}점에서 시작해 평균 × {100 - base}점을 더함 "
f"(남은 시각이 모두 100%면 100점). 내일·토·일 칸은 그날 6~24시 평균 × 100점")
return "비 올수록 좋음" if r["dir"] == "wet" else "비 안 올수록 좋음"
@@ -106,7 +113,8 @@ def main() -> None:
P("- 각마다 6가지 요소(기온·비·바람·습도·미세먼지·시간)를 0~100점으로 매기고, 아래 비중(%)으로 섞습니다.")
P("- 최종 점수 = 비중대로 섞은 점수 × (0.75 + 0.25 × 가장 낮은 요소 점수 ÷ 100). 비중 0%인 요소는 '가장 낮은 요소'에서 뺍니다. 가장 낮은 요소가 0점이면 25%가 깎입니다.")
P("- '0점 조건'에 걸리면 0점, '최대 N점' 조건에 걸리면 N점을 넘지 못합니다.")
P("- 시간대가 여러 개면 그중 가장 좋은 시간대 점수를 씁니다.")
P("- 요소가 하나뿐인 각(우산각·우산분실각)은 '가장 낮은 요소'로 깎지 않습니다. 그 요소가 곧 점수입니다.")
P("- 시간대가 여러 개면 그중 가장 좋은 시간대 점수를 씁니다. 시간대는 내일·토·일 점수에 볼 시각을 정할 뿐, 오늘 점수는 지금 구간의 날씨로 내며 시간대에 해당하는지는 점수에 반영하지 않습니다.")
P("- 미세먼지는 초미세먼지 15㎍/㎥ 이하 100점 → 75㎍/㎥ 이상 0점입니다. 집콕각처럼 규칙을 따로 적은 각만 거꾸로(탁할수록 좋음) 셉니다.")
P("- 바람·미세먼지·노을 정보가 없으면 70점으로 둡니다.")
P("- 최종 점수는 원점수 × 중요도 배율(상 1.0 · 중 0.85 · 하 0.7)을 정수로 반올림한 값입니다. 순위와 화면 표시 모두 이 최종 점수를 사용합니다.\n")
@@ -128,6 +136,8 @@ def main() -> None:
w = x.get("weight_" + key, 0)
if key in _OPTIONAL and not w:
continue
if key == "time" and not w and x["factor_rules"]["time"]["type"] == "fixed":
continue # 활동 시간대 알맞음은 점수에 쓰지 않는다
rule = fn(x["factor_rules"].get(key, {"zero": 75, "full": 15}))
P(f" - {label} {w}%: {rule}")
zs = [zero(z) for z in x["zero_rules"]]
+153 -119
View File
@@ -263,7 +263,7 @@
"to": 22
}
],
"weight_temp": 30,
"weight_temp": 35,
"weight_rain": 25,
"weight_wind": 15,
"weight_humidity": 10,
@@ -271,7 +271,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -356,11 +356,11 @@
"weight_rain": 15,
"weight_wind": 15,
"weight_humidity": 20,
"weight_air": 35,
"weight_air": 40,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -536,14 +536,14 @@
}
],
"weight_temp": 5,
"weight_rain": 40,
"weight_rain": 45,
"weight_wind": 10,
"weight_humidity": 10,
"weight_air": 10,
"weight_uv": 10,
"weight_sun": 10,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -705,7 +705,7 @@
"to": 22
}
],
"weight_temp": 35,
"weight_temp": 40,
"weight_rain": 20,
"weight_wind": 10,
"weight_humidity": 15,
@@ -713,20 +713,21 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
"lo": 8,
"hi": 18
"lo": 5,
"hi": 18,
"best": 12
},
"rain": {
"dir": "dry"
},
"wind": {
"type": "calm",
"ok": 4,
"limit": 10
"ok": 3,
"limit": 8
},
"humidity": {
"type": "lower"
@@ -751,14 +752,69 @@
"field": "rain_prob",
"op": ">=",
"value": 70
},
{
"field": "feels_c",
"op": "<",
"value": 0
},
{
"field": "warning",
"op": "==",
"value": "wind"
},
{
"field": "wind_ms",
"op": ">=",
"value": 8
},
{
"field": "gust_ms",
"op": ">=",
"value": 15
},
{
"field": "pm25",
"op": ">=",
"value": 75
},
{
"field": "rain_prob",
"op": ">=",
"value": 60,
"cap": 30
},
{
"field": "wind_ms",
"op": ">=",
"value": 6,
"cap": 30
},
{
"field": "pm25",
"op": ">=",
"value": 36,
"cap": 30
},
{
"field": "feels_c",
"op": ">=",
"value": 28,
"cap": 30
},
{
"field": "feels_c",
"op": "<",
"value": 5,
"cap": 40
}
],
"limit_description": "노면 상태는 반영하지 못해요",
"sentences": {
"0": "체감 35° 넘거나 비가 쏟아져요. 오늘은 러닝머신으로!",
"30": "덥거나 눅눅해서 금방 지쳐요. 거리 줄이고 물 꼭!",
"0": "밖에서 뛰기엔 날씨가 험해요. 오늘은 러닝머신으로!",
"30": "지금은 뛰기 애매해요. 아침·저녁에 짧게 가볍게!",
"60": "뛸 만해요! 아침·저녁 중 시원한 쪽 고르기.",
"80": "8~18°에 공기 보송, 기록 갱신각 🏃"
"80": "선선하고 공기 보송, 기록 갱신각 🏃"
},
"sort_order": 9,
"priority": 1,
@@ -863,7 +919,7 @@
"to": 24
}
],
"weight_temp": 50,
"weight_temp": 55,
"weight_rain": 25,
"weight_wind": 5,
"weight_humidity": 10,
@@ -871,7 +927,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -977,15 +1033,15 @@
"to": 10
}
],
"weight_temp": 90,
"weight_rain": 0,
"weight_wind": 0,
"weight_temp": 80,
"weight_rain": 10,
"weight_wind": 10,
"weight_humidity": 0,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -1034,14 +1090,14 @@
}
],
"weight_temp": 15,
"weight_rain": 30,
"weight_rain": 35,
"weight_wind": 15,
"weight_humidity": 10,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 25,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "higher",
@@ -1201,7 +1257,7 @@
"to": 20
}
],
"weight_temp": 40,
"weight_temp": 45,
"weight_rain": 25,
"weight_wind": 10,
"weight_humidity": 5,
@@ -1209,7 +1265,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -1289,7 +1345,7 @@
"to": 9
}
],
"weight_temp": 70,
"weight_temp": 75,
"weight_rain": 10,
"weight_wind": 0,
"weight_humidity": 15,
@@ -1297,7 +1353,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -1345,7 +1401,7 @@
"to": 18
}
],
"weight_temp": 55,
"weight_temp": 60,
"weight_rain": 5,
"weight_wind": 0,
"weight_humidity": 35,
@@ -1353,7 +1409,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "higher",
@@ -1401,7 +1457,7 @@
"to": 14
}
],
"weight_temp": 65,
"weight_temp": 70,
"weight_rain": 15,
"weight_wind": 5,
"weight_humidity": 5,
@@ -1409,7 +1465,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "higher",
@@ -1581,14 +1637,14 @@
}
],
"weight_temp": 20,
"weight_rain": 25,
"weight_rain": 30,
"weight_wind": 10,
"weight_humidity": 10,
"weight_air": 10,
"weight_uv": 10,
"weight_sun": 10,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -1938,7 +1994,7 @@
"to": 21
}
],
"weight_temp": 60,
"weight_temp": 65,
"weight_rain": 25,
"weight_wind": 5,
"weight_humidity": 0,
@@ -1946,7 +2002,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -2743,7 +2799,7 @@
"to": 18
}
],
"weight_temp": 70,
"weight_temp": 75,
"weight_rain": 10,
"weight_wind": 5,
"weight_humidity": 10,
@@ -2751,7 +2807,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "higher",
@@ -2806,14 +2862,14 @@
}
],
"weight_temp": 15,
"weight_rain": 60,
"weight_rain": 65,
"weight_wind": 0,
"weight_humidity": 20,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "higher",
@@ -3107,7 +3163,7 @@
"to": 21
}
],
"weight_temp": 65,
"weight_temp": 70,
"weight_rain": 20,
"weight_wind": 5,
"weight_humidity": 0,
@@ -3115,7 +3171,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -3330,7 +3386,7 @@
"to": 21
}
],
"weight_temp": 70,
"weight_temp": 75,
"weight_rain": 15,
"weight_wind": 5,
"weight_humidity": 0,
@@ -3338,7 +3394,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -3390,7 +3446,7 @@
"to": 24
}
],
"weight_temp": 75,
"weight_temp": 80,
"weight_rain": 5,
"weight_wind": 10,
"weight_humidity": 0,
@@ -3398,7 +3454,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -3451,14 +3507,14 @@
}
],
"weight_temp": 0,
"weight_rain": 90,
"weight_rain": 100,
"weight_wind": 0,
"weight_humidity": 0,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -3466,7 +3522,9 @@
"hi": 40
},
"rain": {
"dir": "wet"
"dir": "wet",
"span": "rest_of_day",
"now_base": 70
},
"wind": {
"type": "ignore"
@@ -3507,14 +3565,14 @@
}
],
"weight_temp": 20,
"weight_rain": 70,
"weight_rain": 65,
"weight_wind": 0,
"weight_humidity": 0,
"weight_humidity": 15,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 10,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -3528,7 +3586,7 @@
"type": "ignore"
},
"humidity": {
"type": "ignore"
"type": "higher"
},
"time": {
"type": "fixed",
@@ -3562,15 +3620,15 @@
"to": 24
}
],
"weight_temp": 25,
"weight_rain": 60,
"weight_temp": 30,
"weight_rain": 55,
"weight_wind": 0,
"weight_humidity": 0,
"weight_humidity": 15,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 15,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -3584,7 +3642,7 @@
"type": "ignore"
},
"humidity": {
"type": "ignore"
"type": "higher"
},
"time": {
"type": "fixed",
@@ -3689,14 +3747,14 @@
}
],
"weight_temp": 30,
"weight_rain": 50,
"weight_rain": 55,
"weight_wind": 15,
"weight_humidity": 0,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -3739,42 +3797,22 @@
"is_fun": false,
"is_core": false,
"has_detail": true,
"description": "오전 9시~밤 10시, 비가 그쳐서 우산을 두고 오기 쉬운 정도",
"description": "챙겨 나온 우산을 쓸 일이 적어 두고 오기 쉬운 정도",
"windows": [
{
"from": 9,
"to": 11
},
{
"from": 11,
"to": 13
},
{
"from": 13,
"to": 15
},
{
"from": 15,
"to": 17
},
{
"from": 17,
"to": 19
},
{
"from": 19,
"to": 22
}
],
"weight_temp": 0,
"weight_rain": 80,
"weight_rain": 100,
"weight_wind": 0,
"weight_humidity": 0,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 20,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -3782,7 +3820,10 @@
"hi": 40
},
"rain": {
"dir": "dry"
"dir": "dry",
"span": "rest_of_day",
"kind": "unused",
"label": "우산 안 쓰는 시간"
},
"wind": {
"type": "ignore"
@@ -3795,24 +3836,13 @@
"value": 100
}
},
"zero_rules": [
{
"field": "rain_before",
"op": "==",
"value": "no"
},
{
"field": "rain",
"op": "==",
"value": "yes"
}
],
"zero_rules": [],
"limit_description": "비가 언제 그칠지는 예보만큼만 맞아요",
"sentences": {
"0": "우산 두고 올 일 없는 날이에요.",
"30": "비가 오락가락해요. 우산 손에 꼭 쥐어요.",
"60": "비가 그쳤어요. 카페·버스에 우산 두고 오기 딱 좋아요.",
"80": "비 끝, 하늘 맑음! 일어날 때 우산부터 챙겨요 ☂️"
"30": "우산 쓸 일이 꽤 있어요. 손에 꼭 쥐어요.",
"60": "우산을 들고만 다니는 시간이 길어요. 카페·버스에 두고 오기 딱 좋아요.",
"80": "우산 쓸 일이 거의 없어요. 일어날 때 우산부터 챙겨요 ☂️"
},
"sort_order": 52,
"priority": 2,
@@ -4132,12 +4162,12 @@
"weight_temp": 10,
"weight_rain": 25,
"weight_wind": 0,
"weight_humidity": 60,
"weight_humidity": 65,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "higher",
@@ -4185,7 +4215,7 @@
"to": 31
}
],
"weight_temp": 70,
"weight_temp": 75,
"weight_rain": 10,
"weight_wind": 0,
"weight_humidity": 15,
@@ -4193,7 +4223,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "lower",
@@ -4246,10 +4276,10 @@
"weight_wind": 0,
"weight_humidity": 0,
"weight_air": 0,
"weight_uv": 80,
"weight_sun": 0,
"weight_uv": 70,
"weight_sun": 15,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "higher",
@@ -4272,6 +4302,10 @@
"uv": {
"zero": 1,
"full": 7
},
"sun": {
"zero": 0.2,
"full": 0.8
}
},
"zero_rules": [],
@@ -4301,7 +4335,7 @@
"to": 24
}
],
"weight_temp": 50,
"weight_temp": 55,
"weight_rain": 0,
"weight_wind": 20,
"weight_humidity": 25,
@@ -4309,7 +4343,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "higher",
@@ -4370,7 +4404,7 @@
"to": 21
}
],
"weight_temp": 30,
"weight_temp": 35,
"weight_rain": 25,
"weight_wind": 25,
"weight_humidity": 5,
@@ -4378,7 +4412,7 @@
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 5,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -4528,13 +4562,13 @@
],
"weight_temp": 50,
"weight_rain": 30,
"weight_wind": 0,
"weight_wind": 20,
"weight_humidity": 0,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 20,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "away",
@@ -4545,7 +4579,7 @@
"dir": "wet"
},
"wind": {
"type": "ignore"
"type": "strong"
},
"humidity": {
"type": "ignore"
@@ -4781,12 +4815,12 @@
"weight_temp": 0,
"weight_rain": 20,
"weight_wind": 15,
"weight_humidity": 30,
"weight_humidity": 35,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 25,
"weight_sun": 30,
"weight_view": 0,
"weight_time": 10,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
@@ -4846,15 +4880,15 @@
"to": 23
}
],
"weight_temp": 35,
"weight_rain": 30,
"weight_wind": 10,
"weight_temp": 40,
"weight_rain": 35,
"weight_wind": 15,
"weight_humidity": 10,
"weight_air": 0,
"weight_uv": 0,
"weight_sun": 0,
"weight_view": 0,
"weight_time": 15,
"weight_time": 0,
"factor_rules": {
"temp": {
"type": "range",
+19 -15
View File
@@ -61,19 +61,20 @@ class AuthService:
return ErrorType.AUTH_FAILED, None
return ErrorType.SUCCESS, user
async def toss_login(self, authorization_code: str, referrer: str) -> tuple[ErrorType, Optional[User]]:
"""토스 userKey 로 계정을 찾고, 없으면 만든다. 이름·전화번호 같은 개인정보는 받지 않는다."""
async def toss_login(self, authorization_code: str, referrer: str) -> tuple[ErrorType, Optional[User], bool]:
"""토스 userKey 로 계정을 찾고, 없으면 만든다(셋째 값 True = 이번에 가입). 이름·전화번호 같은 개인정보는 받지 않는다."""
if not authorization_code or referrer not in TOSS_REFERRERS:
return ErrorType.INVALID_INPUT, None
return ErrorType.INVALID_INPUT, None, False
try:
key = str(await toss_login.user_key(authorization_code, referrer))
except toss_login.TossLoginError as e:
LOG.error(f"[auth] toss login: {e}")
return ErrorType.AUTH_FAILED, None
return ErrorType.AUTH_FAILED, None, False
provider = AuthProvider.TOSS.value
err, user = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.by_provider_uid(s, provider, key))
if err is not ErrorType.SUCCESS:
return err, None
return err, None, False
created = user is None
if user is None:
err, user = await DB_SESSION_MNG.execute_lambda_write(
lambda s: self.crud.create_social(s, provider, key, f"toss_{key}", f"토스{key[-4:]}")
@@ -82,30 +83,33 @@ class AuthService:
# 같은 사람이 동시에 두 번 들어온 경우 먼저 만든 계정을 쓴다
err, user = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.by_provider_uid(s, provider, key))
if err is not ErrorType.SUCCESS or user is None:
return err if err is not ErrorType.SUCCESS else ErrorType.DB_ERROR, None
return err if err is not ErrorType.SUCCESS else ErrorType.DB_ERROR, None, False
created = False
if user.status != 1:
return ErrorType.AUTH_FAILED, None
return ErrorType.SUCCESS, user
return ErrorType.AUTH_FAILED, None, False
return ErrorType.SUCCESS, user, created
async def google(self, credential: str) -> tuple[ErrorType, Optional[User]]:
"""구글 ID 토큰으로 로그인. 처음이면 자동 닉네임으로 계정을 만든다. 구글 이름·이메일은 저장하지 않는다."""
async def google(self, credential: str) -> tuple[ErrorType, Optional[User], bool]:
"""구글 ID 토큰으로 로그인. 처음이면 자동 닉네임으로 계정을 만든다(셋째 값 True = 이번에 가입). 구글 이름·이메일은 저장하지 않는다."""
sub = await verify_google(credential)
if sub is None:
return ErrorType.AUTH_FAILED, None
return ErrorType.AUTH_FAILED, None, False
login_id = f"google_{sub}"
err, user = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.by_login_id(s, login_id))
if err is not ErrorType.SUCCESS:
return err, None
return err, None, False
created = user is None
if user is None:
err, user = await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.create_google(s, sub, auto_nickname()))
if err is not ErrorType.SUCCESS:
# 같은 계정이 동시에 처음 들어온 경우엔 먼저 만들어진 쪽을 쓴다
err, user = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.by_login_id(s, login_id))
if err is not ErrorType.SUCCESS or user is None:
return ErrorType.DB_ERROR, None
return ErrorType.DB_ERROR, None, False
created = False
if user.status != 1:
return ErrorType.AUTH_FAILED, None
return ErrorType.SUCCESS, user
return ErrorType.AUTH_FAILED, None, False
return ErrorType.SUCCESS, user, created
async def toss_unlink(self, user_key: str) -> ErrorType:
"""토스에서 연결을 끊으면 그 계정의 모든 토큰을 무효로 만든다. 계정이 없어도 성공으로 본다."""
+62 -16
View File
@@ -46,6 +46,7 @@ class Hour:
visibility_km: Optional[float] = None
gust_ms: Optional[float] = None
ground_c: Optional[float] = None
observed: bool = False # 예보가 아니라 초단기실황으로 관측한 시각 (비 확률이 뜻이 없다)
@dataclass(frozen=True)
@@ -62,6 +63,7 @@ class Context:
sunrise_score: Optional[int] = None # 그날 아침 일출 하늘 점수 (해돋이각)
rain_hours: frozenset[int] = frozenset() # 그날 비 오는 시각(0~23). 우산분실각의 '앞서 비가 왔는지'
time_matches: bool = True # 평가하는 시간대가 각의 활동 시간대에 해당하는지
at_now: bool = False # 평가하는 첫 시각이 지금인지 (우산각의 '지금 비'). 다른 구간·내일 칸은 지금이 없다
@dataclass(frozen=True)
@@ -138,6 +140,36 @@ def rain_score(rule: dict, max_prob: int, raining: bool, until: str = "") -> tup
return (0 if raining else _linear(max_prob, 100, 0)), (f"비 소식, {prob}" if raining else prob)
def rain_rest_of_day_score(rule: dict, probs: list[int], raining_now: bool) -> tuple[int, str]:
"""남은 시각(시각마다 1시간)의 비 확률 평균. 지금 비가 오면 now_base 에서 시작해 나머지를 평균으로 채운다 (그 시각은 100% 로 침)."""
if raining_now:
probs = [100, *probs[1:]]
avg = sum(probs) / len(probs)
note = f"남은 시간 평균 비 확률 {round(avg)}%"
if raining_now:
base = rule["now_base"]
return _clamp(base + (100 - base) * avg / 100), f"지금 비가 와요, {note}"
return _clamp(avg), note
def rain_unused_umbrella_score(probs: list[int], raining_now: bool) -> tuple[int, str]:
"""들고 나온 우산을 안 쓰는 정도 = 우산을 챙겼을 정도 × 비가 안 오는 시간의 비율.
챙겼을 정도는 지금 비가 오면 100%, 아니면 남은 시각 중 가장 높은 비 확률. 지난 시각은 보지 않는다."""
if raining_now:
probs = [100, *probs[1:]]
carried = 100 if raining_now else max(probs)
unused = 100 - sum(probs) / len(probs)
note = f"우산 챙겼을 정도 {round(carried)}% × 비 안 오는 시간 {round(unused)}%"
return _clamp(carried * unused / 100), f"지금 비가 와요, {note}" if raining_now else note
def rain_span_score(rule: dict, probs: list[int], raining_now: bool) -> tuple[int, str]:
"""span 이 rest_of_day 인 비 규칙: 시각마다의 비 확률로 낸다 (우산각·우산분실각)."""
if rule.get("kind") == "unused":
return rain_unused_umbrella_score(probs, raining_now)
return rain_rest_of_day_score(rule, probs, raining_now)
def wind_score(rule: dict, wind: Optional[float]) -> tuple[int, str]:
if wind is None:
return _UNKNOWN, f"바람 정보가 없어 {_UNKNOWN}점으로 둬요"
@@ -230,7 +262,7 @@ def axis_label(axis: str, rules: dict) -> str:
if axis in _OM_LABEL:
return _OM_LABEL[axis]
if axis == "rain":
return "비 옴" if rules["rain"]["dir"] == "wet" else "비 안 옴"
return rules["rain"].get("label") or ("비 옴" if rules["rain"]["dir"] == "wet" else "비 안 옴")
if axis == "air":
rule = rules.get("air", _AIR_RULE)
return "공기 탁함" if rule["full"] > rule["zero"] else "공기 맑음"
@@ -270,6 +302,8 @@ def _cond(r: dict) -> tuple[str, str, str]:
return "비 소식이 있어", "비 소식이 있거나", "비 소식이 있으면"
if r["field"] == "rain_before":
return "앞서 내린 비가 없어", "앞서 내린 비가 없거나", "앞서 내린 비가 없으면"
if r["field"] == "time_matches":
return "활동 시간대가 아니라", "활동 시간대가 아니거나", "활동 시간대가 아니면"
base = f"{_FIELD_TEXT[r['field']]} {r['value']}{_UNIT[r['field']]} {'이상' if r['op'] == '>=' else '미만'}"
return f"{base}이라", f"{base}이거나", f"{base}이면"
@@ -293,18 +327,28 @@ _SKY_WORD = {Sky.CLEAR: "맑음", Sky.PARTLY: "구름 많음", Sky.CLOUDY: "흐
def _summary(hours: list[Hour]) -> str:
mid = hours[len(hours) // 2]
return summary_line(hours[len(hours) // 2])
_RAINING_NOW = {RainType.RAIN: "비 오는 중", RainType.SHOWER: "비 오는 중", RainType.SLEET: "진눈깨비 오는 중", RainType.SNOW: "눈 오는 중"}
def summary_line(mid: Hour) -> str:
"""그 시각 날씨 한 줄 (오후 5시 13°, 비 60%). 실황으로 관측한 시각은 확률 대신 본 대로 쓴다 (오후 4시 11°, 비 오는 중)."""
wind = mid.wind_ms
tag = f"비 {mid.rain_prob}%" if mid.rain_prob >= 50 else (
"바람 살랑" if wind is not None and wind <= 2 else "바람 조금" if wind is not None and wind <= 5 else "바람 강함" if wind is not None else _SKY_WORD[mid.sky]
)
calm = "바람 살랑" if wind is not None and wind <= 2 else "바람 조금" if wind is not None and wind <= 5 else "바람 강함" if wind is not None else _SKY_WORD[mid.sky]
if mid.observed:
tag = _RAINING_NOW.get(mid.rain_type, calm)
else:
tag = f"비 {mid.rain_prob}%" if mid.rain_prob >= 50 else calm
return f"{hour_label(mid.hour % 24)} {round(mid.feels_c)}°, {tag}"
def _weighted(factors: dict[str, int], weights: dict[str, int], worst_pull: bool = True, time_is_binary: bool = False) -> int:
"""비중대로 섞고, worst_pull 이면 가장 낮은 요소로 최대 25% 깎는다 (지금 날씨 점수는 깎지 않는다)."""
mixed = sum(factors[a] * weights[a] for a in AXES) / 100
if not worst_pull:
# 요소가 하나면 그 요소가 곧 가장 낮은 요소라 깎으면 같은 점수를 두 번 깎게 된다
if not worst_pull or sum(1 for a in AXES if weights[a]) <= 1:
return round(mixed)
# 시간대 불일치는 해당 가중치만 잃으며, 최저 요소에 따른 추가 감점에는 넣지 않는다.
worst = min((factors[a] for a in AXES if weights[a] and not (time_is_binary and a == "time")), default=100)
@@ -337,7 +381,10 @@ def evaluate(definition, windows: list[list[Hour]], ctx: Context) -> Optional[Re
grounds = [h.ground_c for h in hours if h.ground_c is not None]
scored = {
"temp": temp_score(rules["temp"], feels),
"rain": rain_score(rules["rain"], max_prob, raining, until if max_prob > own_prob else ""),
"rain": (
rain_span_score(rules["rain"], [h.rain_prob for h in hours], ctx.at_now and hours[0].rain_type is not RainType.NONE)
if rules["rain"].get("span") == "rest_of_day" else rain_score(rules["rain"], max_prob, raining, until if max_prob > own_prob else "")
),
"wind": wind_score(rules["wind"], max(winds) if winds else None),
"humidity": humidity_score(rules["humidity"], mean(h.humidity for h in hours)),
"air": air_score(ctx.pm25, ctx.air_label, rules.get("air")),
@@ -358,6 +405,7 @@ def evaluate(definition, windows: list[list[Hour]], ctx: Context) -> Optional[Re
"snow": "yes" if any(h.rain_type in (RainType.SNOW, RainType.SLEET) for h in hours) else "no",
"rain": "yes" if raining else "no", "humidity": round(mean(h.humidity for h in hours)),
"rain_before": "yes" if any(h < hours[0].hour for h in ctx.rain_hours) else "no",
"time_matches": ctx.time_matches,
}
reason, cap = _zero(definition.zero_rules, agg)
if reason is not None:
@@ -388,7 +436,8 @@ def estimate(definition, fc: DayForecast, windows: list[list[int]], ctx: Context
if not hours:
continue
temps = [hour_temp(fc.temp_min_c, fc.temp_max_c, h) for h in hours]
own_prob = max(fc.rain_prob_am if h < 12 else fc.rain_prob_pm if h < 24 else after.rain_prob_am for h in hours)
hour_probs = [fc.rain_prob_am if h < 12 else fc.rain_prob_pm if h < 24 else after.rain_prob_am for h in hours]
own_prob = max(hour_probs)
max_prob = max(own_prob, ctx.lookahead_rain_prob)
humidity = (50, "습도 이 각엔 상관없어 50점으로 둬요") if rules["humidity"]["type"] == "ignore" else (
_UNKNOWN, f"습도 정보가 없어 {_UNKNOWN}점으로 둬요"
@@ -396,7 +445,10 @@ def estimate(definition, fc: DayForecast, windows: list[list[int]], ctx: Context
temp, temp_note = temp_score(rules["temp"], mean(temps))
scored = {
"temp": (temp, f"{temp_note} (최저·최고 기온으로 어림)"),
"rain": rain_score(rules["rain"], max_prob, False, until if max_prob > own_prob else ""),
"rain": (
rain_span_score(rules["rain"], hour_probs, False)
if rules["rain"].get("span") == "rest_of_day" else rain_score(rules["rain"], max_prob, False, until if max_prob > own_prob else "")
),
"wind": wind_score(rules["wind"], None),
"humidity": humidity,
"air": air_score(None, None),
@@ -426,7 +478,6 @@ _OUTING_WEIGHTS = {"temp": 35, "rain": 40, "sky": 15, "wind": 10}
# 만점 조건을 엄격하게: 기온은 최적 21° ±0.5°, 바람은 초속 1m 이하(ok/2)여야 100점 — 같은 예보를 받는 여러 지역이 한꺼번에 100점이 되던 것을 줄인다
_OUTING_RULES = {"temp": {"type": "range", "lo": 17, "hi": 24, "best": 21, "plateau": 0.5}, "rain": {"dir": "dry"}, "wind": {"type": "calm", "ok": 2, "limit": 12}}
_OUTING_SKY = {Sky.CLEAR: 100, Sky.PARTLY: 80, Sky.CLOUDY: 50}
_OUTING_RAIN_PROB, _OUTING_RAIN_CAP = 60, 30
@dataclass
@@ -435,7 +486,6 @@ class Outing:
factors: dict[str, int]
notes: dict[str, str]
reason: str # 순위 옆 한 줄 근거 ("비 10% · 체감 21° · 맑음")
capped: bool # 비 때문에 최대 30점으로 묶였는지
estimated: bool = False
@@ -444,12 +494,8 @@ def _outing(scored: dict[str, tuple[int, str]], prob: int, raining: bool, temp_w
notes = {a: n for a, (_, n) in scored.items()}
worst = min(factors.values())
score = round(sum(factors[a] * w for a, w in _OUTING_WEIGHTS.items()) / 100 * (1 - _WORST_PULL + _WORST_PULL * worst / 100))
capped = raining or prob >= _OUTING_RAIN_PROB
if capped:
score = min(score, _OUTING_RAIN_CAP)
notes["rain"] += f", 비 확률 {_OUTING_RAIN_PROB}% 이상이거나 비 소식이면 최대 {_OUTING_RAIN_CAP}점"
reason = " · ".join(["비 소식" if raining else f"비 {prob}%", temp_word, _SKY_WORD[sky]])
return Outing(score=score, factors=factors, notes=notes, reason=reason, capped=capped, estimated=estimated)
return Outing(score=score, factors=factors, notes=notes, reason=reason, estimated=estimated)
def outing(hours: list[Hour]) -> Optional[Outing]:
+24 -24
View File
@@ -1,8 +1,8 @@
{
"about": "나들이 점수 바꾸기 표: 원래 점수 0~100 → 표시 점수. 평균 60·표준편차 15. scripts/gen_outing_score_table.py 가 만든다",
"period": [
"2025-10-22",
"2026-10-21"
"2025-11-12",
"2026-11-11"
],
"regions": 32,
"samples": 11680,
@@ -20,14 +20,13 @@
13,
17,
22,
25,
28,
30,
32,
34,
26,
29,
31,
33,
35,
36,
37,
37,
38,
38,
39,
@@ -37,23 +36,24 @@
41,
42,
42,
43,
43,
44,
45,
45,
46,
46,
47,
50,
50,
50,
50,
50,
50,
50,
50,
48,
48,
49,
49,
49,
50,
50,
51,
51,
51,
51,
52,
54,
53,
57,
61,
62,
@@ -69,7 +69,6 @@
64,
64,
64,
64,
65,
65,
65,
@@ -77,7 +76,6 @@
66,
66,
66,
66,
67,
67,
67,
@@ -86,16 +84,18 @@
68,
69,
69,
69,
70,
70,
71,
72,
73,
74,
74,
75,
76,
77,
78,
79,
80,
81,
83,
85,
+27
View File
@@ -1,5 +1,6 @@
import re
from datetime import date, datetime, timedelta
from typing import Optional
import httpx
@@ -9,6 +10,7 @@ from services.external.data_go_kr import get_all_items
VILAGE_URL = "https://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst"
ULTRA_URL = "https://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getUltraSrtFcst"
NCST_URL = "https://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getUltraSrtNcst"
WARNING_URL = "https://apis.data.go.kr/1360000/WthrWrnInfoService/getPwnCd"
_SKY = {"1": Sky.CLEAR, "3": Sky.PARTLY, "4": Sky.CLOUDY}
# 단기예보 0~4, 초단기예보는 5 빗방울 · 6 빗방울눈날림 · 7 눈날림이 더 있다
@@ -40,6 +42,12 @@ async def fetch_ultra(client: httpx.AsyncClient, nx: int, ny: int, base: datetim
return await get_all_items(client, ULTRA_URL, params, page_size=100)
async def fetch_ncst(client: httpx.AsyncClient, nx: int, ny: int, base: datetime) -> list[dict]:
base = base.astimezone(KST)
params = {"dataType": "JSON", "base_date": base.strftime("%Y%m%d"), "base_time": base.strftime("%H%M"), "nx": nx, "ny": ny}
return await get_all_items(client, NCST_URL, params, page_size=100)
async def fetch_warning_events(client: httpx.AsyncClient, since: datetime, until: datetime) -> list[dict]:
params = {"dataType": "JSON", "fromTmFc": since.astimezone(KST).strftime("%Y%m%d"), "toTmFc": until.astimezone(KST).strftime("%Y%m%d")}
return await get_all_items(client, WARNING_URL, params)
@@ -91,6 +99,25 @@ def parse_ultra(items: list[dict]) -> list[dict]:
]
_NCST_FIELDS = ("PTY", "RN1", "T1H", "REH", "WSD")
_MISSING = 900 # 가이드: +900 이상, -900 이하 값은 결측
def parse_ncst(items: list[dict]) -> Optional[dict]:
"""초단기실황: 지금 관측한 비 형태·1시간 강수량·기온·습도·풍속. 하나라도 없거나 결측이면 None."""
v = {it["category"]: it["obsrValue"] for it in items}
if not all(k in v for k in _NCST_FIELDS):
return None
try:
nums = {k: float(v[k]) for k in ("RN1", "T1H", "REH", "WSD")}
rain_type = _PTY[v["PTY"]]
except (ValueError, KeyError):
return None
if any(abs(n) >= _MISSING for n in nums.values()):
return None
return {"rain_type": rain_type, "rain_mm": nums["RN1"], "temp_c": nums["T1H"], "humidity": round(nums["REH"]), "wind_ms": nums["WSD"]}
_ACTIVE_COMMANDS = {1, 3, 6, 7}
+27 -1
View File
@@ -1,5 +1,5 @@
import asyncio
from datetime import datetime, timedelta, timezone
from datetime import date, datetime, timedelta, timezone
import httpx
@@ -87,6 +87,32 @@ async def _fetch_weather_chunk(client: httpx.AsyncClient, points: list[tuple[flo
return await _get_forecast(client, params, len(points))
async def fetch_snow(client: httpx.AsyncClient, points: list[tuple[float, float]], days: int = 7) -> list[dict]:
"""좌표마다 날짜별(한국 날짜) 눈 오는 양 (모델 지정 없음). 응답 순서는 좌표 순서와 같다."""
chunks = [points[i:i + _CHUNK] for i in range(0, len(points), _CHUNK)]
async def all_chunks() -> list[dict]:
results = await asyncio.gather(*[_fetch_snow_chunk(client, c, days) for c in chunks])
return [d for r in results for d in r]
return await guarded("openmeteo:snow", all_chunks, OpenMeteoRequestFailed, _BUDGET_SEC)
async def _fetch_snow_chunk(client: httpx.AsyncClient, points: list[tuple[float, float]], days: int) -> list[dict]:
params = {
"latitude": ",".join(f"{lat:.2f}" for lat, _ in points),
"longitude": ",".join(f"{lon:.2f}" for _, lon in points),
"daily": "snowfall_sum", "forecast_days": days, "timezone": "Asia/Seoul",
}
return await _get_forecast(client, params, len(points))
def parse_snow(data: dict) -> list[tuple[date, float]]:
"""날짜별 눈 오는 양(cm). 값이 없는 날은 뺀다."""
d = data["daily"]
return [(date.fromisoformat(t), float(v)) for t, v in zip(d["time"], d["snowfall_sum"]) if v is not None]
def parse_clouds(point: tuple[float, float], data: dict) -> list[dict]:
lat, lon = round(point[0], 2), round(point[1], 2)
h = data["hourly"]
+53 -26
View File
@@ -11,9 +11,9 @@ from common.cache.lock import redis_lock
from common.cache.redis_client import REDIS
from common.database.db_session_manager import DB_SESSION_MNG
from common.database.model.models import Article, CardSet, IndexScore, OpenMeteoHourly, Post, Region, WeatherHourly
from common.enums import AirGrade, ArticleCategory, ErrorType, PostType, RainType, RefType, Sky, SkyGrade, SkySituation, SkyType, WarningType
from common.enums import AirGrade, ArticleCategory, ErrorType, EventKind, PostType, RainType, RefType, Sky, SkyGrade, SkySituation, SkyType, WarningType
from common.logger import LOG
from common.utils.kma_time import KST, ULTRA_DELAY, kst_midnight, latest_ultra_base, next_vilage_available, now_kst
from common.utils.kma_time import KST, NCST_DELAY, ULTRA_DELAY, kst_midnight, latest_ncst_base, latest_ultra_base, next_vilage_available, now_kst
from common.utils.text import compass, day_range, hour_label, short_day
from crud.card_crud import CardCRUD
from crud.feed_crud import FeedCRUD
@@ -22,7 +22,7 @@ from crud.season_crud import SeasonCRUD
from crud.weather_crud import WeatherCRUD
from router.v1.feed.protocol import (
BandArticle, BandEvent, Bands, Cut, GakSlide, Hero, HeroStat, HeroTomorrow, HourCell, HoursSlide, ImageSlide, PostData, PostReaction, Res_Feed, Row, RowsSlide, SunsetSlide,
PlanSlide, PlanStep, TopIndex, WeatherWhy, WeekDay, WeekGak, WeekSlide,
PlanSlide, PlanStep, TomorrowEvent, TopIndex, WeatherWhy, WeekDay, WeekGak, WeekSlide,
)
from router.v1.index.protocol import TrendPoint
from services.air_service import GRADE_LABEL as AIR_GRADE_LABEL
@@ -38,11 +38,14 @@ from services.index_service import IndexBoard, IndexItem, IndexService, slot_lab
from services.now_service import NowService, NowWeather
from services.season_service import SeasonService
from services.sky_service import SkyService, SkyView, day_verdict
from services.weather_service import TodayWeather, WeatherService
from services.week_service import DayPlan, EventItem, WeekService, image_credit, mix_kinds
from services.weather_service import TodayWeather, WeatherService, observed_now, with_observed
from services.week_service import DayPlan, EventItem, WeekService, event_sidos, image_credit, mix_kinds
from services.weekend_plan import day_plan, forecast, pick_events
from services.weekend_rank import TripPick, WeekendRank, pick_trip, weekend_days
# 행사 포스트: 축제는 전부, 팝업·전시·콘서트는 종류마다 이만큼. 자리는 _EVENT_SLOTS 개까지
_EVENT_OTHERS = 2
_EVENT_SLOTS = 40
# 그날 피드 카드: (번호, 종류, 참조, 지수 순위). 03:00 에 전부 만들고, 볼 때 시간대에 따라 켜고 끄고 순서를 정한다 (docs/서비스_동작_안내.md).
LINEUP = [
(1, PostType.WEATHER, RefType.NONE, None),
@@ -70,6 +73,7 @@ LINEUP = [
(23, PostType.FOLIAGE, RefType.NONE, None),
(24, PostType.EVENTS_BAND, RefType.NONE, None),
(25, PostType.SEASON_BAND, RefType.NONE, None),
*((22 + rank, PostType.EVENT, RefType.NONE, rank) for rank in range(4, _EVENT_SLOTS + 1)),
]
# 피드 목록 대신 히어로·오늘의 각·단풍 지도·띠에 좋아요·댓글만 붙는 자리
_PINNED = {
@@ -169,13 +173,13 @@ def feed_day(now: datetime) -> date:
def feed_ttl_sec(now: datetime, sunset_at: datetime) -> int:
"""다음에 피드가 달라지는 시각까지. 시간대 경계·일몰(노을 카드가 내일 것으로)·03:00·예보·초단기예보·미세먼지 갱신·정각(지금 구간이 줄어듦) 중 가장 빠른 쪽."""
"""다음에 피드가 달라지는 시각까지. 시간대 경계·일몰(노을 카드가 내일 것으로)·03:00·예보·초단기예보·초단기실황·미세먼지 갱신·정각(지금 구간이 줄어듦) 중 가장 빠른 쪽."""
day = now.date()
at = lambda d, h: datetime.combine(d, time(h), tzinfo=KST) # noqa: E731
sunset = sunset_at.astimezone(KST)
changes = [at(day, _FEED_DAY_START), at(day, 5), at(day, 11), sunset - timedelta(hours=2), sunset, sunset + NIGHT_AFTER_SUNSET,
at(day + timedelta(days=1), _FEED_DAY_START), next_vilage_available(now), latest_ultra_base(now) + timedelta(hours=1) + ULTRA_DELAY,
now.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1)]
latest_ncst_base(now) + timedelta(hours=1) + NCST_DELAY, now.replace(minute=0, second=0, microsecond=0) + timedelta(hours=1)]
air = now.replace(minute=20, second=0, microsecond=0)
changes.append(air if air > now else air + timedelta(hours=1))
nxt = min(c for c in changes if c > now)
@@ -237,9 +241,12 @@ def arrange(cards: list[PostData], slot: str, now: datetime, sunset_at: datetime
rest = [c for c in rest if c.post_type is not PostType.QUOTE] + [c for c in rest if c.post_type is PostType.QUOTE]
events = pool.get(PostType.EVENT, [])
front = range(1, max(1, len(rest) // 2 + 1))
gaps = sorted(random.Random(seed).sample(front, min(len(events), len(front))), reverse=True)
# 앞쪽 절반에 다 못 들어가면 끝까지 한 장씩 걸러 끼우고, 그래도 남은 행사는 맨 뒤에
gaps = (sorted(random.Random(seed).sample(front, len(events)), reverse=True) if len(events) <= len(front)
else list(range(min(len(events), len(rest)), 0, -1)))
for gap, e in zip(gaps, reversed(events[:len(gaps)])):
rest.insert(gap, e)
rest += events[len(gaps):]
# 카드뉴스(관리자가 올린 것)는 날씨 바로 아래, 같은 날 두 번째부터는 피드 중간쯤
cards = pool.get(PostType.CARD, [])
for i, card in enumerate(cards[1:]):
@@ -255,24 +262,24 @@ def _by_position(posts: list[Post]) -> list[Post]:
return list(out.values())
def _tomorrow_best(board: IndexBoard, day: date) -> Optional[tuple[IndexItem, IndexScore]]:
"""내일 하루 점수로 1위인 각과 그 점수 (동점이면 중요도 순)."""
best = None
for i in board.items:
s = next((x for x in i.trend if x.score_date == day), None)
if s is not None and (best is None or rank_score(s.score, i.definition.priority) > rank_score(best[1].score, best[0].definition.priority)):
best = (i, s)
return best
def _tomorrow_ranked(board: IndexBoard, day: date) -> list[tuple[IndexItem, IndexScore]]:
"""내일 하루 점수 순으로 제철 각과 그 점수 (동점이면 중요도 순)."""
scored = [(i, s) for i in board.items if i.in_season for s in i.trend if s.score_date == day]
return sorted(scored, key=lambda x: rank_score(x[1].score, x[0].definition.priority), reverse=True)
def tomorrow_events(items: list[EventItem], region_code: str, day: date) -> list[TomorrowEvent]:
"""그날 열리는 같은 시도 행사 3개 (종류를 섞어서)."""
on = [e for e in items if e.event.sido_code in event_sidos(region_code) and e.event.start_date <= day <= e.event.end_date]
return [TomorrowEvent(event_id=e.event.event_id, name=e.event.name, place=e.event.place_name, icon=e.event.icon,
start_date=e.event.start_date, end_date=e.event.end_date) for e in mix_kinds(on)[:3]]
def _hero_tomorrow(day: date, board: IndexBoard) -> HeroTomorrow:
best = _tomorrow_best(board, day)
top1 = None
if best is not None:
d, s = best[0].definition, best[1]
top1 = TopIndex(index_id=d.index_id, code=d.code, name=d.name, icon=d.icon, score=s.score, rank=1, summary=s.summary)
ranked = [TopIndex(index_id=i.definition.index_id, code=i.definition.code, name=i.definition.name, icon=i.definition.icon, score=s.score,
rank=n, summary=s.summary) for n, (i, s) in enumerate(_tomorrow_ranked(board, day)[:5], 1)]
return HeroTomorrow(
day=day, weather_slots=board.tomorrow_slots, top1=top1,
day=day, weather_slots=board.tomorrow_slots, top1=ranked[0] if ranked else None, ranked=ranked,
weather_why={k: [WeatherWhy(label=w.label, weight=w.weight, score=w.score, note=w.note) for w in ws] for k, ws in board.tomorrow_why.items()},
)
@@ -400,6 +407,10 @@ class FeedService:
_, hourly = await DB_SESSION_MNG.execute_lambda(
lambda s: self.weather_crud.hourly_between(s, region.code, hour, kst_midnight(now.date() + timedelta(days=2)))
)
hourly = hourly or []
if (observed := await observed_now(region, now)) is not None: # 히어로의 지금은 관측값
overlay = with_observed({h.forecast_at: h for h in hourly}, observed)
hourly = [overlay[h.forecast_at] for h in hourly]
_, posts = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.day(s, day, [NATIONAL_SCOPE, sido_of(region.code)]))
posts = _by_position(posts or [])
card_ids = [p.ref_id for p in posts if PostType(p.post_type) is PostType.CARD and p.ref_id is not None]
@@ -429,9 +440,12 @@ class FeedService:
has_warning = bool(now_w and now_w.warnings)
# 오늘 이야기 줄엔 제철인 각만 (철 지난 각은 각 탭 목록 끝에만)
items = [i for i in board.items if i.in_season] if board else []
hero = self._hero(now, slot, hourly[0] if hourly else None, now_w, board, today, await self._uv(region.code, hour), _moon_view(region, now, hourly or []))
if hero.tomorrow is not None:
hero.tomorrow.events = tomorrow_events(events, region.code, hero.tomorrow.day)
feed = Res_Feed(
region_code=region.code, region_name=region.name, slot=slot,
hero=self._hero(now, slot, hourly[0] if hourly else None, now_w, board, today, await self._uv(region.code, hour), _moon_view(region, now, hourly or [])),
hero=hero,
stories=[_top(i) for i in items], posts=arrange(cards, slot, now, sunset_at, has_warning, f"{day}:{region.code}"), **pinned,
bands=Bands(
events=[BandEvent(event_id=e.event.event_id, name=e.event.name, status_label=e.status_label, icon=e.event.icon,
@@ -537,7 +551,7 @@ class FeedService:
slides=[RowsSlide(kind="rows", eyebrow=_CATEGORY_META[a.category], line=a.body[0], icon=a.icon, image=a.image_url, image_credit=a.image_credit)],
share_messages=[a.title])
if t is PostType.EVENT:
soon = mix_kinds([e for e in c.events if e.event.start_date <= c.now.date() + timedelta(days=7) and e.event.end_date >= c.now.date()])
soon = feed_events([e for e in c.events if e.event.start_date <= c.now.date() + timedelta(days=7) and e.event.end_date >= c.now.date()])
rank = p.index_rank or 1
if len(soon) < rank:
return None
@@ -757,8 +771,9 @@ class FeedService:
def _tomorrow(self, base: dict, c: "_Ctx") -> PostData:
rows = [Row(label=x.label, value=x.text) for x in c.now_w.commute]
best = _tomorrow_best(c.board, c.now.date() + timedelta(days=1)) if c.board else None
if best is not None:
ranked = _tomorrow_ranked(c.board, c.now.date() + timedelta(days=1)) if c.board else []
if ranked:
best = ranked[0]
rows.append(Row(label="내일 1위 각", value=f"{best[0].definition.name} {best[1].score}점"))
caption = _temp_change(c.today, c.tomorrow) or "출근 전에 한 번 더 확인해 주세요."
icon = c.now_w.commute[0].icon if c.now_w.commute else "sun"
@@ -811,6 +826,18 @@ def _temp_change(today: Optional[TodayWeather], tomorrow: Optional[TodayWeather]
return f"내일 낮 최고 {round(highs[1])}°, 오늘보다 {abs(diff)}° {'더워요' if diff > 0 else '쌀쌀해요'}."
def feed_events(items: list[EventItem]) -> list[EventItem]:
"""피드에 포스트로 올릴 행사. 축제는 전부, 다른 종류는 받은 순서대로 _EVENT_OTHERS 개씩 골라 종류를 돌아가며 섞는다."""
taken: dict[int, int] = {}
picked = []
for e in items:
n = taken.get(e.event.kind, 0)
if e.event.kind == EventKind.FESTIVAL or n < _EVENT_OTHERS:
picked.append(e)
taken[e.event.kind] = n + 1
return mix_kinds(picked)
def _event_caption(e: EventItem) -> str:
"""진행 상태·거리·그날 날씨 중 있는 것. 다 없으면 일정 확정 여부."""
parts = ["지금 진행 중" if e.status == "live" else e.status_label]
+48
View File
@@ -0,0 +1,48 @@
{
"source": "기상청 「계절관측지침(2026.4.)」 부록 기후계절 평년값(1991~2020년) 첫눈. 북춘천은 춘천, 북강릉은 강릉으로 적음. 먼 섬(백령도·울릉도·흑산도)과 평년 첫눈이 해를 넘기는 거제(1/14)는 뺌",
"basis": "normal 은 평년 첫눈 날짜(월-일). lat·lon 은 그 도시의 대략 위치(지도에 찍고 눈 예보를 받는 자리). top 은 처음 화면에 이름까지 보이는 대표 지점",
"spots": [
{ "name": "서울", "region": "서울", "lat": 37.57, "lon": 126.97, "normal": "11-20", "top": true },
{ "name": "인천", "region": "인천", "lat": 37.48, "lon": 126.62, "normal": "11-23" },
{ "name": "수원", "region": "경기", "lat": 37.27, "lon": 126.99, "normal": "11-21" },
{ "name": "파주", "region": "경기", "lat": 37.89, "lon": 126.77, "normal": "11-20" },
{ "name": "이천", "region": "경기", "lat": 37.26, "lon": 127.48, "normal": "11-20" },
{ "name": "철원", "region": "강원", "lat": 38.15, "lon": 127.3, "normal": "11-18" },
{ "name": "춘천", "region": "강원", "lat": 37.95, "lon": 127.75, "normal": "11-21", "top": true },
{ "name": "원주", "region": "강원", "lat": 37.34, "lon": 127.95, "normal": "11-21" },
{ "name": "대관령", "region": "강원", "lat": 37.68, "lon": 128.72, "normal": "11-05", "top": true },
{ "name": "속초", "region": "강원", "lat": 38.25, "lon": 128.56, "normal": "12-10" },
{ "name": "강릉", "region": "강원", "lat": 37.8, "lon": 128.86, "normal": "12-07", "top": true },
{ "name": "동해", "region": "강원", "lat": 37.51, "lon": 129.12, "normal": "12-11" },
{ "name": "태백", "region": "강원", "lat": 37.17, "lon": 128.99, "normal": "11-10" },
{ "name": "서산", "region": "충남", "lat": 36.78, "lon": 126.49, "normal": "11-20" },
{ "name": "천안", "region": "충남", "lat": 36.78, "lon": 127.12, "normal": "11-19" },
{ "name": "보령", "region": "충남", "lat": 36.33, "lon": 126.56, "normal": "11-22" },
{ "name": "청주", "region": "충북", "lat": 36.64, "lon": 127.44, "normal": "11-23" },
{ "name": "충주", "region": "충북", "lat": 36.97, "lon": 127.95, "normal": "11-24" },
{ "name": "추풍령", "region": "충북", "lat": 36.22, "lon": 127.99, "normal": "11-17" },
{ "name": "대전", "region": "대전", "lat": 36.37, "lon": 127.37, "normal": "11-20", "top": true },
{ "name": "전주", "region": "전북", "lat": 35.82, "lon": 127.15, "normal": "11-29", "top": true },
{ "name": "군산", "region": "전북", "lat": 36.0, "lon": 126.76, "normal": "11-26" },
{ "name": "남원", "region": "전북", "lat": 35.41, "lon": 127.33, "normal": "11-24" },
{ "name": "광주", "region": "광주", "lat": 35.17, "lon": 126.89, "normal": "11-29", "top": true },
{ "name": "목포", "region": "전남", "lat": 34.82, "lon": 126.38, "normal": "11-29" },
{ "name": "순천", "region": "전남", "lat": 35.02, "lon": 127.37, "normal": "11-24" },
{ "name": "여수", "region": "전남", "lat": 34.74, "lon": 127.74, "normal": "12-13" },
{ "name": "완도", "region": "전남", "lat": 34.4, "lon": 126.7, "normal": "12-08" },
{ "name": "안동", "region": "경북", "lat": 36.57, "lon": 128.71, "normal": "11-29" },
{ "name": "구미", "region": "경북", "lat": 36.13, "lon": 128.32, "normal": "11-30" },
{ "name": "울진", "region": "경북", "lat": 36.99, "lon": 129.41, "normal": "12-09" },
{ "name": "포항", "region": "경북", "lat": 36.03, "lon": 129.38, "normal": "12-18" },
{ "name": "대구", "region": "대구", "lat": 35.88, "lon": 128.62, "normal": "12-05", "top": true },
{ "name": "거창", "region": "경남", "lat": 35.67, "lon": 127.91, "normal": "12-13" },
{ "name": "진주", "region": "경남", "lat": 35.16, "lon": 128.04, "normal": "12-18" },
{ "name": "창원", "region": "경남", "lat": 35.17, "lon": 128.57, "normal": "12-27" },
{ "name": "통영", "region": "경남", "lat": 34.85, "lon": 128.44, "normal": "12-27" },
{ "name": "울산", "region": "울산", "lat": 35.56, "lon": 129.32, "normal": "12-24" },
{ "name": "부산", "region": "부산", "lat": 35.1, "lon": 129.03, "normal": "12-23", "top": true },
{ "name": "제주", "region": "제주", "lat": 33.51, "lon": 126.53, "normal": "12-10", "top": true },
{ "name": "서귀포", "region": "제주", "lat": 33.25, "lon": 126.57, "normal": "12-20" },
{ "name": "성산", "region": "제주", "lat": 33.39, "lon": 126.88, "normal": "12-13" }
]
}
+76
View File
@@ -0,0 +1,76 @@
import json
from dataclasses import dataclass
from datetime import date, datetime
from pathlib import Path
from typing import Optional
import httpx
from redis.exceptions import RedisError
from common.cache.redis_client import REDIS
from common.logger import LOG
from common.utils.kma_time import KST
from services.external.open_meteo import OpenMeteoRequestFailed, fetch_snow, parse_snow
# 지점별 평년 첫눈 날짜 (기상청 계절관측지침, 1991~2020). 출처·기준은 파일 안에 적혀 있다
SPOTS: list[dict] = json.loads((Path(__file__).parent / "first_snow.json").read_text(encoding="utf-8"))["spots"]
_DAYS = 7
# 하루 눈 오는 양이 이만큼(cm)은 돼야 '눈 예보'로 친다 (0 에 가까운 값은 뺀다)
_MIN_CM = 0.1
# 눈 예보는 3시간에 한 번만 받는다. 첫 사용자가 볼 때 받아 Redis 에 둔다
_KEY = "firstsnow:forecast"
_TTL_SEC = 3 * 3600
@dataclass
class SnowSpot:
name: str
region: str
lat: float
lon: float
normal: str
top: bool
snow_date: Optional[date] = None
snow_cm: Optional[float] = None
def first_snow_day(days: list[tuple[date, float]], today: date) -> Optional[tuple[date, float]]:
"""오늘부터 눈 예보가 있는 첫 날과 그날 양. 없으면 None."""
return next(((d, cm) for d, cm in sorted(days) if d >= today and cm >= _MIN_CM), None)
class FirstSnowService:
async def spots(self, now: datetime) -> tuple[bool, list[SnowSpot]]:
"""(눈 예보를 받았는지, 지점 목록). 예보를 못 받아도 평년 날짜는 돌려준다."""
forecast = await self._forecast()
today = now.astimezone(KST).date()
out = []
for s in SPOTS:
hit = first_snow_day(forecast[s["name"]], today) if forecast and s["name"] in forecast else None
out.append(SnowSpot(
name=s["name"], region=s["region"], lat=s["lat"], lon=s["lon"], normal=s["normal"], top=bool(s.get("top")),
snow_date=hit[0] if hit else None, snow_cm=round(hit[1], 1) if hit else None,
))
return forecast is not None, out
async def _forecast(self) -> Optional[dict[str, list[tuple[date, float]]]]:
"""지점 이름 → 날짜별 눈 오는 양. Redis 에 있으면 그것을, 없으면 Open-Meteo 에서 받아 둔다. 못 받으면 None."""
try:
cached = await REDIS.conn.get(_KEY)
if cached:
return {name: [(date.fromisoformat(d), cm) for d, cm in days] for name, days in json.loads(cached).items()}
except RedisError as e:
LOG.error(f"[first_snow] cache read: {e}")
try:
async with httpx.AsyncClient(timeout=10) as client:
data = await fetch_snow(client, [(s["lat"], s["lon"]) for s in SPOTS], _DAYS)
except OpenMeteoRequestFailed as e:
LOG.error(f"[first_snow] {e}")
return None
forecast = {s["name"]: parse_snow(d) for s, d in zip(SPOTS, data)}
try:
await REDIS.conn.set(_KEY, json.dumps({name: [[d.isoformat(), cm] for d, cm in days] for name, days in forecast.items()}), ex=_TTL_SEC)
except RedisError as e:
LOG.error(f"[first_snow] cache write: {e}")
return forecast
+31 -13
View File
@@ -11,7 +11,7 @@ from fastapi import Depends
from common.database.db_session_manager import DB_SESSION_MNG
from common.database.model.models import IndexDefinition, IndexScore, OpenMeteoHourly, Region, WeatherDaily, WeatherHourly
from common.enums import AirGrade, ErrorType, RainType, Sky, SkyType, WarningType
from common.utils.kma_time import KST, ULTRA_DELAY, kst_midnight, latest_ultra_base, now_kst
from common.utils.kma_time import KST, NCST_DELAY, ULTRA_DELAY, kst_midnight, latest_ultra_base, now_kst
from crud.index_crud import IndexCRUD
from crud.region_crud import RegionCRUD
from crud.sky_crud import SkyCRUD
@@ -19,12 +19,12 @@ from crud.weather_crud import WeatherCRUD
from crud.week_crud import WeekCRUD
from services.air_service import GRADE_LABEL, AirService
from services.calc.day_slot import NIGHT_END_HOUR, SLOTS, slot_hours, slot_of
from services.calc.index_calc import AXES, Context, DayForecast, Hour, Result, estimate, evaluate, priority_score, rank_score
from services.calc.index_calc import AXES, Context, DayForecast, Hour, Result, estimate, evaluate, priority_score, rank_score, summary_line
from services.calc.moon import night, up_ratio, view_line
from services.calc.sun import sun_times
from services.external.open_meteo import is_dark_slot
from services.warning_service import WarningService
from services.weather_service import WeatherService, ultra_hours, with_ultra_rain
from services.weather_service import WeatherService, observed_now, ultra_hours, with_observed, with_ultra_rain
# 시간별 예보로 늘 계산하는 날 수 (오늘~모레). 이번 주말은 시간별 예보가 없으면 중기예보로 예상 점수를 낸다.
DAYS = 3
@@ -119,6 +119,7 @@ def _hour(r: WeatherHourly) -> Hour:
return Hour(
hour=r.forecast_at.astimezone(KST).hour, feels_c=float(r.feels_c), rain_type=RainType(r.rain_type), rain_prob=r.rain_prob,
wind_ms=float(r.wind_ms) if r.wind_ms is not None else None, humidity=r.humidity, sky=Sky(r.sky),
observed=getattr(r, "observed", False), # with_observed 가 실황으로 바꾼 행에만 붙인다
)
@@ -240,19 +241,32 @@ def slot_results(
"""각 구간의 날씨로 평가한다. 활동 시간대와 안 겹쳐도 계산하되 시간 요소는 0점. now 가 있으면 현재 구간은 남은 시각만 본다."""
hours_by_slot = slot_hours(day, sunset_at)
hours_by_slot[EARLY] = set(range(NIGHT_END_HOUR))
if now:
_trim_passed(hours_by_slot, day, sunset_at, now)
cur = _trim_passed(hours_by_slot, day, sunset_at, now) if now else None
# 화면이 지금 구간으로 보여 주는 칸. 구간 경계 직전(예: 낮이 15:20 에 끝나는데 15시 행은 저녁 칸)에는 cur 와 다를 수 있다
shown = current_slot(now, sunset_at) if now else None
now_hour = int((now - kst_midnight(day)).total_seconds() // 3600) if now else None
activity = [{h % 24 for h in w} for w in window_hours(defn, day, region)]
rest_of_day = defn.factor_rules["rain"].get("span") == "rest_of_day"
out = {}
for key, hours in hours_by_slot.items():
if not hours:
continue
matches = any(any(h % 24 in w for h in hours) for w in activity)
# 시간대 일치 여부와 날씨 평가를 분리해 하루 점수로 대체하지 않는다.
window = SimpleNamespace(windows=[{"from": min(hours), "to": max(hours) + 1}])
windows = windows_for(window, day, region, by_at, by_om, only=hours)
result = evaluate(defn, windows, replace(ctx, time_matches=matches))
# 우산각은 구간이 아니라 그 구간 시작(화면이 보여 주는 지금 구간은 지금)부터 자정까지의 비를 본다.
if rest_of_day:
seen = set(range(now_hour if key == shown else min(hours), 24))
else:
seen = hours
window = SimpleNamespace(windows=[{"from": min(seen), "to": max(seen) + 1}])
windows = windows_for(window, day, region, by_at, by_om, only=seen)
# 지금 시각의 예보 행이 있을 때만 '지금'이다 (없으면 첫 행은 더 뒤 시각이다)
at_now = key == shown and bool(windows and windows[0]) and windows[0][0].hour == now_hour
result = evaluate(defn, windows, replace(ctx, time_matches=matches, at_now=at_now))
if result is not None:
# 지금 구간 줄은 남은 시간의 가운데가 아니라 지금 시각 날씨로
if (key == cur or (rest_of_day and key == shown)) and windows and windows[0]:
result.summary = summary_line(windows[0][0])
out[key] = result
return out
@@ -411,7 +425,9 @@ class IndexService:
if region is None:
return ErrorType.NOT_FOUND, None
now = now_kst()
_, _, ultra = await asyncio.gather(self.weather_service.ensure_vilage(region, now), self.air_service.ensure(now), ultra_hours(region, now))
_, _, ultra, observed = await asyncio.gather(
self.weather_service.ensure_vilage(region, now), self.air_service.ensure(now), ultra_hours(region, now), observed_now(region, now),
)
today = now.date()
start = kst_midnight(today)
err, rows = await DB_SESSION_MNG.execute_lambda(lambda s: self.weather.hourly_between(s, region.code, start - timedelta(days=1), start + timedelta(days=2)))
@@ -420,7 +436,7 @@ class IndexService:
if not rows:
return ErrorType.EXTERNAL_API_ERROR, None
air = await self.air_service.nearest(region)
by_at = with_ultra_rain({r.forecast_at: r for r in rows}, ultra)
by_at = with_observed(with_ultra_rain({r.forecast_at: r for r in rows}, ultra), observed)
ctx = Context(
day=today, is_holiday=False, moon=0, sunset_score=None, lookahead_rain_prob=0, rain_hours=rain_hours(by_at, today), wind_warning=False,
pm25=air.pm25 if air else None, air_label=GRADE_LABEL[AirGrade(air.grade)] if air and air.grade else None,
@@ -435,9 +451,9 @@ class IndexService:
async def ensure(self, region: Region, now: datetime) -> tuple[ErrorType, Optional[dict[date, dict[str, Result]]]]:
"""재료(예보·미세먼지)가 지수 계산 뒤에 바뀌었으면 오늘~모레와 이번 주말을 다시 계산한다. 오늘·내일 구간별 날씨 점수도 같이 낸다."""
_, _, _, warnings, ultra = await asyncio.gather(
_, _, _, warnings, ultra, observed = await asyncio.gather(
self.weather_service.ensure_vilage(region, now), self.weather_service.ensure_mid(region, now), self.air_service.ensure(now),
self.warning_service.for_region(region, now), ultra_hours(region, now, wait=True),
self.warning_service.for_region(region, now), ultra_hours(region, now, wait=True), observed_now(region, now, wait=True),
)
today = now.date()
start = kst_midnight(today)
@@ -456,7 +472,7 @@ class IndexService:
)
by_om = {r.forecast_at: r for r in om_rows} if om_err is ErrorType.SUCCESS else {}
air = await self.air_service.nearest(region)
by_at = with_ultra_rain({r.forecast_at: r for r in rows}, ultra)
by_at = with_observed(with_ultra_rain({r.forecast_at: r for r in rows}, ultra), observed)
base_ctx = dict(
pm25=air.pm25 if air else None,
air_label=GRADE_LABEL[AirGrade(air.grade)] if air and air.grade else None,
@@ -478,6 +494,8 @@ class IndexService:
inputs_at = max(inputs_at, max(r.fetched_at for r in by_om.values()))
if ultra is not None:
inputs_at = max(inputs_at, latest_ultra_base(now) + ULTRA_DELAY)
if observed is not None:
inputs_at = max(inputs_at, observed.at + NCST_DELAY) # 새 시각 실황이 나오면 다시 계산
# 지금 구간은 지금 시각부터 보므로 정각마다 다시 계산
inputs_at = max(inputs_at, now.replace(minute=0, second=0, microsecond=0))
err, computed = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.last_computed(s, region.code, today))
+11 -5
View File
@@ -15,7 +15,7 @@ from crud.region_crud import RegionCRUD
from crud.weather_crud import WeatherCRUD
from services.air_service import GRADE_LABEL, AirService
from services.warning_service import WarningItem, WarningService
from services.weather_service import RainHour, WeatherService, ultra_hours
from services.weather_service import RainHour, WeatherService, observed_now, ultra_hours
_COMMUTE = (("내일 출근 8시", 8), ("내일 퇴근 7시", 19))
@@ -52,7 +52,13 @@ def _weather_word(rain: RainType, sky: Sky, rain_mm: float) -> tuple[str, str]:
return {Sky.CLEAR: ("sun", "맑음"), Sky.PARTLY: ("sun_cloud", "구름 많음"), Sky.CLOUDY: ("cloud", "흐림")}[sky]
def _rain_2h_text(hours: list[RainHour]) -> tuple[bool, str]:
_NOW_WORD = {RainType.SNOW: "눈이", RainType.SLEET: "진눈깨비가"}
def _rain_2h_text(hours: list[RainHour], now_rain: Optional[RainType] = None) -> tuple[bool, str]:
"""now_rain: 실황으로 관측한 지금 비 형태 (관측이 없으면 None). 지금 오는 중이면 앞으로의 예보보다 먼저 알린다."""
if now_rain is not None and now_rain is not RainType.NONE:
return True, f"지금 {_NOW_WORD.get(now_rain, '비가')} 와요. 우산 챙기세요"
rainy = [h for h in hours if h.rain_type is not RainType.NONE]
if not rainy:
return False, "앞으로 2시간, 우산 없어도 돼요"
@@ -98,9 +104,9 @@ class NowService:
return ErrorType.NOT_FOUND, None
now = now_kst()
ultra, _, _, warnings = await asyncio.gather(
ultra, _, _, warnings, observed = await asyncio.gather(
self._ultra(region, now), self.weather_service.ensure_vilage(region, now), self.air_service.ensure(now),
self.warning_service.for_region(region, now),
self.warning_service.for_region(region, now), observed_now(region, now),
)
tomorrow_start = kst_midnight(now.date() + timedelta(days=1))
err, next_rows = await DB_SESSION_MNG.execute_lambda(
@@ -115,7 +121,7 @@ class NowService:
hours = [h for h in hours if now < h.at <= now + timedelta(hours=2)]
if not hours and not next_rows:
return ErrorType.EXTERNAL_API_ERROR, None
will_rain, rain_text = _rain_2h_text(hours)
will_rain, rain_text = _rain_2h_text(hours, observed.rain_type if observed else None)
rain_from, tomorrow_text, commute = _tomorrow([r for r in next_rows if r.forecast_at >= tomorrow_start])
air = await self.air_service.nearest(region)
air_text = None
+28 -4
View File
@@ -13,6 +13,7 @@ from common.utils.kma_time import kst_midnight, now_kst
from crud.feed_crud import FeedCRUD
from crud.reaction_crud import ReactionCRUD
from crud.region_crud import RegionCRUD
from crud.talk_crud import TalkCRUD
from services.bot_comment import BOT_COLORS, BOT_NAMES
from services.level_service import award
from services.talk_service import _LINK, _PHONE
@@ -43,8 +44,10 @@ class SavedView:
class ReactionService:
def __init__(self, crud: ReactionCRUD = Depends(ReactionCRUD), feed: FeedCRUD = Depends(FeedCRUD), regions: RegionCRUD = Depends(RegionCRUD)) -> None:
self.crud, self.feed, self.regions = crud, feed, regions
def __init__(
self, crud: ReactionCRUD = Depends(ReactionCRUD), feed: FeedCRUD = Depends(FeedCRUD), regions: RegionCRUD = Depends(RegionCRUD), talks: TalkCRUD = Depends(TalkCRUD),
) -> None:
self.crud, self.feed, self.regions, self.talks = crud, feed, regions, talks
async def _post_exists(self, post_id: int) -> ErrorType:
err, post = await DB_SESSION_MNG.execute_lambda(lambda s: self.feed.get(s, post_id))
@@ -100,8 +103,9 @@ class ReactionService:
return CommentView(comment=c, nickname=f"{c.region_name} 익명" if c.region_name else "익명", character=ANON_CHARACTER, color=ANON_COLOR, mood=None, liked=liked, mine=mine)
return CommentView(comment=c, nickname=nickname or "", character=character or ANON_CHARACTER, color=color or ANON_COLOR, mood=mood, liked=liked, mine=c.user_id == who.user_id)
async def comments(self, post_id: int, user: Optional[User], ip_hash: str, cursor: Optional[int]) -> tuple[ErrorType, list[CommentView]]:
err, rows = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.comments(s, post_id, user.user_id if user else None, cursor, PAGE))
async def comments(self, post_id: Optional[int], user: Optional[User], ip_hash: str, cursor: Optional[int], talk_id: Optional[int] = None) -> tuple[ErrorType, list[CommentView]]:
"""포스트 댓글, talk_id 가 있으면 그 사람 글의 댓글."""
err, rows = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.comments(s, post_id, user.user_id if user else None, cursor, PAGE, talk_id))
if err is not ErrorType.SUCCESS:
return err, []
liked: set[int] = set()
@@ -146,6 +150,26 @@ class ReactionService:
await award(user.user_id, "react", f"comment:{c.comment_id}")
return err, self._view(c, user.nickname, user.character, user.color, user.mood, False, who)
async def add_talk_comment(self, talk_id: int, user: User, who: Liker, body: str) -> tuple[ErrorType, Optional[CommentView]]:
"""사람 글 댓글은 로그인한 사람만 쓴다. 글처럼 링크·전화번호는 막는다."""
body = body.strip()
if not body or len(body) > COMMENT_MAX:
return ErrorType.INVALID_INPUT, None
if user.terms_agreed_at is None:
return ErrorType.TERMS_REQUIRED, None
if _LINK.search(body) or _PHONE.search(body):
return ErrorType.LINK_NOT_ALLOWED, None
err, talk = await DB_SESSION_MNG.execute_lambda(lambda s: self.talks.get(s, talk_id))
if err is not ErrorType.SUCCESS:
return err, None
if talk is None or talk.hidden:
return ErrorType.NOT_FOUND, None
err, c = await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.add_comment(s, None, who, body, None, talk_id))
if c is None:
return err, None
await award(user.user_id, "react", f"comment:{c.comment_id}")
return err, self._view(c, user.nickname, user.character, user.color, user.mood, False, who)
async def delete_comment(self, comment_id: int, who: Liker) -> ErrorType:
err, ok = await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.delete_comment(s, comment_id, who))
if err is not ErrorType.SUCCESS:
+14 -3
View File
@@ -10,7 +10,10 @@ POSITION_POINTS = {
("year", "stem"): 10, ("year", "branch"): 10, ("month", "stem"): 10, ("month", "branch"): 30,
("day", "stem"): 10, ("day", "branch"): 20, ("hour", "stem"): 10, ("hour", "branch"): 10,
}
STRONG_FROM = 0.5 # 일간을 뺀 점수 중 비겁·인성 몫이 이 이상이면 신강
# 월령: 태어난 달의 오행. 일간 오행이 이와 같거나(왕) 달이 일간을 생하면(상) 득령. 강약은 득령을 먼저 본다
SEASON_ELEMENT = dict(zip("寅卯巳午申酉亥子辰戌丑未", "木木火火金金水水土土土土"))
DEUK_RYEONG_BONUS = 0.15 # 득령이면 돕는 몫에 더한다
STRONG_FROM, WEAK_BELOW = 0.55, 0.45 # (돕는 몫 + 득령 가산) 이 이상이면 신강, 미만이면 신약, 사이는 중화
@dataclass(frozen=True)
@@ -18,7 +21,12 @@ class Strength:
elements: dict[str, float] # 오행별 점수 (일간 포함), 木火土金水 순
top: str # 가장 센 오행
support: float # 일간을 뺀 점수 중 일간을 돕는 오행(같은 오행·생해 주는 오행) 몫 0~1
strong: bool
deuk_ryeong: bool
label: str # 신강 · 중화 · 신약
@property
def strong(self) -> bool:
return self.label == "신강"
def char_points(chart: Chart) -> list[tuple[str, str, str, float]]:
@@ -48,4 +56,7 @@ def chart_strength(chart: Chart) -> Strength:
support += points if el in helpers else 0.0
elements = {k: round(v, 1) for k, v in elements.items()}
ratio = round(support / others, 3)
return Strength(elements, max(elements, key=elements.get), ratio, ratio >= STRONG_FROM)
deuk = SEASON_ELEMENT[chart.month.branch] in helpers
judged = ratio + (DEUK_RYEONG_BONUS if deuk else 0.0)
label = "신강" if judged >= STRONG_FROM else "신약" if judged < WEAK_BELOW else "중화"
return Strength(elements, max(elements, key=elements.get), ratio, deuk, label)
+275
View File
@@ -0,0 +1,275 @@
{
"about": "검색 결과 제목·설명 새 문구를 쓰는 지역 페이지. 나머지는 예전 문구로 두고 클릭률을 비교한다. Search Console 페이지 노출(2026-10-07~27) 많은 순으로 오늘·내일 따로 줄 세워 ABBA 로 나눔",
"new": [
"today/busan/busanjin",
"today/busan/dong",
"today/busan/geumjeong",
"today/busan/gijang",
"today/busan/nam",
"today/busan/saha",
"today/busan/suyeong",
"today/busan/yeonje",
"today/chungbuk/boeun",
"today/chungbuk/eumseong",
"today/chungbuk/jeungpyeong",
"today/chungbuk/okcheon",
"today/chungnam/boryeong",
"today/chungnam/buyeo",
"today/chungnam/cheonan/dongnam",
"today/chungnam/cheongyang",
"today/chungnam/geumsan",
"today/chungnam/gongju",
"today/chungnam/seocheon",
"today/chungnam/seosan",
"today/daegu/buk",
"today/daegu/dalseo",
"today/daegu/gunwi",
"today/daegu/jung",
"today/daegu/suseong",
"today/daejeon/daedeok",
"today/daejeon/dong",
"today/daejeon/yuseong",
"today/gangwon/cheorwon",
"today/gangwon/donghae",
"today/gangwon/goseong",
"today/gangwon/hongcheon",
"today/gangwon/hwacheon",
"today/gangwon/pyeongchang",
"today/gangwon/samcheok",
"today/gangwon/wonju",
"today/gangwon/yanggu",
"today/gwangju/buk",
"today/gwangju/dong",
"today/gwangju/nam",
"today/gyeongbuk/andong",
"today/gyeongbuk/bonghwa",
"today/gyeongbuk/cheongdo",
"today/gyeongbuk/gimcheon",
"today/gyeongbuk/goryeong",
"today/gyeongbuk/gyeongsan",
"today/gyeongbuk/mungyeong",
"today/gyeongbuk/pohang",
"today/gyeongbuk/pohang/buk",
"today/gyeongbuk/uiseong",
"today/gyeongbuk/uljin",
"today/gyeongbuk/yeongdeok",
"today/gyeongbuk/yeongju",
"today/gyeonggi/anseong",
"today/gyeonggi/anyang",
"today/gyeonggi/anyang/dongan",
"today/gyeonggi/anyang/manan",
"today/gyeonggi/bucheon/sosa",
"today/gyeonggi/bucheon/wonmi",
"today/gyeonggi/gapyeong",
"today/gyeonggi/gimpo",
"today/gyeonggi/goyang/deogyang",
"today/gyeonggi/guri",
"today/gyeonggi/gwacheon",
"today/gyeonggi/hanam",
"today/gyeonggi/hwaseong/hyohaeng",
"today/gyeonggi/namyangju",
"today/gyeonggi/pocheon",
"today/gyeonggi/pyeongtaek",
"today/gyeonggi/seongnam",
"today/gyeonggi/seongnam/bundang",
"today/gyeonggi/seongnam/jungwon",
"today/gyeonggi/suwon/gwonseon",
"today/gyeonggi/suwon/jangan",
"today/gyeonggi/suwon/paldal",
"today/gyeonggi/suwon/yeongtong",
"today/gyeonggi/uiwang",
"today/gyeonggi/yangju",
"today/gyeonggi/yeoncheon",
"today/gyeonggi/yongin",
"today/gyeonggi/yongin/suji",
"today/gyeongnam/changnyeong",
"today/gyeongnam/changwon/jinhae",
"today/gyeongnam/changwon/masanhoewon",
"today/gyeongnam/geoje",
"today/gyeongnam/goseong",
"today/gyeongnam/hadong",
"today/gyeongnam/miryang",
"today/gyeongnam/namhae",
"today/gyeongnam/tongyeong",
"today/gyeongnam/uiryeong",
"today/incheon/ganghwa",
"today/incheon/geomdan",
"today/incheon/gyeyang",
"today/incheon/namdong",
"today/incheon/ongjin",
"today/incheon/seohae",
"today/jeju/jeju",
"today/jeju/seogwipo",
"today/jeonbuk/buan",
"today/jeonbuk/imsil",
"today/jeonbuk/jangsu",
"today/jeonbuk/jeongeup",
"today/jeonbuk/namwon",
"today/jeonbuk/sunchang",
"today/jeonbuk/wanju",
"today/jeonnam/gangjin",
"today/jeonnam/goheung",
"today/jeonnam/gurye",
"today/jeonnam/haenam",
"today/jeonnam/hampyeong",
"today/jeonnam/hwasun",
"today/jeonnam/jindo",
"today/jeonnam/mokpo",
"today/jeonnam/suncheon",
"today/jeonnam/wando",
"today/jeonnam/yeongam",
"today/sejong/sejong",
"today/seoul/dobong",
"today/seoul/dongdaemun",
"today/seoul/gangbuk",
"today/seoul/gangdong",
"today/seoul/geumcheon",
"today/seoul/guro",
"today/seoul/jongno",
"today/seoul/jung",
"today/seoul/jungnang",
"today/seoul/seocho",
"today/seoul/seodaemun",
"today/seoul/seongdong",
"today/seoul/yeongdeungpo",
"today/seoul/yongsan",
"today/ulsan/jung",
"today/ulsan/nam",
"today/ulsan/ulju",
"tomorrow/busan/gangseo",
"tomorrow/busan/geumjeong",
"tomorrow/busan/gijang",
"tomorrow/busan/jung",
"tomorrow/busan/sasang",
"tomorrow/busan/seo",
"tomorrow/busan/yeonje",
"tomorrow/chungbuk/cheongju",
"tomorrow/chungbuk/cheongju/heungdeok",
"tomorrow/chungbuk/danyang",
"tomorrow/chungbuk/goesan",
"tomorrow/chungbuk/jecheon",
"tomorrow/chungbuk/jincheon",
"tomorrow/chungbuk/yeongdong",
"tomorrow/chungnam/asan",
"tomorrow/chungnam/boryeong",
"tomorrow/chungnam/cheonan",
"tomorrow/chungnam/cheonan/dongnam",
"tomorrow/chungnam/cheonan/seobuk",
"tomorrow/chungnam/dangjin",
"tomorrow/chungnam/geumsan",
"tomorrow/chungnam/hongseong",
"tomorrow/chungnam/seocheon",
"tomorrow/chungnam/seosan",
"tomorrow/chungnam/taean",
"tomorrow/daegu/dong",
"tomorrow/daegu/gunwi",
"tomorrow/daegu/nam",
"tomorrow/daegu/suseong",
"tomorrow/daejeon/daedeok",
"tomorrow/daejeon/seo",
"tomorrow/gangwon/chuncheon",
"tomorrow/gangwon/hoengseong",
"tomorrow/gangwon/inje",
"tomorrow/gangwon/jeongseon",
"tomorrow/gangwon/samcheok",
"tomorrow/gangwon/sokcho",
"tomorrow/gangwon/taebaek",
"tomorrow/gangwon/wonju",
"tomorrow/gangwon/yeongwol",
"tomorrow/gwangju/buk",
"tomorrow/gwangju/gwangsan",
"tomorrow/gyeongbuk/cheongdo",
"tomorrow/gyeongbuk/cheongsong",
"tomorrow/gyeongbuk/goryeong",
"tomorrow/gyeongbuk/gumi",
"tomorrow/gyeongbuk/gyeongsan",
"tomorrow/gyeongbuk/sangju",
"tomorrow/gyeongbuk/seongju",
"tomorrow/gyeongbuk/ulleung",
"tomorrow/gyeongbuk/yeongju",
"tomorrow/gyeonggi/ansan",
"tomorrow/gyeonggi/ansan/sangnok",
"tomorrow/gyeonggi/anyang",
"tomorrow/gyeonggi/anyang/dongan",
"tomorrow/gyeonggi/bucheon/ojeong",
"tomorrow/gyeonggi/gimpo",
"tomorrow/gyeonggi/goyang",
"tomorrow/gyeonggi/gunpo",
"tomorrow/gyeonggi/guri",
"tomorrow/gyeonggi/gwangmyeong",
"tomorrow/gyeonggi/hanam",
"tomorrow/gyeonggi/hwaseong/hyohaeng",
"tomorrow/gyeonggi/namyangju",
"tomorrow/gyeonggi/paju",
"tomorrow/gyeonggi/pocheon",
"tomorrow/gyeonggi/seongnam/jungwon",
"tomorrow/gyeonggi/siheung",
"tomorrow/gyeonggi/suwon",
"tomorrow/gyeonggi/suwon/gwonseon",
"tomorrow/gyeonggi/suwon/yeongtong",
"tomorrow/gyeonggi/uijeongbu",
"tomorrow/gyeonggi/yangju",
"tomorrow/gyeonggi/yangpyeong",
"tomorrow/gyeonggi/yeoncheon",
"tomorrow/gyeonggi/yongin/cheoin",
"tomorrow/gyeonggi/yongin/suji",
"tomorrow/gyeongnam/changnyeong",
"tomorrow/gyeongnam/changwon/jinhae",
"tomorrow/gyeongnam/changwon/uichang",
"tomorrow/gyeongnam/geochang",
"tomorrow/gyeongnam/goseong",
"tomorrow/gyeongnam/haman",
"tomorrow/gyeongnam/hamyang",
"tomorrow/gyeongnam/hapcheon",
"tomorrow/gyeongnam/jinju",
"tomorrow/gyeongnam/namhae",
"tomorrow/gyeongnam/sacheon",
"tomorrow/gyeongnam/uiryeong",
"tomorrow/gyeongnam/yangsan",
"tomorrow/incheon/ganghwa",
"tomorrow/incheon/jemulpo",
"tomorrow/incheon/michuhol",
"tomorrow/incheon/seohae",
"tomorrow/jeju/jeju",
"tomorrow/jeonbuk/buan",
"tomorrow/jeonbuk/gimje",
"tomorrow/jeonbuk/gochang",
"tomorrow/jeonbuk/gunsan",
"tomorrow/jeonbuk/jangsu",
"tomorrow/jeonbuk/jeonju",
"tomorrow/jeonbuk/muju",
"tomorrow/jeonbuk/wanju",
"tomorrow/jeonnam/boseong",
"tomorrow/jeonnam/damyang",
"tomorrow/jeonnam/gangjin",
"tomorrow/jeonnam/gurye",
"tomorrow/jeonnam/haenam",
"tomorrow/jeonnam/jangseong",
"tomorrow/jeonnam/jindo",
"tomorrow/jeonnam/muan",
"tomorrow/jeonnam/naju",
"tomorrow/jeonnam/suncheon",
"tomorrow/jeonnam/yeongam",
"tomorrow/jeonnam/yeosu",
"tomorrow/seoul/dongjak",
"tomorrow/seoul/eunpyeong",
"tomorrow/seoul/gangnam",
"tomorrow/seoul/geumcheon",
"tomorrow/seoul/guro",
"tomorrow/seoul/gwanak",
"tomorrow/seoul/gwangjin",
"tomorrow/seoul/jongno",
"tomorrow/seoul/jung",
"tomorrow/seoul/jungnang",
"tomorrow/seoul/nowon",
"tomorrow/seoul/seocho",
"tomorrow/seoul/seongdong",
"tomorrow/seoul/songpa",
"tomorrow/seoul/yangcheon",
"tomorrow/seoul/yongsan",
"tomorrow/ulsan/buk",
"tomorrow/ulsan/dong",
"tomorrow/ulsan/jung",
"tomorrow/ulsan/nam"
]
}
+94 -12
View File
@@ -1,6 +1,8 @@
import json
import re
from datetime import datetime, timedelta
from datetime import date, datetime, timedelta
from html import escape
from pathlib import Path
from typing import Optional
import httpx
@@ -23,6 +25,11 @@ _CODE = re.compile(r'<meta name="region-code" content="(\d+)"')
_DESC = re.compile(r'(<meta (?:name|property)="(?:description|og:description|twitter:description)" content=")[^"]*"')
_NAME = re.compile(r"<h1>(.+?) (?:오늘|내일) 날씨")
_H1 = re.compile(r"(<main><h1>[^<]*</h1>)")
_TITLE = re.compile(r"<title>[^<]*</title>")
_TITLE_META = re.compile(r'(<meta (?:property|name)="(?:og:title|twitter:title)" content=")[^"]*"')
_WEEKDAY = "월화수목금토일"
# 검색 결과 새 문구를 쓰는 페이지(나머지 반은 예전 문구로 두고 클릭률을 견준다)
NEW_COPY = frozenset(json.loads(Path(__file__).with_name("seo_copy_test.json").read_text(encoding="utf-8"))["new"])
def _clock(at: datetime) -> str:
@@ -31,19 +38,35 @@ def _clock(at: datetime) -> str:
return f"{'오전' if at.hour < 12 else '오후'} {h}시" + (f" {at.minute}분" if at.minute else "")
def _date(day: date) -> str:
return f"{day.month}월 {day.day}일({_WEEKDAY[day.weekday()]})"
def _final(word: str) -> bool:
"""마지막 글자에 받침이 있는지 (한글이 아니면 없다고 본다)."""
c = ord(word[-1]) - 0xAC00
return 0 <= c < 11172 and c % 28 != 0
_SKY_WORD = {Sky.CLEAR: "맑음", Sky.PARTLY: "구름 많음", Sky.CLOUDY: "흐림"}
_RAIN_WORD = {RainType.RAIN: "비", RainType.SLEET: "비나 눈", RainType.SNOW: "눈", RainType.SHOWER: "소나기"}
def _day(rows: list[WeatherHourly]) -> tuple[int, int, int, str]:
"""하루 예보: 최저, 최고, 강수확률, 하늘 (비·눈이 있으면 그것)."""
temps = [float(r.temp_c) for r in rows]
wet = next((RainType(r.rain_type) for r in rows if r.rain_type != RainType.NONE.value), None)
day = [r for r in rows if 9 <= r.forecast_at.astimezone(KST).hour <= 18] or rows
sky = _RAIN_WORD[wet] if wet else _SKY_WORD[Sky(max({r.sky for r in day}, key=[r.sky for r in day].count))]
return round(min(temps)), round(max(temps)), max(r.rain_prob for r in rows), sky
def day_summary(rows: list[WeatherHourly]) -> str:
"""오늘 하루 예보 요약: 최저·최고, 강수확률, 하늘 (비·눈이 있으면 그것)."""
if not rows:
return ""
temps = [float(r.temp_c) for r in rows]
wet = next((RainType(r.rain_type) for r in rows if r.rain_type != RainType.NONE.value), None)
day = [r for r in rows if 9 <= r.forecast_at.astimezone(KST).hour <= 18] or rows
sky = _RAIN_WORD[wet] if wet else _SKY_WORD[Sky(max({r.sky for r in day}, key=[r.sky for r in day].count))]
return f"최저 {round(min(temps))}°·최고 {round(max(temps))}°, 강수확률 {max(r.rain_prob for r in rows)}%, {sky}."
lo, hi, prob, sky = _day(rows)
return f"최저 {lo}°·최고 {hi}°, 강수확률 {prob}%, {sky}."
def today_line(feed: Res_Feed, rows: list[WeatherHourly], sunset_at: Optional[datetime]) -> str:
@@ -69,6 +92,53 @@ def tomorrow_line(rows: list[WeatherHourly], sunset_at: Optional[datetime]) -> s
return " ".join(parts)
def today_copy(day: date, place: str, feed: Res_Feed, rows: list[WeatherHourly], sunset_at: Optional[datetime]) -> str:
"""새 문구의 오늘 설명: 날짜·지역, 하루 예보, 아침·낮 1위 각, 미세먼지·불쾌지수·자외선, 해 지는 시각."""
weather = ""
if rows:
lo, hi, prob, _ = _day(rows)
weather = f": 최저 {lo}°·최고 {hi}°, 비 올 확률 {prob}%"
parts = [f"{_date(day)} {place} 오늘 날씨{weather}."]
# 아침·낮 1위가 같으면 한 번만: 아침·낮엔 캠핑각
firsts: dict[str, list[str]] = {}
for slot, label in SLOT_LABEL.items():
for s in feed.stories:
if slot in ("morning", "day") and s.slot_ranks.get(slot) == 1:
firsts.setdefault(s.name, []).append(label)
if firsts:
said = ", ".join("·".join(labels) + f"엔 {name}" for name, labels in firsts.items())
parts.append(f"{said}{'이' if _final(list(firsts)[-1]) else '가'} 1위예요.")
status = {s.label: s.value for s in feed.hero.status} if feed.hero else {}
tail = [f"{label} {status[label]}" for label in ("미세먼지", "불쾌지수", "자외선") if label in status]
if sunset_at:
tail.append(f"해 지는 시각 {_clock(sunset_at)}")
if tail:
parts.append(", ".join(tail) + ".")
return " ".join(parts)
def tomorrow_copy(day: date, place: str, rows: list[WeatherHourly], top1: Optional[str], sunset_at: Optional[datetime]) -> str:
"""새 문구의 내일 설명: 날짜·지역, 내일 하루 예보, 내일 1위 각, 해 지는 시각."""
if not rows:
return ""
lo, hi, prob, sky = _day(rows)
line = f"{_date(day)} {place} 내일 날씨: 최저 {lo}°·최고 {hi}°, {sky}, 비 올 확률 {prob}%."
tail = ([f"내일 하기 좋은 일 1위는 {top1}"] if top1 else []) + ([f"해 지는 시각은 {_clock(sunset_at)}"] if sunset_at else [])
if not tail:
return line
return f"{line} {', '.join(tail)}{'이에요' if _final(tail[-1]) else '예요'}."
def _retitle(html: str, title: str) -> str:
html = _TITLE.sub(lambda _: f"<title>{escape(title)}</title>", html, count=1)
return _TITLE_META.sub(lambda m: f'{m.group(1)}{escape(title, quote=True)}"', html)
def _mark(html: str, copy: str) -> str:
"""앱이 검색 유입 GA 에 어느 문구로 들어왔는지 실어 보내게 표시한다."""
return html.replace("</head>", f'<meta name="seo-copy" content="{copy}" />\n </head>', 1)
def _put(template: str, line: str, extra: str = "") -> str:
"""설명 메타와 본문 h1 바로 아래에 한 줄을 넣는다."""
if not line:
@@ -77,11 +147,14 @@ def _put(template: str, line: str, extra: str = "") -> str:
return _H1.sub(lambda m: f"{m.group(1)}<p>{escape(line)}</p>{extra}", html, count=1)
def _ranks(feed: Res_Feed, name: str) -> str:
top = feed.bands.top5 if feed.bands else []
return f"<h2>오늘 {escape(name)} 각 순위</h2><ol>{''.join(f'<li>{escape(t.name)} {t.score}점</li>' for t in top)}</ol>" if top else ""
def fill(template: str, feed: Res_Feed, rows: list[WeatherHourly], name: str, sunset_at: Optional[datetime]) -> str:
"""정적 지역 페이지에 오늘 값을 채운다: 설명 메타와 본문 첫 단락, 오늘 각 순위."""
top = feed.bands.top5 if feed.bands else []
ranks = f"<h2>오늘 {escape(name)} 각 순위</h2><ol>{''.join(f'<li>{escape(t.name)} {t.score}점</li>' for t in top)}</ol>" if top else ""
return _put(template, today_line(feed, rows, sunset_at), ranks)
return _put(template, today_line(feed, rows, sunset_at), _ranks(feed, name))
class SeoService:
@@ -115,7 +188,16 @@ class SeoService:
sunset_at = sun_times(day, float(region.lat), float(region.lon)).sunset_at if region else None
start = kst_midnight(day)
_, rows = await DB_SESSION_MNG.execute_lambda(lambda s: self.weather.hourly_between(s, code, start, start + timedelta(days=1)))
found = _NAME.search(template)
name = found.group(1) if found else (feed.region_name or "")
if path not in NEW_COPY:
html = _put(template, tomorrow_line(rows or [], sunset_at)) if ahead else fill(template, feed, rows or [], name, sunset_at)
return ErrorType.SUCCESS, _mark(html, "old")
place = name.split(" ")[-1]
if ahead:
return ErrorType.SUCCESS, _put(template, tomorrow_line(rows or [], sunset_at))
name = _NAME.search(template)
return ErrorType.SUCCESS, fill(template, feed, rows or [], name.group(1) if name else (feed.region_name or ""), sunset_at)
top1 = feed.hero.tomorrow.top1.name if feed.hero and feed.hero.tomorrow and feed.hero.tomorrow.top1 else None
html = _put(template, tomorrow_copy(day, place, rows or [], top1, sunset_at))
if top1:
html = _retitle(html, f"{place} 내일 날씨 · 내일 1위는 {top1} | 날씨각")
return ErrorType.SUCCESS, _mark(html, "new")
return ErrorType.SUCCESS, _mark(_put(template, today_copy(day, place, feed, rows or [], sunset_at), _ranks(feed, name)), "new")
+74 -4
View File
@@ -15,14 +15,16 @@ from common.database.db_session_manager import DB_SESSION_MNG
from common.database.model.models import Region, SunTime, WeatherHourly
from common.enums import ErrorType, RainType, Sky, SkyType, SlotTone
from common.logger import LOG
from common.utils.kma_time import KST, kst_midnight, latest_ultra_base, latest_vilage_base, now_kst
from common.utils.kma_time import KST, NCST_DELAY, kst_midnight, latest_ncst_base, latest_ultra_base, latest_vilage_base, now_kst
from crud.region_crud import RegionCRUD
from crud.sky_crud import SkyCRUD
from crud.weather_crud import WeatherCRUD
from services.calc.sun import sun_times
from services.calc.weather_calc import discomfort_index, feels_like_c
from services.external.data_go_kr import DataGoKrNotConfigured, DataGoKrRequestFailed
from services.external.kma import day_start_base, fetch_mid, fetch_ultra, fetch_vilage, latest_mid_base, parse_mid, parse_ultra, parse_vilage
from services.external.kma import (
day_start_base, fetch_mid, fetch_ncst, fetch_ultra, fetch_vilage, latest_mid_base, parse_mid, parse_ncst, parse_ultra, parse_vilage,
)
SLOT_HOURS = range(0, 24, 3)
_WAIT_STEPS, _WAIT_SEC = 75, 0.2 # 처음 온 지역은 다른 요청이 예보를 받아 오는 동안 최대 15초 기다린다
@@ -40,6 +42,17 @@ class RainHour:
lightning: bool = False
@dataclass
class Observed:
"""초단기실황: 정시(at)에 관측한 지금 날씨."""
at: datetime
rain_type: RainType
rain_mm: float
temp_c: float
humidity: int
wind_ms: float
@dataclass
class Slot:
at: datetime
@@ -70,6 +83,20 @@ def with_ultra_rain(by_at: dict[datetime, WeatherHourly], ultra: Optional[list[R
return out
def with_observed(by_at: dict[datetime, WeatherHourly], obs: Optional[Observed]) -> dict[datetime, WeatherHourly]:
"""실황이 닿는 정시 한 시각은 비·기온·습도·바람을 관측값으로 바꾼 사본. 체감온도·불쾌지수는 관측값으로 다시 계산한다."""
r = by_at.get(obs.at) if obs else None
if r is None:
return by_at
cols = {c.key: getattr(r, c.key) for c in WeatherHourly.__table__.columns}
row = WeatherHourly(**{
**cols, "rain_type": obs.rain_type.value, "rain_mm": obs.rain_mm, "temp_c": obs.temp_c, "humidity": obs.humidity, "wind_ms": obs.wind_ms,
"feels_c": feels_like_c(obs.temp_c, obs.humidity, obs.wind_ms, obs.at.month), "discomfort_index": discomfort_index(obs.temp_c, obs.humidity),
})
row.observed = True # DB 칸이 아니라 이 사본에만 붙는 표시: 한 줄 문구가 확률 대신 관측한 대로 쓴다
return {**by_at, obs.at: row}
def _hourly_rows(region_code: str, hourly: dict[datetime, dict], issued: datetime) -> list[dict]:
rows = []
for at, v in hourly.items():
@@ -159,7 +186,7 @@ class WeatherService:
return ErrorType.NOT_FOUND, None
now = now_kst()
_, ultra = await asyncio.gather(self.ensure_vilage(region, now), ultra_hours(region, now, wait=True))
_, ultra, observed = await asyncio.gather(self.ensure_vilage(region, now), ultra_hours(region, now, wait=True), observed_now(region, now, wait=True))
day = day or now.date()
sun = await self._ensure_sun(region, day)
start = kst_midnight(day)
@@ -175,7 +202,7 @@ class WeatherService:
sunset_score = next(
(x.score for x in sky_scores or [] if x.sky_type == SkyType.SUNSET.value and x.score_date == day), None
)
by_at = with_ultra_rain({r.forecast_at: r for r in rows}, ultra)
by_at = with_observed(with_ultra_rain({r.forecast_at: r for r in rows}, ultra), observed)
slots = []
hour_now = now.replace(minute=0, second=0, microsecond=0)
for h in SLOT_HOURS:
@@ -327,3 +354,46 @@ async def ultra_hours(region: Region, now: datetime, wait: bool = False) -> Opti
except (DataGoKrNotConfigured, DataGoKrRequestFailed, RedisError) as e:
LOG.error(f"[now] ultra {region.code}: {e}")
return None
async def _cached_ncst(key: str, base: datetime) -> Optional[Observed]:
cached = await REDIS.conn.get(key)
if not cached:
return None
data = orjson.loads(cached)
if data["base"] != base.isoformat():
return None
return Observed(
at=base, rain_type=RainType(data["rain_type"]), rain_mm=data["rain_mm"], temp_c=data["temp_c"], humidity=data["humidity"], wind_ms=data["wind_ms"],
)
async def observed_now(region: Region, now: datetime, wait: bool = False) -> Optional[Observed]:
"""초단기실황(지금 관측). 정시마다 한 번 받아 그 시간 동안 쓴다. 실패하거나 값이 비면 None. 다른 요청이 받아 오는 중이면 wait 일 때만 기다린다."""
key = f"ncst:{region.code}"
base = latest_ncst_base(now)
try:
for attempt in range(_ULTRA_WAIT_TRIES if wait else 1):
if attempt:
await asyncio.sleep(_ULTRA_WAIT_SEC)
if (obs := await _cached_ncst(key, base)) is not None:
return obs
async with redis_lock(f"lock:ncst:{region.code}") as acquired:
if not acquired:
continue
async with httpx.AsyncClient(timeout=10) as client:
parsed = parse_ncst(await fetch_ncst(client, region.nx, region.ny, base))
if parsed is None:
return None
obs = Observed(at=base, **parsed)
payload = {
"base": base.isoformat(), "rain_type": obs.rain_type.value, "rain_mm": obs.rain_mm, "temp_c": obs.temp_c,
"humidity": obs.humidity, "wind_ms": obs.wind_ms,
}
ttl = int((base + timedelta(hours=1) + NCST_DELAY - now).total_seconds())
await REDIS.conn.set(key, orjson.dumps(payload), ex=max(ttl, 60))
return obs
return None
except (DataGoKrNotConfigured, DataGoKrRequestFailed, RedisError) as e:
LOG.error(f"[now] ncst {region.code}: {e}")
return None
+1 -1
View File
@@ -30,7 +30,7 @@ from services.week_service import _icon
# 주말 전국 날씨 순위·당일치기 추천. 대표 지역(노을 순위 30곳)과 당일치기 후보 도시의 토·일 나들이 점수를
# 워커가 하루 두 번(06:40·18:40) 미리 계산해 Redis 에 둔다. 없으면 순위 API 가 그 자리에서 계산한다.
_SEED = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "seed", "trip_city.csv")
_KEY = "weekend_rank:v2:{:%Y%m%d}" # v2: 점수를 바꾸기 표로 보정한 값 (옛 점수 캐시를 쓰지 않게 키를 바꿨다)
_KEY = "weekend_rank:v3:{:%Y%m%d}" # v3: 비 상한(최대 30점)을 없앤 점수 (옛 점수 캐시를 쓰지 않게 키를 바꿨다)
_TTL = 13 * 3600
_PARALLEL = 4 # 기상청 동시 호출 수
_WAIT_STEPS, _WAIT_SEC = 60, 0.5
+8
View File
@@ -73,6 +73,14 @@ def _no_seoul_crawl(monkeypatch):
monkeypatch.setattr(week_service, "fetch_seoul_festivals", lambda *a: _async([]))
@pytest.fixture(autouse=True)
def _no_ncst_call(monkeypatch):
"""초단기실황은 실제 기상청을 부르지 않게 기본으로 '값 없음'으로 막는다 (실황을 쓰는 테스트는 자기 값으로 바꾼다)."""
import services.weather_service as weather_service
monkeypatch.setattr(weather_service, "fetch_ncst", lambda *a: _async([]))
@pytest.fixture
def no_bot_comments(monkeypatch):
"""사람이 단 댓글·좋아요만 세는 테스트용: 포스트를 만들 때 캐릭터 댓글을 달지 않는다 (캐릭터 댓글은 test_bot_comment)."""
+2
View File
@@ -148,6 +148,8 @@ async def test_hero_tomorrow_and_tomorrow_slots(offline):
async with client() as c:
hero = (await c.get("/v1/feed", params={"region": REGION})).json()["hero"]
assert set(hero["tomorrow"]["weather_slots"]) <= {"morning", "day", "evening", "night"}
assert len(hero["tomorrow"]["ranked"]) <= 5 and len(hero["tomorrow"]["events"]) <= 3
assert hero["tomorrow"]["top1"] == (hero["tomorrow"]["ranked"][0] if hero["tomorrow"]["ranked"] else None)
res = (await c.get("/v1/weather/today", params={"region": REGION, "day": "tomorrow"})).json()
assert res["day"] == hero["tomorrow"]["day"]
+18
View File
@@ -85,3 +85,21 @@ def test_success_reads_toss_wrapper():
toss_login._success(fail, "login-me")
with pytest.raises(toss_login.TossLoginError, match="invalid_grant"):
toss_login._success(grant, "generate-token")
@pytest.mark.anyio
async def test_toss_login_marks_only_first_as_new(monkeypatch):
"""처음 들어온 요청만 is_new(GA sign_up), 같은 사람이 다시 들어오면 로그인"""
import secrets
key = 10_000_000 + secrets.randbelow(80_000_000)
async def fake_user_key(code: str, referrer: str) -> int:
return key
monkeypatch.setattr(toss_login, "user_key", fake_user_key)
async with client() as c:
first = (await c.post("/v1/auth/toss", json={"authorization_code": "code-x", "referrer": "DEFAULT"})).json()
again = (await c.post("/v1/auth/toss", json={"authorization_code": "code-x", "referrer": "DEFAULT"})).json()
assert first["result"]["success"] is True and first["is_new"] is True
assert again["result"]["success"] is True and again["is_new"] is False
+92
View File
@@ -133,6 +133,98 @@ def test_current_slot_skips_passed_hours():
assert with_now["morning"].score == without["morning"].score
def _rain_at(hours: set[int]):
start = kst_midnight(DAY)
return {
start + timedelta(hours=h): SimpleNamespace(
forecast_at=start + timedelta(hours=h), feels_c=21.0, rain_type=RainType.RAIN.value if h in hours else RainType.NONE.value,
rain_prob=100 if h in hours else 0, wind_ms=1.0, humidity=50, sky=Sky.CLEAR.value,
)
for h in range(0, 30)
}
def _umbrella_defn():
defn = _defn([{"from": 6, "to": 24}])
defn.weight_temp, defn.weight_rain = 0, 100
defn.factor_rules = defn.factor_rules | {"rain": {"dir": "wet", "span": "rest_of_day", "now_base": 70}}
return defn
def test_umbrella_current_slot_counts_the_rest_of_the_day_not_just_the_slot():
"""11:30 낮 구간(11~15시): 16~23시 비가 점수에 들어간다. 지금은 안 오니 8/13시간 → 62점."""
now = datetime(2026, 10, 8, 11, 30, tzinfo=KST)
parts = slot_results(_umbrella_defn(), DAY, REGION, _rain_at(set(range(16, 24))), {}, CTX, SUNSET, now)
assert parts["day"].score == 62
def test_umbrella_raining_now_and_all_remaining_hours_rain_is_100():
now = datetime(2026, 10, 8, 13, 30, tzinfo=KST)
parts = slot_results(_umbrella_defn(), DAY, REGION, _rain_at(set(range(13, 24))), {}, CTX, SUNSET, now)
assert parts["day"].score == 100
def test_umbrella_lost_current_slot_looks_at_now_and_later_only():
"""우산분실각은 지금과 앞으로만 본다. 11:30, 16~23시 비 예보(지금은 안 옴): 챙겼을 정도 100% × 안 쓰는 시간 5/13 → 38점.
아침에 비가 왔었는지(지난 시각)는 점수에 들어가지 않는다."""
defn = _defn([{"from": 9, "to": 22}])
defn.weight_temp, defn.weight_rain = 0, 100
defn.factor_rules = defn.factor_rules | {"rain": {"dir": "dry", "span": "rest_of_day", "kind": "unused"}}
now = datetime(2026, 10, 8, 11, 30, tzinfo=KST)
later = slot_results(defn, DAY, REGION, _rain_at(set(range(16, 24))), {}, CTX, SUNSET, now)["day"].score
with_morning_rain = slot_results(defn, DAY, REGION, _rain_at({6, 7, 8} | set(range(16, 24))), {}, CTX, SUNSET, now)["day"].score
assert later == with_morning_rain == 38
def test_umbrella_raining_now_needs_the_current_hours_own_forecast():
"""13시 예보 행이 없고 14시에만 비가 오면 '지금 비'가 아니다. 다음 시각의 비를 지금으로 읽으면 안 된다 → 남은 10시간 중 1시간, 10점."""
now = datetime(2026, 10, 8, 13, 30, tzinfo=KST)
by_at = {k: v for k, v in _rain_at({14}).items() if k != kst_midnight(DAY) + timedelta(hours=13)}
parts = slot_results(_umbrella_defn(), DAY, REGION, by_at, {}, CTX, SUNSET, now)
assert parts["day"].score == 10
def test_umbrella_raining_now_comes_from_the_observed_weather():
"""예보는 지금 비가 없어도 실황이 비를 관측했으면 '지금 비'다: 70 + 30 × 평균 → 81 (실황 없이는 평균 30 → 30)."""
from common.enums import RainType
from services.weather_service import Observed, with_observed
now = datetime(2026, 10, 8, 13, 30, tzinfo=KST)
by_at = {r.forecast_at: r for r in (_hourly(h) for h in range(5, 30))}
observed = Observed(at=kst_midnight(DAY) + timedelta(hours=13), rain_type=RainType.RAIN, rain_mm=0.3, temp_c=21.0, humidity=60, wind_ms=1.0)
dry = slot_results(_umbrella_defn(), DAY, REGION, by_at, {}, CTX, SUNSET, now)["day"].score
wet = slot_results(_umbrella_defn(), DAY, REGION, with_observed(by_at, observed), {}, CTX, SUNSET, now)["day"].score
assert (dry, wet) == (30, 81)
def test_umbrella_now_follows_the_slot_the_screen_shows_even_at_a_slot_boundary():
"""일몰 17:20 이면 낮은 15:20 까지인데 15시 행은 15:30 기준으로 저녁 칸에 든다. 15:11 에 화면이 보이는 구간은 낮이고, 그 점수가 '지금 비'를 알아야 한다."""
from common.enums import RainType
from services.weather_service import Observed, with_observed
sunset = datetime(2026, 10, 8, 17, 20, tzinfo=KST)
now = datetime(2026, 10, 8, 15, 11, tzinfo=KST)
observed = Observed(at=kst_midnight(DAY) + timedelta(hours=15), rain_type=RainType.RAIN, rain_mm=1.0, temp_c=9.7, humidity=92, wind_ms=2.3)
by_at = with_observed({r.forecast_at: r for r in (_hourly(h) for h in range(5, 30))}, observed)
parts = slot_results(_umbrella_defn(), DAY, REGION, by_at, {}, CTX, sunset, now)
assert current_slot(now, sunset) == "day"
assert parts["day"].score == 81 # 15시부터 자정까지 9시간: 70 + 30 × (100 + 30 × 8) ÷ 9 ÷ 100
assert parts["day"].summary.startswith("오후 3시"), parts["day"].summary # 문구도 남은 시간의 가운데(밤)가 아니라 지금
def test_umbrella_other_slots_have_no_raining_now_bonus():
"""13:30 에 낮 구간이 지금. 저녁 구간(16시~)은 16시에만 비가 와도 지금 비 보너스 없이 평균 × 100 → 약 12점."""
now = datetime(2026, 10, 8, 13, 30, tzinfo=KST)
parts = slot_results(_umbrella_defn(), DAY, REGION, _rain_at({16}), {}, CTX, SUNSET, now)
assert 10 <= parts["evening"].score <= 13
def test_umbrella_rest_of_day_stops_at_midnight():
"""밤 구간 시각 24~28시는 다음 날 새벽이라 '남은 하루'에 넣지 않는다."""
parts = slot_results(_umbrella_defn(), DAY, REGION, _rain_at(set(range(24, 29))), {}, CTX, SUNSET)
assert parts["night"].score == 0
def test_current_slot_keeps_last_hour():
"""구간 끝 한 시간만 남아도 지금 구간 점수를 낸다."""
now = datetime(2026, 10, 8, 15, 10, tzinfo=KST)
+113
View File
@@ -106,6 +106,33 @@ def test_feed_cache_expires_when_ultra_forecast_arrives():
assert feed_ttl_sec(now, sunset) == 25 * 60
def test_feed_cache_expires_when_the_new_hours_observation_arrives():
"""15:02 에 만든 피드는 15시 실황이 나오는 15:10 에 끝나야 한다. 안 그러면 미세먼지(15:20)까지 히어로가 지난 시각 값이다."""
from datetime import datetime
from common.utils.kma_time import KST
from services.feed_service import feed_ttl_sec
now = datetime(2026, 10, 2, 15, 2, tzinfo=KST)
sunset = datetime(2026, 10, 2, 18, 10, tzinfo=KST)
assert feed_ttl_sec(now, sunset) == 8 * 60
@pytest.mark.anyio
async def test_hero_shows_the_observed_current_weather(offline, monkeypatch):
"""예보는 20도·습도 50% 인데 실황이 3.3도·88% 로 관측했으면 히어로의 지금은 관측값이다."""
import services.weather_service as weather_service
async def observed(*_a):
return [{"category": c, "obsrValue": v} for c, v in {"PTY": "0", "REH": "88", "RN1": "0", "T1H": "3.3", "WSD": "2.0"}.items()]
monkeypatch.setattr(weather_service, "fetch_ncst", observed)
monkeypatch.setattr(weather_service, "latest_ncst_base", lambda now: now.replace(minute=0, second=0, microsecond=0)) # 매시 00~10분에도 같게
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
hero = (await client.get("/v1/feed", params={"region": REGION})).json()["hero"]
assert (hero["temp_c"], hero["humidity"]) == (3.3, 88)
def _card(post_type, post_id=1):
from datetime import datetime
@@ -195,6 +222,92 @@ def test_arrange_scatters_up_to_three_events_same_spot_all_day():
assert run(14, "2026-10-02:1144000000") == out
def test_feed_events_keeps_every_festival_and_two_of_other_kinds():
from types import SimpleNamespace
from common.enums import EventKind
from services.feed_service import feed_events
from services.week_service import EventItem
kinds = [EventKind.POPUP] * 4 + [EventKind.FESTIVAL] * 6 + [EventKind.CONCERT] * 3 + [EventKind.EXHIBITION] * 3
items = [EventItem(event=SimpleNamespace(kind=k.value, n=n), status="live", status_label="진행 중", fit=None) for n, k in enumerate(kinds)]
out = [e.event.kind for e in feed_events(items)]
assert out.count(EventKind.FESTIVAL.value) == 6
assert all(out.count(k.value) == 2 for k in (EventKind.POPUP, EventKind.CONCERT, EventKind.EXHIBITION))
assert out[:4] == [EventKind.FESTIVAL.value, EventKind.POPUP.value, EventKind.EXHIBITION.value, EventKind.CONCERT.value]
def test_tomorrow_events_keep_same_sido_events_running_that_day():
"""내일 페이지 행사: 내일 열리는 같은 시도 행사만, 종류를 섞어 3개까지."""
from types import SimpleNamespace
from common.enums import EventKind
from services.feed_service import tomorrow_events
from services.week_service import EventItem
day = date(2026, 10, 31)
def ev(n, kind, sido="11", start=day, end=day):
e = SimpleNamespace(event_id=n, name=f"행사{n}", place_name=f"장소{n}", icon="concert", kind=kind.value, sido_code=sido, start_date=start, end_date=end)
return EventItem(event=e, status="live", status_label="진행 중", fit=None)
items = [
ev(1, EventKind.CONCERT), ev(2, EventKind.CONCERT), ev(3, EventKind.FESTIVAL, start=day - timedelta(days=2)),
ev(4, EventKind.FESTIVAL, end=day - timedelta(days=1)), ev(5, EventKind.EXHIBITION, sido="41"), ev(6, EventKind.POPUP, start=day + timedelta(days=1)),
]
out = tomorrow_events(items, "1144000000", day)
assert [e.event_id for e in out] == [3, 1, 2]
assert out[0].place == "장소3" and out[0].start_date == day - timedelta(days=2)
def test_hero_tomorrow_ranks_in_season_gak_by_tomorrow_score():
"""내일의 각: 내일 하루 점수(중요도 반영) 순 5개, 철 지난 각은 빼고, 1위는 top1 과 같다."""
from types import SimpleNamespace
from services.feed_service import _hero_tomorrow
day = date(2026, 10, 31)
def item(n, score, in_season=True, priority=1.0):
d = SimpleNamespace(index_id=n, code=f"g{n}", name=f"각{n}", icon="sun", priority=priority)
trend = [SimpleNamespace(score_date=day - timedelta(days=1), score=100, summary="오늘"), SimpleNamespace(score_date=day, score=score, summary=f"내일{n}")]
return SimpleNamespace(definition=d, trend=trend, in_season=in_season)
board = SimpleNamespace(items=[item(1, 60), item(2, 99, in_season=False), item(3, 90), item(4, 70), item(5, 80), item(6, 50), item(7, 40)],
tomorrow_slots={}, tomorrow_why={})
hero = _hero_tomorrow(day, board)
assert [(g.index_id, g.rank) for g in hero.ranked] == [(3, 1), (5, 2), (4, 3), (1, 4), (6, 5)]
assert hero.top1 == hero.ranked[0] and hero.ranked[0].summary == "내일3"
def test_arrange_spreads_many_events_through_whole_feed():
"""행사가 앞쪽 절반 자리보다 많으면 끝까지 한 장씩 걸러 끼우고, 남은 건 맨 뒤에 다 붙인다."""
from datetime import datetime
from common.utils.kma_time import KST
from services.feed_service import arrange
sunset = datetime(2026, 10, 2, 18, 10, tzinfo=KST)
others = [PostType.WEATHER, PostType.GAK, PostType.GAK, PostType.GAK, PostType.SUNSET, PostType.WEEK, PostType.SEASON, PostType.TIP, PostType.QUOTE]
cards = [_card(t, n) for n, t in enumerate(others + [PostType.EVENT] * 20)]
out = arrange(cards, "day", datetime(2026, 10, 2, 13, tzinfo=KST), sunset, False, "2026-10-02:1144000000")
types = [c.post_type for c in out]
assert types.count(PostType.EVENT) == 20 and types[0] is PostType.WEATHER
rest = len(others) - 1
assert PostType.EVENT not in types[1:1 + 2 * rest:2] and types[2:2 + 2 * rest:2] == [PostType.EVENT] * rest
assert set(types[1 + 2 * rest:]) == {PostType.EVENT}
assert [c.post_id for c in out if c.post_type is PostType.EVENT] == list(range(len(others), len(others) + 20))
def test_lineup_event_slots_stay_below_card_positions():
from crud.card_crud import CARD_POSITION_START
from services.feed_service import LINEUP, _EVENT_SLOTS
positions = [x[0] for x in LINEUP]
assert len(positions) == len(set(positions)) and max(positions) < CARD_POSITION_START
assert sorted(x[3] for x in LINEUP if x[1] is PostType.EVENT) == list(range(1, _EVENT_SLOTS + 1))
@pytest.mark.anyio
async def test_build_day_makes_every_card_at_three():
thursday = date(2026, 10, 15)
+70
View File
@@ -0,0 +1,70 @@
from datetime import date, timedelta
import pytest
from httpx import ASGITransport, AsyncClient
import services.first_snow_service as first_snow_service
from common.utils.kma_time import now_kst
from router.router import app
from services.external.open_meteo import OpenMeteoRequestFailed, parse_snow
from services.first_snow_service import SPOTS, first_snow_day
def _daily(start: date, cms: list) -> dict:
return {"daily": {"time": [(start + timedelta(days=i)).isoformat() for i in range(len(cms))], "snowfall_sum": cms}}
def test_parse_snow_skips_days_without_value():
rows = parse_snow(_daily(date(2026, 11, 20), [0.0, None, 1.4]))
assert rows == [(date(2026, 11, 20), 0.0), (date(2026, 11, 22), 1.4)]
def test_first_snow_day_is_first_day_from_today_with_enough_snow():
today = date(2026, 11, 22)
days = [(date(2026, 11, 21), 3.0), (date(2026, 11, 22), 0.05), (date(2026, 11, 24), 0.7), (date(2026, 11, 25), 2.0)]
assert first_snow_day(days, today) == (date(2026, 11, 24), 0.7) # 어제 눈과 0에 가까운 값은 뺀다
assert first_snow_day([(date(2026, 11, 23), 0.0)], today) is None
def test_spot_data_has_normal_dates_and_unique_names():
names = [s["name"] for s in SPOTS]
assert len(names) == len(set(names)) and len(names) >= 40
for s in SPOTS:
month, day = map(int, s["normal"].split("-"))
assert month in (11, 12) and 1 <= day <= 31
assert 33 <= s["lat"] <= 39 and 125 <= s["lon"] <= 130
@pytest.mark.anyio
async def test_first_snow_api_marks_spots_with_snow_forecast(monkeypatch):
today = now_kst().date()
calls = []
async def fake_fetch(client, points, days):
calls.append(len(points))
# 첫 지점만 모레 눈, 나머지는 눈 없음
return [_daily(today, [0.0, 0.0, 1.2, 0.0] if i == 0 else [0.0] * 4) for i in range(len(points))]
monkeypatch.setattr(first_snow_service, "fetch_snow", fake_fetch)
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
body = (await client.get("/v1/season/first-snow")).json()
again = (await client.get("/v1/season/first-snow")).json()
assert body["result"]["success"] is True and body["forecast"] is True
assert len(body["spots"]) == len(SPOTS)
first = body["spots"][0]
assert first["name"] == SPOTS[0]["name"] and first["normal"] == SPOTS[0]["normal"]
assert first["snow_date"] == (today + timedelta(days=2)).isoformat() and first["snow_cm"] == 1.2
assert all("snow_date" not in s for s in body["spots"][1:])
assert again == body and calls == [len(SPOTS)] # 두 번째는 Redis 에 둔 예보를 쓴다
@pytest.mark.anyio
async def test_first_snow_api_returns_normal_dates_when_forecast_fails(monkeypatch):
async def failing_fetch(client, points, days):
raise OpenMeteoRequestFailed("down")
monkeypatch.setattr(first_snow_service, "fetch_snow", failing_fetch)
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
body = (await client.get("/v1/season/first-snow")).json()
assert body["result"]["success"] is True and body["forecast"] is False
assert len(body["spots"]) == len(SPOTS) and all("snow_date" not in s for s in body["spots"])
+48
View File
@@ -5,6 +5,7 @@ import pytest
from httpx import ASGITransport, AsyncClient
import services.air_service as air_service
import services.index_service as index_service
import services.warning_service as warning_service
import services.weather_service as weather_service
from common.database.db_session_manager import DB_SESSION_MNG
@@ -91,6 +92,53 @@ async def test_index_list_ranks_every_gak_with_today_tomorrow_weekend_trend(fake
assert 0 <= body["weather_score"] <= 100
@pytest.mark.anyio
async def test_index_list_asks_for_the_observed_weather_once(fakes, monkeypatch):
calls = []
async def fake_ncst(client, nx, ny, base):
calls.append(base)
return []
monkeypatch.setattr(weather_service, "fetch_ncst", fake_ncst)
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
assert (await client.get("/v1/index/list", params={"region": REGION})).json()["result"]["success"] is True
assert len(calls) == 1
@pytest.mark.anyio
async def test_index_scores_are_recomputed_once_the_new_hours_observation_is_out(fakes, monkeypatch):
"""14:05 에 계산한 점수는 14:08 에 그대로 쓰고, 14시 실황이 나오는 14:10 이후엔 다시 계산한다."""
day = kst_midnight(now_kst().date())
clock = [day + timedelta(hours=14, minutes=5)]
computed = []
real_day_result = index_service.day_result
def counting(*a, **k):
computed.append(1)
return real_day_result(*a, **k)
async def observed(*_a):
return [{"category": c, "obsrValue": v} for c, v in {"PTY": "0", "REH": "50", "RN1": "0", "T1H": "21", "WSD": "1.5"}.items()]
monkeypatch.setattr(index_service, "now_kst", lambda: clock[0])
monkeypatch.setattr(index_service, "day_result", counting)
monkeypatch.setattr(weather_service, "fetch_ncst", observed)
monkeypatch.setattr(air_service, "fetch_realtime", lambda *a: _async([{
"stationName": "신촌동", "pm25Value": "10", "pm10Value": "20", "pm25Grade": "1", "pm10Grade": "1", "dataTime": f"{day:%Y-%m-%d} 14:00",
}]))
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
await client.get("/v1/index/list", params={"region": REGION})
first = len(computed)
assert first > 0
clock[0] = day + timedelta(hours=14, minutes=8)
await client.get("/v1/index/list", params={"region": REGION})
assert len(computed) == first
clock[0] = day + timedelta(hours=14, minutes=12)
await client.get("/v1/index/list", params={"region": REGION})
assert len(computed) > first
@pytest.mark.anyio
async def test_index_list_filters_core_to_gak_in_season_now(fakes):
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
+265 -6
View File
@@ -68,6 +68,18 @@ def test_time_matching_does_not_replace_weekday_score():
assert evaluate(_defn(), [[_h(12)]], replace(CTX, time_matches=False)).factors["time"] == 100
def test_time_mismatch_cap_only_applies_outside_activity_hours():
limit = [{"field": "time_matches", "op": "==", "value": False, "cap": 50}]
defn = _defn(factor_rules=_defn().factor_rules | {"time": {"type": "fixed", "value": 100}}, zero_rules=limit)
matched = evaluate(defn, [[_h(7, wind=1.0)]], CTX)
unmatched = evaluate(defn, [[_h(12, wind=1.0)]], replace(CTX, time_matches=False))
assert matched.score == 100 and matched.zero_reason is None
assert unmatched.score == 50 and unmatched.zero_reason == "활동 시간대가 아니라 최대 50점"
assert zero_rules_text(limit) == "활동 시간대가 아니면 최대 50점"
assert zero_rules_text(limit + [{"field": "rain_prob", "op": ">=", "value": 60, "cap": 50}]) == \
"활동 시간대가 아니거나 비 확률 60% 이상이면 최대 50점"
def test_good_but_not_perfect_stays_below_100():
assert evaluate(_defn(), [[_h(19, feels=23, hum=58, wind=1.8)]], CTX).score < 95
@@ -240,10 +252,20 @@ def test_outing_cloudy_and_hot_days_lose_points():
assert "흐림" in cloudy.reason
def test_outing_rain_caps_score():
r = outing(_day(prob=70))
assert r.score <= 30 and r.capped
assert outing([_h(10, prob=30, rain=RainType.RAIN)] + _day()[1:]).score <= 30
def test_outing_rain_lowers_score_without_a_cap():
"""비가 오면 비 점수와 가장 낮은 요소 때문에 점수가 내려가지만, 따로 상한으로 묶지는 않는다."""
clear = outing(_day())
likely = outing(_day(prob=70))
raining = outing([_h(10, prob=30, rain=RainType.RAIN)] + _day()[1:])
assert raining.score < likely.score < clear.score
assert likely.score > 30 and raining.score > 30
def test_outing_rainy_days_keep_their_differences():
"""전국이 비인 날에도 기온·하늘에 따라 점수가 갈린다 (예전엔 모두 상한 30점에 걸려 같은 점수였다)."""
mild = outing(_day(feels=16.0, sky=Sky.CLOUDY, rain=RainType.RAIN))
chilly = outing(_day(feels=14.0, sky=Sky.CLOUDY, rain=RainType.RAIN))
assert chilly.score < mild.score
def test_outing_needs_all_hours():
@@ -254,7 +276,7 @@ def test_outing_estimate_from_mid_forecast():
r = outing_estimate(_fc(lo=12, hi=22, am=10, pm=20))
assert r.estimated is True and r.factors["wind"] == 70
assert r.reason.startswith("비 20% · 낮 ")
assert outing_estimate(_fc(pm=60)).score <= 30
assert 30 < outing_estimate(_fc(pm=60)).score < outing_estimate(_fc(pm=0)).score
assert outing_estimate(_fc(lo=None, hi=None)) is None
@@ -275,6 +297,134 @@ def _seed_score(code, day=_SAT, pm25=10, **hour):
return evaluate(d, windows, replace(CTX, day=day, pm25=pm25)).score
@pytest.mark.parametrize("prob, ceiling", [(60, 30), (69, 30), (70, 0)])
def test_running_high_rain_probability_limits_score(prob, ceiling):
assert _seed_score("running", feels=12, prob=prob) <= ceiling
@pytest.mark.parametrize("rain", [RainType.RAIN, RainType.SNOW, RainType.SLEET])
def test_running_any_precipitation_in_window_is_zero(rain):
hours = [_h(6, feels=12), _h(7, feels=12, prob=10, rain=rain)]
result = evaluate(_SEED["running"], [hours], CTX)
assert result.score == 0 and result.zero_reason == "비 소식이 있어 0점"
@pytest.mark.parametrize("feels, ceiling", [(-3, 0), (0, 40), (2, 40), (3, 40), (4.9, 40), (28, 30), (35, 0)])
def test_running_cold_and_heat_limit_score(feels, ceiling):
assert _seed_score("running", feels=feels) <= ceiling
def test_running_cold_limit_uses_coldest_hour():
hours = [_h(6, feels=3), _h(7, feels=12)]
assert evaluate(_SEED["running"], [hours], CTX).score <= 40
@pytest.mark.parametrize("hour", [6, 7, 19, 21])
@pytest.mark.parametrize("feels", [5, 8, 10, 12, 15])
def test_running_clear_cool_morning_and_evening_stay_good(hour, feels):
result = evaluate(_SEED["running"], [[_h(hour, feels=feels)]], CTX)
assert result.score >= 80 and result.zero_reason is None
@pytest.mark.parametrize("hour, feels", [(12, 12), (12, 14), (12, 25), (22, 12), (26, 12)])
def test_running_can_be_done_at_any_hour(hour, feels):
"""러닝각은 활동 시간대 밖이라고 점수 상한을 두지 않는다."""
outside = evaluate(_SEED["running"], [[_h(hour, feels=feels)]], replace(CTX, time_matches=False))
inside = evaluate(_SEED["running"], [[_h(hour, feels=feels)]], replace(CTX, time_matches=True))
assert outside.score == inside.score
@pytest.mark.parametrize("wind, ceiling", [(6, 30), (8, 0)])
def test_running_strong_wind_limits_score(wind, ceiling):
assert _seed_score("running", feels=12, wind=wind) <= ceiling
def test_running_strong_gust_is_zero():
assert _seed_score("running", feels=12, gust_ms=15) == 0
@pytest.mark.parametrize("pm25, ceiling", [(36, 30), (75, 0)])
def test_running_bad_air_limits_score(pm25, ceiling):
assert _seed_score("running", feels=12, pm25=pm25) <= ceiling
def test_running_wind_warning_is_zero():
assert evaluate(_SEED["running"], [[_h(6, feels=12)]], replace(CTX, wind_warning=True)).score == 0
@pytest.mark.parametrize("hour", [dict(prob=60, feels=3), dict(prob=60, feels=35), dict(prob=60, wind=8)])
def test_running_stricter_limits_win_when_conditions_overlap(hour):
result = evaluate(_SEED["running"], [[_h(6, **(dict(feels=12) | hour))]], CTX)
assert result.score <= (30 if hour.get("feels") == 3 else 0)
@pytest.mark.parametrize("hour", [dict(feels=12), dict(feels=20, hum=80), dict(feels=3, prob=60), dict(feels=12, wind=8, rain=RainType.RAIN)])
def test_activity_hours_never_change_any_gak_score(hour):
"""어느 각도 활동 시간대에 해당하는지로 점수나 0점 조건이 달라지지 않는다."""
windows = [[_h(7, **hour)]]
for code, defn in _SEED.items():
assert all(r["field"] != "time_matches" for r in defn.zero_rules), code
on, off = (evaluate(defn, windows, replace(CTX, time_matches=m, pm25=30)) for m in (True, False))
assert (on.score, on.zero_reason) == (off.score, off.zero_reason), code
_AXES = ("temp", "rain", "wind", "humidity", "air", "uv", "sun", "view", "time")
def _weights(code):
return {a: getattr(_SEED[code], f"weight_{a}") for a in _AXES if getattr(_SEED[code], f"weight_{a}")}
def test_no_gak_scores_activity_hours_as_a_factor():
assert [c for c, d in _SEED.items() if d.factor_rules["time"]["type"] == "fixed" and d.weight_time] == []
def test_gak_weights_are_5_percent_steps_that_sum_to_100():
for code in _SEED:
weights = _weights(code)
assert sum(weights.values()) == 100 and all(v % 5 == 0 for v in weights.values()), code
def test_every_gak_has_three_factors_except_the_two_umbrella_gak():
assert {c for c in _SEED if len(_weights(c)) < 3} == {"umbrella", "umbrella_lost"}
@pytest.mark.parametrize("code, expected", [
("umbrella", {"rain": 100}),
("umbrella_lost", {"rain": 100}),
("iced_hot", {"temp": 80, "rain": 10, "wind": 10}),
("pajeon", {"temp": 20, "rain": 65, "humidity": 15}),
("mood_song", {"temp": 30, "rain": 55, "humidity": 15}),
("thanks", {"temp": 50, "rain": 30, "wind": 20}),
("sunscreen", {"uv": 70, "sun": 15, "temp": 15}),
("walk", {"temp": 35, "rain": 25, "wind": 15, "humidity": 10, "air": 15}),
("running", {"temp": 40, "rain": 20, "wind": 10, "humidity": 15, "air": 15}),
("sentimental", {"temp": 40, "rain": 35, "wind": 15, "humidity": 10}),
("selfie", {"rain": 20, "wind": 15, "humidity": 35, "sun": 30}),
])
def test_gak_weights_after_removing_activity_hours(code, expected):
assert _weights(code) == expected
def test_umbrella_gak_use_the_rain_rules_the_owner_asked_for():
assert _SEED["umbrella"].factor_rules["rain"] == {"dir": "wet", "span": "rest_of_day", "now_base": 70}
lost = _SEED["umbrella_lost"]
assert lost.factor_rules["rain"] == {"dir": "dry", "span": "rest_of_day", "kind": "unused", "label": "우산 안 쓰는 시간"}
# 지난 시각(앞서 내린 비)은 보지 않는다. 지금과 앞으로만으로 점수를 내므로 0점 조건이 없다
assert lost.zero_rules == [] and lost.windows == [{"from": 9, "to": 22}]
@pytest.mark.parametrize("code, calm, lively", [
("iced_hot", dict(feels=8.0, prob=0), dict(feels=8.0, prob=0, wind=7.0)),
("thanks", dict(feels=0.0, wind=0.5), dict(feels=0.0, wind=7.0)),
("pajeon", dict(feels=15.0, prob=90, rain=RainType.RAIN, hum=40), dict(feels=15.0, prob=90, rain=RainType.RAIN, hum=90)),
("mood_song", dict(feels=15.0, prob=90, rain=RainType.RAIN, hum=40), dict(feels=15.0, prob=90, rain=RainType.RAIN, hum=90)),
("sunscreen", dict(feels=26.0, uv=6.0, sunshine_ratio=0.1), dict(feels=26.0, uv=6.0, sunshine_ratio=0.9)),
])
def test_added_factor_raises_the_score_in_the_direction_the_gak_means(code, calm, lively):
assert _seed_score(code, **lively) > _seed_score(code, **calm)
@pytest.mark.parametrize("code, good, bad", [
("golf", dict(feels=19.0, wind=2.0, hum=45), dict(feels=18.0, prob=80, rain=RainType.RAIN)),
("jipkok", dict(feels=4.0, prob=90, rain=RainType.RAIN, wind=7.0, hum=85), dict(feels=20.0, wind=1.0, hum=40)),
@@ -315,7 +465,7 @@ def test_seasonal_gak_good_day_high_bad_day_low(code, good, bad):
("mosquito", dict(feels=27.0, hum=85, wind=0.5), dict(feels=15.0, hum=40, wind=6.0)),
("tennis", dict(feels=18.0, wind=1.0, hum=45), dict(feels=18.0, prob=80, rain=RainType.RAIN)),
("hyodo", dict(feels=20.0, wind=1.5), dict(feels=20.0, prob=80, rain=RainType.RAIN)),
("thanks", dict(feels=0.0, prob=90, rain=RainType.RAIN), dict(feels=20.0)),
("thanks", dict(feels=0.0, prob=90, rain=RainType.RAIN, wind=6.0), dict(feels=20.0)),
("gift", dict(feels=17.0, wind=1.5), dict(feels=17.0, prob=80, rain=RainType.RAIN)),
("party", dict(feels=3.0, prob=90, rain=RainType.RAIN), dict(day=_WED, feels=20.0)),
("game", dict(feels=3.0, prob=90, rain=RainType.RAIN, pm25=70), dict(day=_WED, feels=20.0)),
@@ -360,6 +510,8 @@ def test_humidity_cap():
def test_axis_label_can_be_overridden():
assert axis_label("temp", {"temp": {"type": "higher", "label": "덜 추움"}}) == "덜 추움"
assert axis_label("rain", {"rain": {"dir": "dry", "label": "우산 안 쓰는 시간"}}) == "우산 안 쓰는 시간"
assert axis_label("rain", {"rain": {"dir": "dry"}}) == "비 안 옴"
def test_umbrella_lost_needs_rain_that_stopped():
@@ -372,6 +524,113 @@ def test_umbrella_lost_needs_rain_that_stopped():
assert evaluate(defn, [[_h(10, rain=RainType.RAIN)]], replace(CTX, rain_hours=frozenset({9, 10}))).score == 0
def _umbrella_defn():
"""우산각 방식: 요소는 비 하나. 지금 비가 오면 70점에서 시작해 남은 시각의 비 확률 평균으로 30점까지, 아니면 평균 × 100."""
return _defn(
weight_temp=0, weight_rain=100, weight_wind=0, weight_humidity=0, weight_air=0, weight_time=0,
factor_rules=_defn().factor_rules | {"rain": {"dir": "wet", "span": "rest_of_day", "now_base": 70}}, zero_rules=[],
)
def _umbrella(probs, raining_now, at_now=True):
"""11시부터 시각마다 비 확률 probs. raining_now 면 첫 시각(지금)에 비가 오는 중."""
hours = [_h(11 + i, prob=p, rain=RainType.RAIN if i == 0 and raining_now else RainType.NONE) for i, p in enumerate(probs)]
return evaluate(_umbrella_defn(), [hours], replace(CTX, at_now=at_now))
def test_umbrella_is_100_only_when_raining_now_and_every_remaining_hour_is_certain():
assert _umbrella([100] * 13, raining_now=True).score == 100
assert _umbrella([100] * 12 + [0], raining_now=True).score == 98
@pytest.mark.parametrize("probs, score", [([100] + [0] * 12, 72), ([100] * 4 + [0] * 9, 79)])
def test_umbrella_raining_now_starts_at_70_and_adds_up_to_30_by_remaining_hours(probs, score):
assert _umbrella(probs, raining_now=True).score == score
def test_umbrella_raining_now_counts_current_hour_as_certain_even_if_its_forecast_is_low():
assert _umbrella([40] + [0] * 12, raining_now=True).score == 72
@pytest.mark.parametrize("probs, score", [([0] * 7 + [100] * 6, 46), ([30] * 13, 30), ([100] * 13, 100), ([0] * 13, 0)])
def test_umbrella_not_raining_now_is_the_time_weighted_probability_out_of_100(probs, score):
assert _umbrella(probs, raining_now=False).score == score
def test_umbrella_has_no_raining_now_bonus_unless_the_evaluation_starts_now():
"""다른 구간·내일 칸은 '지금'이 없다. 첫 시각에 비가 와도 평균 × 100 만."""
assert _umbrella([100] + [0] * 12, raining_now=True, at_now=False).score == 8
def test_umbrella_note_says_it_counts_the_rest_of_the_day():
assert "남은 시간" in _umbrella([100] * 13, raining_now=True).notes["rain"]
assert "지금 비" in _umbrella([100] * 13, raining_now=True).notes["rain"]
assert "지금 비" not in _umbrella([30] * 13, raining_now=False).notes["rain"]
def test_umbrella_estimate_averages_the_window_hours_of_the_mid_forecast():
"""중기예보 날: 오전(~11시) 비 100%, 오후 0% 이면 6~23시 중 6시간 → 33점."""
r = estimate(_umbrella_defn(), _fc(am=100, pm=0), [list(range(6, 24))], CTX)
assert r.score == 33
def _lost(probs, raining_now, at_now=True):
"""우산분실각 방식: 우산을 챙겼을 정도(지금 비가 오면 100%, 아니면 남은 시각 중 가장 높은 비 확률) × 비가 안 오는 시간의 비율."""
defn = _defn(
weight_temp=0, weight_rain=100, weight_wind=0, weight_humidity=0, weight_air=0, weight_time=0,
factor_rules=_defn().factor_rules | {"rain": {"dir": "dry", "span": "rest_of_day", "kind": "unused"}}, zero_rules=[],
)
hours = [_h(11 + i, prob=p, rain=RainType.RAIN if i == 0 and raining_now else RainType.NONE) for i, p in enumerate(probs)]
return evaluate(defn, [hours], replace(CTX, at_now=at_now))
@pytest.mark.parametrize("probs, raining_now, score", [
([100] + [0] * 12, True, 92), # 지금 비 오고 곧 그침: 들고 나온 우산을 12/13 시간 안 씀
([0] * 7 + [100] * 6, False, 54), # 지금은 안 오는데 저녁에 비: 챙긴 우산을 7/13 시간 들고만 다님
([0] * 7 + [80] * 6, False, 50), # 저녁 비 80%: 챙겼을 정도 80% × 안 쓰는 시간 63%
([60] * 13, True, 37), # 지금 비 오고 계속 60%
([30] * 13, False, 21), # 하루 종일 30%: 챙겼을 정도 30% × 안 쓰는 시간 70%
([100] * 13, True, 0), # 하루 종일 비: 계속 쓰니 두고 올 일이 없음
([0] * 13, False, 0), # 비 소식 없음: 들고 나온 우산이 없음
])
def test_umbrella_lost_is_how_much_a_carried_umbrella_goes_unused(probs, raining_now, score):
assert _lost(probs, raining_now).score == score
def test_umbrella_lost_counts_raining_now_only_when_the_evaluation_starts_now():
"""지금 비가 오면 우산은 확실히 들고 있다(100%). 다른 구간·내일 칸은 '지금'이 없어 예보 확률만큼만."""
assert _lost([40] + [0] * 12, raining_now=True).score == 92
assert _lost([40] + [0] * 12, raining_now=True, at_now=False).score == 39
def test_umbrella_lost_note_shows_both_parts():
note = _lost([0] * 7 + [80] * 6, raining_now=False).notes["rain"]
assert "80%" in note and "63%" in note and "지금 비" not in note
assert "지금 비" in _lost([100] + [0] * 12, raining_now=True).notes["rain"]
def test_umbrella_lost_estimate_uses_the_mid_forecast_hours():
"""중기예보 날 9~21시: 오전(9~11시) 비 100%, 오후 0% → 챙겼을 정도 100% × 안 쓰는 시간 10/13 → 77점."""
defn = _defn(
weight_temp=0, weight_rain=100, weight_wind=0, weight_humidity=0, weight_air=0, weight_time=0,
factor_rules=_defn().factor_rules | {"rain": {"dir": "dry", "span": "rest_of_day", "kind": "unused"}}, zero_rules=[],
)
assert estimate(defn, _fc(am=100, pm=0), [list(range(9, 22))], CTX).score == 77
def test_umbrella_lost_seed_no_longer_scores_zero_while_it_rains():
"""운영에서 본 문제: 비가 오는 날은 하루 종일 0점이었다. 지금 비가 오고 저녁에 그치면 점수가 난다."""
hours = [_h(h, prob=100 if h < 18 else 10, rain=RainType.RAIN if h < 18 else RainType.NONE) for h in range(16, 24)]
r = evaluate(_SEED["umbrella_lost"], [hours], replace(CTX, at_now=True))
assert r.score == 68 and r.zero_reason is None # 16·17시 비, 18~23시 10%: 100 − (100×2 + 10×6) ÷ 8
def test_single_factor_gak_is_not_pulled_down_by_its_own_weakest_factor():
"""요소가 하나면 '가장 낮은 요소로 깎기'를 하지 않는다. 안 그러면 72점이 67점이 된다."""
r = _umbrella([100] + [0] * 12, raining_now=True)
assert r.score == r.factors["rain"] == 72
def test_weather_why_lists_every_condition_heaviest_first():
from services.index_service import WEATHER_SCORE_DEF, weather_why
+51 -1
View File
@@ -1,10 +1,13 @@
import json
from dataclasses import replace
from datetime import date, timedelta
from pathlib import Path
from types import SimpleNamespace
from common.enums import RainType, Sky
from common.utils.kma_time import kst_midnight
from services.calc.index_calc import Context, DayForecast
from services.index_service import day_result, slot_days, slot_label
from services.index_service import day_result, slot_days, slot_label, slot_results
REGION = SimpleNamespace(lat=37.56, lon=126.97)
SAT = date(2026, 10, 10)
@@ -18,6 +21,7 @@ DEFN = SimpleNamespace(
zero_rules=[], windows=[{"from": 11, "to": 16}],
)
FC = {SAT: DayForecast(temp_min_c=12, temp_max_c=22, rain_prob_am=10, rain_prob_pm=20, sky=Sky.CLEAR)}
RUNNING = SimpleNamespace(**next(x for x in json.loads((Path(__file__).parents[1] / "seed" / "index_definition.json").read_text(encoding="utf-8")) if x["code"] == "running"))
def _hourly(day: date) -> dict:
@@ -71,3 +75,49 @@ def test_partial_hourly_falls_back_to_estimate():
def test_no_mid_forecast_gives_no_score():
assert day_result(DEFN, SAT, REGION, {}, {}, CTX, short=False) is None
def test_running_slot_rain_outside_activity_hours_still_zero():
start = kst_midnight(SAT)
hourly = _hourly(SAT)
for row in hourly.values():
row.feels_c = 12
hourly[start + timedelta(hours=9)].rain_type = RainType.RAIN.value
results = slot_results(RUNNING, SAT, REGION, hourly, {}, CTX, start + timedelta(hours=18))
assert results["morning"].score == 0
assert results["morning"].zero_reason == "비 소식이 있어 0점"
assert results["night"].score >= 80
def test_running_slots_follow_the_weather_not_the_activity_hours():
"""낮이 낮은 건 25°가 더워서일 뿐이다. 활동 시간대(6~8시·19~22시) 밖이라는 이유의 점수 상한은 없다."""
start = kst_midnight(SAT)
hourly = _hourly(SAT) | _hourly(SAT + timedelta(days=1))
for row in hourly.values():
row.feels_c = 25 if 11 <= row.forecast_at.hour < 16 else 12
sunset = start + timedelta(hours=18)
results = slot_results(RUNNING, SAT, REGION, hourly, {}, CTX, sunset)
assert results["morning"].score >= 80 and results["night"].score >= 80 and results["early"].score >= 80
assert 50 < results["day"].score < results["morning"].score
late = slot_results(RUNNING, SAT, REGION, hourly, {}, CTX, sunset, now=start + timedelta(hours=22))
assert late["night"].score >= 80
def test_running_muggy_morning_does_not_exceed_original_weather_score():
start = kst_midnight(SAT)
hourly = _hourly(SAT)
for row in hourly.values():
row.feels_c, row.humidity, row.wind_ms = 20, 80, 1.5
results = slot_results(RUNNING, SAT, REGION, hourly, {}, replace(CTX, pm25=30), start + timedelta(hours=18))
assert results["morning"].factors["time"] == 100
assert results["morning"].score <= 67
def test_now_slot_summary_shows_current_hour_not_middle_of_rest():
"""오후 4시 10분이면 지금 구간 줄은 남은 16~18시의 가운데(5시)가 아니라 지금(4시) 날씨로."""
start = kst_midnight(SAT)
hourly = _hourly(SAT) | _hourly(SAT + timedelta(days=1))
sunset = start + timedelta(hours=17, minutes=30)
results = slot_results(RUNNING, SAT, REGION, hourly, {}, CTX, sunset, now=start + timedelta(hours=16, minutes=10))
assert results["evening"].summary.startswith("오후 4시"), results["evening"].summary
assert results["night"].summary.startswith("오후 4시") is False
+36 -2
View File
@@ -1,8 +1,8 @@
from datetime import datetime
from common.enums import RainType, Sky
from common.utils.kma_time import KST, latest_ultra_base, latest_vilage_base
from services.external.kma import parse_amount, parse_vilage
from common.utils.kma_time import KST, latest_ncst_base, latest_ultra_base, latest_vilage_base
from services.external.kma import parse_amount, parse_ncst, parse_vilage
def _kst(y, mo, d, h, mi=0):
@@ -23,6 +23,40 @@ def test_latest_ultra_base_available_from_45_minutes():
assert latest_ultra_base(_kst(2026, 10, 1, 10, 45)) == _kst(2026, 10, 1, 10, 30)
def test_latest_ncst_base_available_from_10_minutes():
assert latest_ncst_base(_kst(2026, 10, 1, 10, 9)) == _kst(2026, 10, 1, 9)
assert latest_ncst_base(_kst(2026, 10, 1, 10, 10)) == _kst(2026, 10, 1, 10)
assert latest_ncst_base(_kst(2026, 10, 1, 0, 5)) == _kst(2026, 9, 30, 23)
# 2026-11-23 14시 서울 실황 응답 그대로
_NCST = {"PTY": "1", "REH": "78", "RN1": "0.3", "T1H": "9.8", "UUU": "1.1", "VEC": "194", "VVV": "4.4", "WSD": "4.5"}
def _ncst(**override):
return [{"baseDate": "20261123", "baseTime": "1400", "category": c, "nx": 60, "ny": 127, "obsrValue": v} for c, v in (_NCST | override).items()]
def test_parse_ncst_reads_what_is_observed_now():
assert parse_ncst(_ncst()) == {"rain_type": RainType.RAIN, "rain_mm": 0.3, "temp_c": 9.8, "humidity": 78, "wind_ms": 4.5}
def test_parse_ncst_reads_no_rain_and_drizzle_codes():
assert parse_ncst(_ncst(PTY="0", RN1="0"))["rain_type"] is RainType.NONE
assert [parse_ncst(_ncst(PTY=c))["rain_type"] for c in ("5", "6", "7")] == [RainType.RAIN, RainType.SLEET, RainType.SNOW]
def test_parse_ncst_without_every_value_is_nothing():
assert parse_ncst([]) is None
assert parse_ncst([i for i in _ncst() if i["category"] != "T1H"]) is None
def test_parse_ncst_treats_900_or_more_as_missing():
"""가이드: +900 이상, -900 이하 값은 결측."""
for category, value in (("T1H", "-999"), ("WSD", "900"), ("REH", "-999"), ("RN1", "-999")):
assert parse_ncst(_ncst(**{category: value})) is None, category
def test_parse_amount_text():
assert parse_amount("강수없음") == 0
assert parse_amount("1mm 미만") == 0.5
+148
View File
@@ -0,0 +1,148 @@
from datetime import datetime, timedelta
from types import SimpleNamespace
import pytest
import services.weather_service as weather_service
from common.database.model.models import WeatherHourly
from common.enums import RainType, Sky
from common.utils.kma_time import KST
from services.calc.weather_calc import discomfort_index, feels_like_c
from services.external.data_go_kr import DataGoKrRequestFailed
from services.weather_service import Observed, observed_now, with_observed
REGION = SimpleNamespace(code="1", nx=60, ny=127)
def _at(h: int, mi: int = 0) -> datetime:
return datetime(2026, 10, 8, 0, 0, tzinfo=KST) + timedelta(hours=h, minutes=mi)
def _hourly(h: int) -> WeatherHourly:
return WeatherHourly(
region_code="1", forecast_at=_at(h), temp_c=21, feels_c=21, discomfort_index=60, sky=Sky.CLOUDY.value, rain_type=RainType.NONE.value,
rain_prob=30, rain_mm=0, humidity=60, wind_ms=1.0, issued_at=_at(h),
)
_OBS = Observed(at=_at(14), rain_type=RainType.RAIN, rain_mm=0.3, temp_c=9.8, humidity=78, wind_ms=4.5)
def test_observed_replaces_the_observed_hour_with_what_is_measured():
rows = {r.forecast_at: r for r in (_hourly(13), _hourly(14), _hourly(15))}
r = with_observed(rows, _OBS)[_at(14)]
assert (r.rain_type, float(r.rain_mm), float(r.temp_c), r.humidity, float(r.wind_ms)) == (RainType.RAIN.value, 0.3, 9.8, 78, 4.5)
assert float(r.feels_c) == feels_like_c(9.8, 78, 4.5, 10) and r.discomfort_index == discomfort_index(9.8, 78)
def test_observed_keeps_forecast_only_values_and_other_hours():
rows = {r.forecast_at: r for r in (_hourly(13), _hourly(14), _hourly(15))}
out = with_observed(rows, _OBS)
assert (out[_at(14)].rain_prob, out[_at(14)].sky) == (30, Sky.CLOUDY.value)
assert out[_at(13)] is rows[_at(13)] and out[_at(15)] is rows[_at(15)]
assert rows[_at(14)].rain_type == RainType.NONE.value # 원본은 그대로
def test_observed_does_nothing_without_an_observation_or_the_hours_row():
rows = {_at(13): _hourly(13)}
assert with_observed(rows, None) == rows
assert with_observed(rows, _OBS) == rows
def _line(**kw):
from services.calc.index_calc import Hour, summary_line
base = dict(hour=16, feels_c=11.0, rain_type=RainType.NONE, rain_prob=60, wind_ms=1.5, humidity=90, sky=Sky.CLOUDY)
return summary_line(Hour(**{**base, **kw}))
def test_observed_hour_line_says_it_is_raining_instead_of_a_probability():
"""실황은 관측이라 확률이 없다. 지금 비가 오면 '비 60%' 가 아니라 오는 중이라고 쓴다."""
assert _line(observed=True, rain_type=RainType.RAIN) == "오후 4시 11°, 비 오는 중"
assert _line(observed=True, rain_type=RainType.SHOWER) == "오후 4시 11°, 비 오는 중"
assert _line(observed=True, rain_type=RainType.SNOW) == "오후 4시 11°, 눈 오는 중"
assert _line(observed=True, rain_type=RainType.SLEET) == "오후 4시 11°, 진눈깨비 오는 중"
def test_observed_hour_line_without_rain_never_shows_a_probability():
"""관측으로 비가 없으면 예보 확률이 60% 여도 확률을 쓰지 않는다."""
assert _line(observed=True) == "오후 4시 11°, 바람 살랑"
assert _line(observed=True, wind_ms=None) == "오후 4시 11°, 흐림"
def test_forecast_hour_line_keeps_the_probability():
assert _line() == "오후 4시 11°, 비 60%"
assert _line(rain_type=RainType.RAIN) == "오후 4시 11°, 비 60%"
def test_only_the_observed_row_is_marked_observed():
from services.index_service import _hour
rows = {r.forecast_at: r for r in (_hourly(13), _hourly(14))}
out = with_observed(rows, _OBS)
assert _hour(out[_at(14)]).observed is True and _hour(out[_at(13)]).observed is False
def test_current_slot_line_of_a_gak_uses_the_observed_rain():
from datetime import date
from services.calc.index_calc import Context
from services.index_service import slot_results
day = date(2026, 10, 8)
defn = SimpleNamespace(
weight_temp=50, weight_rain=50, weight_wind=0, weight_humidity=0, weight_air=0, weight_time=0,
factor_rules={"temp": {"type": "range", "lo": 18, "hi": 24}, "rain": {"dir": "dry"}, "wind": {"type": "ignore"},
"humidity": {"type": "ignore"}, "time": {"type": "fixed", "value": 100}},
zero_rules=[], windows=[{"from": 9, "to": 20}],
)
ctx = Context(day=day, is_holiday=False, pm25=10, air_label="좋음", moon=0, sunset_score=None, wind_warning=False, lookahead_rain_prob=0)
by_at = with_observed({r.forecast_at: r for r in (_hourly(h) for h in range(5, 24))}, _OBS)
parts = slot_results(defn, day, SimpleNamespace(lat=37.5, lon=127.0), by_at, {}, ctx, _at(18), _at(14, 20))
assert parts["day"].summary == "오후 2시 8°, 비 오는 중"
_ITEMS = [{"category": c, "obsrValue": v} for c, v in {"PTY": "1", "REH": "78", "RN1": "0.3", "T1H": "9.8", "WSD": "4.5"}.items()]
@pytest.fixture
def ncst_calls(monkeypatch):
calls = []
async def fetch(client, nx, ny, base):
calls.append(base)
return _ITEMS
monkeypatch.setattr(weather_service, "fetch_ncst", fetch)
return calls
@pytest.mark.anyio
async def test_observed_now_reads_the_latest_hour_and_keeps_it_for_that_hour(ncst_calls):
first = await observed_now(REGION, _at(14, 20))
again = await observed_now(REGION, _at(14, 50))
assert first == again == _OBS
assert ncst_calls == [_at(14)]
@pytest.mark.anyio
async def test_observed_now_asks_again_when_a_new_hour_is_out(ncst_calls):
await observed_now(REGION, _at(14, 20))
await observed_now(REGION, _at(15, 5)) # 15시 실황은 15:10부터라 아직 14시 것
assert ncst_calls == [_at(14)]
await observed_now(REGION, _at(15, 10))
assert ncst_calls == [_at(14), _at(15)]
@pytest.mark.anyio
async def test_observed_now_is_nothing_when_the_api_fails_or_answers_with_gaps(monkeypatch):
async def down(*_a):
raise DataGoKrRequestFailed("down")
async def gaps(*_a):
return [i for i in _ITEMS if i["category"] != "T1H"]
monkeypatch.setattr(weather_service, "fetch_ncst", down)
assert await observed_now(REGION, _at(14, 20)) is None
monkeypatch.setattr(weather_service, "fetch_ncst", gaps)
assert await observed_now(REGION, _at(14, 20)) is None
+1 -1
View File
@@ -25,7 +25,7 @@ def test_calibrated_outing_reads_the_table():
def test_day_score_uses_calibrated_value_for_hourly_and_estimated_results():
for estimated in (False, True):
r = Outing(score=80, factors={}, notes={}, reason="비 0% · 체감 21° · 맑음", capped=False, estimated=estimated)
r = Outing(score=80, factors={}, notes={}, reason="비 0% · 체감 21° · 맑음", estimated=estimated)
assert outing_day_score(r) == OUTING_SCORE_TABLE[80]
+1
View File
@@ -16,6 +16,7 @@ ENDPOINTS = ["/v1/feed", "/v1/weather/today", "/v1/weather/now", "/v1/sky", "/v1
SOURCES = {
"vilage": (weather_service, "fetch_vilage", DataGoKrRequestFailed),
"ultra": (weather_service, "fetch_ultra", DataGoKrRequestFailed),
"ncst": (weather_service, "fetch_ncst", DataGoKrRequestFailed),
"air": (air_service, "fetch_realtime", DataGoKrRequestFailed),
"warning": (warning_service, "fetch_warning_events", DataGoKrRequestFailed),
"clouds": (sky_service, "fetch_clouds", OpenMeteoRequestFailed),
+1 -1
View File
@@ -36,7 +36,7 @@ async def test_reading_for_anyone_gives_me_today_and_cards(offline):
assert [p["stem"] + p["branch"] for p in r["me"]["pillars"]] == ["乙亥", "己卯", "甲辰"] and r["me"]["hour_known"] is False
assert r["me"]["scene"].endswith("기운") and r["today"]["title"] and 0 <= r["today"]["score"] <= 100
assert [(p.get("stem_ten_god"), p["branch_ten_god"]) for p in r["me"]["pillars"]] == [("겁재", "편인"), ("정재", "겁재"), (None, "편재")]
assert r["me"]["top_element"] == "木" and r["me"]["strong"] is True and r["me"]["elements"]["木"] == 58.3
assert r["me"]["top_element"] == "木" and r["me"]["strong"] is True and r["me"]["strength"] == "신강" and r["me"]["elements"]["木"] == 58.3
kinds = [x["kind"] for x in r["today"]["cards"]]
assert "when" in kinds and "do" in kinds and "wear" in kinds
# 근거 줄은 쉬운 말 + 괄호 용어, 숫자 없이
+9
View File
@@ -269,6 +269,15 @@ def test_summer_earth_chart_reads_hot_and_dry_not_rainy():
assert climate.strength.top == "土" and climate.strength.strong
def test_month_rooted_day_master_stays_strong_whatever_the_hour():
# 未월 己土는 득령(월령 土) — 시주가 물·쇠라도 신강, 득령 없는 같은 몫이면 낮게
for h in range(0, 24, 2):
s = chart_strength(make_chart(date(1959, 7, 16), time(h, 30)))
assert s.deuk_ryeong and s.label == "신강", (h, s)
winter = chart_strength(make_chart(date(1959, 12, 20))) # 子월 — 己土 득령 아님
assert not winter.deuk_ryeong
def test_month_dries_summer_earth_and_soaks_winter_earth():
assert seasoned("己", "未")[1] < 0 < seasoned("己", "子")[1]
assert seasoned("壬", "未")[0] > seasoned("壬", "子")[0]
+70 -2
View File
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import date, datetime
import pytest
from httpx import ASGITransport, AsyncClient
@@ -7,7 +7,8 @@ from common.utils.kma_time import KST
from common.database.model.models import WeatherHourly
from router.router import app
from router.v1.feed.protocol import Bands, Hero, HeroStat, Res_Feed, TopIndex
from services.seo_service import SeoService, day_summary, fill, today_line, tomorrow_line
from services import seo_service
from services.seo_service import SeoService, day_summary, fill, today_copy, today_line, tomorrow_copy, tomorrow_line
REGION = "1114000000"
TEMPLATE = (
@@ -55,6 +56,7 @@ def test_fill_keeps_template_when_no_weather():
@pytest.mark.anyio
async def test_today_page_fills_real_feed(offline, monkeypatch):
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset())
async def template(self, path):
return TEMPLATE if path == "today/seoul/jung" else None
@@ -69,6 +71,7 @@ async def test_today_page_fills_real_feed(offline, monkeypatch):
@pytest.mark.anyio
async def test_gu_page_of_city_has_its_own_address(offline, monkeypatch):
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset())
async def template(self, path):
return TEMPLATE if path == "today/gyeonggi/seongnam/bundang" else None
@@ -86,6 +89,7 @@ def test_tomorrow_line_has_day_and_sunset():
@pytest.mark.anyio
async def test_tomorrow_page_fills_tomorrow_forecast(offline, monkeypatch):
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset())
tmpl = TEMPLATE.replace("오늘 날씨", "내일 날씨")
async def template(self, path):
@@ -98,3 +102,67 @@ async def test_tomorrow_page_fills_tomorrow_forecast(offline, monkeypatch):
assert page.status_code == 200 and "<h1>서울 중구 내일 날씨, 뭐 할까?</h1><p>최저 " in page.text
assert "지금 " not in page.text and "<ol>" not in page.text
assert missing.status_code == 404
def test_today_copy_has_date_place_morning_day_firsts_and_status():
line = today_copy(date(2026, 10, 14), "중구", _feed(), [_hour(12, 19.5, prob=10)], datetime(2026, 10, 14, 17, 52, tzinfo=KST))
assert line == "10월 14일(수) 중구 오늘 날씨: 최저 20°·최고 20°, 비 올 확률 10%. 아침엔 러닝각, 낮엔 빨래각이 1위예요. 미세먼지 좋음, 해 지는 시각 오후 5시 52분."
same = _feed()
same.stories = [_top("캠핑각", 90, {"morning": 1, "day": 1})]
assert "아침·낮엔 캠핑각이 1위예요." in today_copy(date(2026, 10, 14), "중구", same, [], None)
def test_today_copy_lists_dust_discomfort_uv_in_order():
feed = _feed()
feed.hero.status = [HeroStat(icon="m", label=label, value=value, tone="normal") for label, value in (("습도", "보통"), ("불쾌지수", "쾌적"), ("자외선", "보통"), ("미세먼지", "보통"))]
line = today_copy(date(2026, 10, 30), "성남시", feed, [_hour(12, 18, rain=2, prob=60)], None)
assert line.endswith("미세먼지 보통, 불쾌지수 쾌적, 자외선 보통.")
assert "습도" not in line
def test_tomorrow_copy_has_date_place_top1_and_sunset():
sunset = datetime(2026, 10, 31, 17, 36, tzinfo=KST)
line = tomorrow_copy(date(2026, 10, 31), "평택시", [_hour(12, 15, prob=30)], "빨래각", sunset)
assert line == "10월 31일(토) 평택시 내일 날씨: 최저 15°·최고 15°, 맑음, 비 올 확률 30%. 내일 하기 좋은 일 1위는 빨래각, 해 지는 시각은 오후 5시 36분이에요."
on_hour = tomorrow_copy(date(2026, 10, 31), "평택시", [_hour(12, 15)], None, datetime(2026, 10, 31, 18, 0, tzinfo=KST))
assert on_hour.endswith("해 지는 시각은 오후 6시예요.")
assert tomorrow_copy(date(2026, 10, 31), "평택시", [], "빨래각", sunset) == ""
@pytest.mark.anyio
async def test_new_copy_pages_get_new_title_and_description(offline, monkeypatch):
tomorrow = TEMPLATE.replace("오늘 날씨", "내일 날씨").replace("</head>", "<title>중구 내일 날씨, 뭐 할까? · 서울 | 날씨각</title></head>")
async def template(self, path):
return {"today/seoul/jung": TEMPLATE, "tomorrow/seoul/jung": tomorrow}.get(path)
monkeypatch.setattr(SeoService, "template", template)
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset({"today/seoul/jung", "tomorrow/seoul/jung"}))
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
today = await client.get("/v1/seo/today/seoul/jung")
ahead = await client.get("/v1/seo/tomorrow/seoul/jung")
assert today.status_code == 200 and ahead.status_code == 200
assert '<meta name="description" content="10월 ' in today.text and " 중구 오늘 날씨: 최저 " in today.text
assert "<ol><li>" in today.text and '<meta name="seo-copy" content="new" />' in today.text
assert " 중구 내일 날씨: 최저 " in ahead.text and "해 지는 시각은 오후" in ahead.text
assert "<title>중구 내일 날씨 · 내일 1위는 " in ahead.text and 'property="og:description" content="10월 ' in ahead.text
assert '<meta name="seo-copy" content="new" />' in ahead.text
@pytest.mark.anyio
async def test_old_copy_pages_keep_old_text_and_are_marked(offline, monkeypatch):
async def template(self, path):
return TEMPLATE if path == "today/seoul/jung" else None
monkeypatch.setattr(SeoService, "template", template)
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset())
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
page = await client.get("/v1/seo/today/seoul/jung")
assert "<h1>서울 중구 오늘 날씨, 뭐 할까?</h1><p>최저 " in page.text
assert '<meta name="seo-copy" content="old" />' in page.text
def test_copy_test_groups_split_region_pages_in_half():
assert seo_service.NEW_COPY and all(p.startswith(("today/", "tomorrow/")) for p in seo_service.NEW_COPY)
today = sum(p.startswith("today/") for p in seo_service.NEW_COPY)
assert today == len(seo_service.NEW_COPY) - today
+26
View File
@@ -82,6 +82,32 @@ async def test_reports_hide_and_block_hides_author():
assert t["talk_id"] not in [x["talk_id"] for x in (await c.get("/v1/talk/list")).json()["talks"]]
@pytest.mark.anyio
async def test_talk_comments_need_login_and_keep_count_on_talk():
async with client() as c:
h = await _login(c, "talk_c1")
t = (await _write(c, h))["talk"]
url = f"/v1/reaction/talk/{t['talk_id']}/comment"
count = lambda talks: next(x for x in talks if x["talk_id"] == t["talk_id"])["comment_count"] # noqa: E731
assert (await c.post(url, json={"body": "저도 봤어요"})).status_code == 401
other = await _login(c, "talk_c2")
assert (await c.post(url, headers=other, json={"body": "저도 봤어요"})).json()["result"]["desc"] == "TERMS_REQUIRED"
await c.post("/v1/auth/terms", headers=other)
assert (await c.post(url, headers=other, json={"body": "연락 010-1234-5678"})).json()["result"]["desc"] == "LINK_NOT_ALLOWED"
assert (await c.post(url, headers=other, json={"body": "가" * 61})).json()["result"]["desc"] == "INVALID_INPUT"
made = (await c.post(url, headers=other, json={"body": " 저도 봤어요 "})).json()["comment"]
assert made["body"] == "저도 봤어요" and made["mine"] is True
listed = (await c.get(f"{url}/list")).json()["comments"]
assert [x["comment_id"] for x in listed] == [made["comment_id"]] and listed[0]["nickname"] == "talk_c2"
assert count((await c.get("/v1/talk/list")).json()["talks"]) == 1
assert (await c.delete(f"/v1/reaction/comment/{made['comment_id']}", headers=other)).json()["result"]["success"] is True
assert (await c.get(f"{url}/list")).json()["comments"] == []
assert count((await c.get("/v1/talk/list")).json()["talks"]) == 0
assert (await c.post("/v1/reaction/talk/999999999/comment", headers=other, json={"body": "안녕"})).json()["result"]["desc"] == "NOT_FOUND"
def test_weather_line():
class Row:
temp_c, sky, rain_type = 18.4, 1, 1
+29
View File
@@ -83,6 +83,35 @@ async def test_now_combines_rain_tomorrow_air_and_warnings(monkeypatch, clean):
assert body["warnings"] == [{"warning_type": 4, "level": 1, "text": "건조주의보"}]
def test_rain_text_says_it_is_raining_now_when_observed():
"""지금 비가 오는 중이면 '몇 시쯤 비가 와요'가 아니라 지금 온다고 쓴다. 관측이 없거나 비가 없으면 앞으로 2시간 예보대로."""
from common.enums import RainType
from services.now_service import _rain_2h_text
from services.weather_service import RainHour
at = now_kst().replace(hour=17, minute=0, second=0, microsecond=0)
later = [RainHour(at=at, rain_type=RainType.RAIN, rain_mm=1.0)]
assert _rain_2h_text(later, RainType.RAIN) == (True, "지금 비가 와요. 우산 챙기세요")
assert _rain_2h_text([], RainType.SNOW) == (True, "지금 눈이 와요. 우산 챙기세요")
assert _rain_2h_text([], RainType.SLEET) == (True, "지금 진눈깨비가 와요. 우산 챙기세요")
assert _rain_2h_text(later, RainType.NONE) == (True, "오후 5시쯤 비가 와요. 우산 챙기세요")
assert _rain_2h_text(later, None) == (True, "오후 5시쯤 비가 와요. 우산 챙기세요")
assert _rain_2h_text([], None) == (False, "앞으로 2시간, 우산 없어도 돼요")
@pytest.mark.anyio
async def test_now_says_raining_now_from_the_observed_weather(monkeypatch, clean):
"""앞으로 2시간 예보엔 비가 없어도 실황이 비를 관측했으면 지금 비가 온다고 알린다."""
monkeypatch.setattr(weather_service, "fetch_vilage", lambda *a: _async(_vilage()))
monkeypatch.setattr(weather_service, "fetch_ultra", lambda *a: _async(_ultra()))
monkeypatch.setattr(weather_service, "fetch_ncst", lambda *a: _async(
[{"category": c, "obsrValue": v} for c, v in {"PTY": "1", "REH": "96", "RN1": "2.5", "T1H": "9.8", "WSD": "2.3"}.items()]
))
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
body = (await client.get("/v1/weather/now", params={"region": REGION})).json()
assert body["rain_2h"]["will_rain"] is True and body["rain_2h"]["text"] == "지금 비가 와요. 우산 챙기세요"
@pytest.mark.anyio
async def test_now_warning_failure_is_unknown_not_none(monkeypatch, clean):
from services.external.data_go_kr import DataGoKrRequestFailed
+25
View File
@@ -67,6 +67,31 @@ async def test_today_fetches_stores_and_returns_8_slots(monkeypatch, clean_regio
assert len(calls) == 2
@pytest.mark.anyio
async def test_today_current_hour_shows_the_observed_weather(monkeypatch, clean_region):
"""실황이 있으면 지금이 든 칸은 지금 시각 예보(맑음·18도) 대신 관측한 비·기온을 보인다. 다른 칸은 예보 그대로."""
now = kst_midnight(now_kst().date()) + timedelta(hours=14, minutes=20)
observed = [{"category": c, "obsrValue": v} for c, v in {"PTY": "1", "REH": "78", "RN1": "0.3", "T1H": "9.8", "WSD": "4.5"}.items()]
async def fake_vilage(client, nx, ny, base):
return _fake_items(base)
async def no_ultra(*_a):
return []
async def fake_ncst(*_a):
return observed
monkeypatch.setattr(weather_service, "now_kst", lambda: now)
monkeypatch.setattr(weather_service, "fetch_vilage", fake_vilage)
monkeypatch.setattr(weather_service, "fetch_ultra", no_ultra)
monkeypatch.setattr(weather_service, "fetch_ncst", fake_ncst)
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
slots = (await client.get("/v1/weather/today", params={"region": REGION})).json()["slots"]
assert (slots[4]["label"], slots[4]["temp_c"], slots[4]["icon"]) == ("12시", 9.8, "rain")
assert all(s["temp_c"] == 18 for i, s in enumerate(slots) if i != 4)
@pytest.mark.anyio
async def test_today_second_call_uses_db_without_fetching(monkeypatch, clean_region):
calls = []
+6
View File
@@ -17,6 +17,12 @@ if [ -z "${DEPLOY_PULLED:-}" ]; then
fi
docker compose up -d --wait postgres redis
docker compose exec -T postgres psql -q -v ON_ERROR_STOP=1 -U "$DB_USER" -d "$DB_NAME" < backend/postgres-init/init.sql
# 지금 빌드 파일을 모아 새 이미지에 같이 넣는다. 배포로 지우면 열어 둔 탭과 구글 렌더가 예전 HTML 로 없는 파일을 불러 첫 화면에서 멈춘다 (2주 지난 건 지움)
mkdir -p frontend/.old-assets
if [ -n "$(docker compose ps -q frontend)" ]; then
docker compose cp frontend:/usr/share/nginx/html/assets/. frontend/.old-assets/
fi
find frontend/.old-assets -type f ! -name .gitkeep -mtime +14 -delete
docker compose up -d --build backend worker frontend
docker compose exec -T backend python scripts/load_seed.py
# 피드 캐시는 최대 1시간이라, 각 규칙이 바뀌어도 오늘 탭만 옛 순위로 남는다
+3 -1
View File
@@ -6,7 +6,9 @@
- [ ] 사이트 데이터를 지우고 접속 → 위치 권한을 묻고, 상단 지역 버튼 자리에 스켈레톤 막대
- [ ] 위치 허용 → 가장 가까운 구로 바뀐다 / 거부 → 기본 "서울 마포구"
- [ ] 새로고침 → 위치를 다시 묻지 않고 마지막 지역 그대로
- [ ] 새로고침 → 권한 창 없이 마지막 지역이 바로 보인다
- [ ] 위치로 맞춘 뒤 다른 구로 옮겨 새로고침(또는 탭으로 돌아옴) → 스켈레톤 없이 지금 있는 구로 바뀐다 (1분 안에는 다시 읽지 않음)
- [ ] 목록에서 고른 뒤 새로고침 → 위치와 달라도 고른 지역 그대로. "지금 위치로 찾기"를 누르면 다시 위치를 따라간다
## 1. 공통: 상단 바·하단 탭
@@ -0,0 +1,79 @@
오늘 날씨 1241842B - 1242089B -
내일 날씨 1255827B - 1241265B -
모레 날씨 1146464B - 1150726B -
이번주 날씨 1290799B - 1290981B -
주말 날씨 1306886B - 1307070B -
날씨 1404122B - 1404306B -
서울 오늘 날씨 1241948B - 1242134B -
서울 내일 날씨 1282168B - 1282348B -
서울 날씨 985505B - 985689B -
부산 오늘 날씨 1264133B - 1264313B -
부산 내일 날씨 1265164B - 1265344B -
부산 날씨 1213605B - 1213787B -
인천 오늘 날씨 1300790B - 1300974B -
인천 내일 날씨 1293527B - 1293711B -
인천 날씨 1260461B - 1260641B -
대구 오늘 날씨 1244846B - 1245026B -
대구 내일 날씨 1305698B - 1305880B -
대구 날씨 1231166B - 1231339B -
대전 오늘 날씨 1260892B - 1261079B -
대전 내일 날씨 1315087B - 1315271B -
대전 날씨 1317624B - 1317802B -
광주 오늘 날씨 1277429B - 1277605B -
광주 내일 날씨 1282066B - 1282246B -
광주 날씨 1265430B - 1265611B -
울산 오늘 날씨 1238077B - 1238262B -
울산 내일 날씨 1213012B - 1213192B -
울산 날씨 1257139B - 1257323B -
세종 오늘 날씨 1335637B - 1335817B -
세종 내일 날씨 1244726B - 1244912B -
세종 날씨 1350300B - 1350480B -
수원 오늘 날씨 1238160B - 1238344B -
수원 내일 날씨 1228071B - 1228249B -
수원 날씨 1348504B - 1348684B -
성남 오늘 날씨 1279860B - 1280042B -
성남 내일 날씨 1189405B - 1189593B -
성남 날씨 1239403B - 1239585B -
고양 오늘 날씨 1286139B - 1286317B -
고양 내일 날씨 1208419B - 1208605B -
고양 날씨 1277571B - 1277753B -
용인 오늘 날씨 1200469B - 1200659B -
용인 내일 날씨 1236616B - 1236798B -
용인 날씨 1368350B - 1368532B -
창원 오늘 날씨 1244725B - 1244903B -
창원 내일 날씨 1203664B - 1203844B -
창원 날씨 1280151B - 1280329B -
청주 오늘 날씨 1302209B - 1302391B -
청주 내일 날씨 1278427B - 1278611B -
청주 날씨 1368258B - 1368442B -
천안 오늘 날씨 1236997B - 1237182B -
천안 내일 날씨 1243104B - 1243289B -
천안 날씨 1319722B - 1319904B -
전주 오늘 날씨 1800004B - 1800190B -
전주 내일 날씨 1783583B - 1783765B -
전주 날씨 1261004B - 1261188B -
군산 오늘 날씨 1282946B - 1283130B -
군산 내일 날씨 1271879B - 1272061B -
군산 날씨 1267946B - 1268128B -
포항 오늘 날씨 1279182B - 1279362B -
포항 내일 날씨 1261670B - 1261854B -
포항 날씨 1308817B - 1309003B -
제주 오늘 날씨 1253715B - 1253895B -
제주 내일 날씨 1334766B - 1334942B -
제주 날씨 1308240B - 1308434B -
김해 오늘 날씨 1221203B - 1221389B -
김해 내일 날씨 1221664B - 1221844B -
김해 날씨 1287333B - 1287517B -
화성 오늘 날씨 1249282B - 1249468B -
화성 내일 날씨 1233491B - 1233673B -
화성 날씨 997204B - 997384B -
부천 오늘 날씨 924121B - 924303B -
부천 내일 날씨 1239101B - 1239281B -
부천 날씨 1060555B - 1060741B -
안산 오늘 날씨 1271510B - 1271690B -
안산 내일 날씨 1590933B - 1591114B -
안산 날씨 1273204B - 1273392B -
남양주 오늘 날씨 1240661B - 1240841B -
남양주 내일 날씨 1263026B - 1263214B -
남양주 날씨 1308914B - 1309096B -
날씨각 612597B 1 https://weather.o2o.kr/tomorrow/incheon/namdong 612783B 1 https://weather.o2o.kr/tomorrow/incheon/namdong
1 오늘 날씨 1241842B - 1242089B -
2 내일 날씨 1255827B - 1241265B -
3 모레 날씨 1146464B - 1150726B -
4 이번주 날씨 1290799B - 1290981B -
5 주말 날씨 1306886B - 1307070B -
6 날씨 1404122B - 1404306B -
7 서울 오늘 날씨 1241948B - 1242134B -
8 서울 내일 날씨 1282168B - 1282348B -
9 서울 날씨 985505B - 985689B -
10 부산 오늘 날씨 1264133B - 1264313B -
11 부산 내일 날씨 1265164B - 1265344B -
12 부산 날씨 1213605B - 1213787B -
13 인천 오늘 날씨 1300790B - 1300974B -
14 인천 내일 날씨 1293527B - 1293711B -
15 인천 날씨 1260461B - 1260641B -
16 대구 오늘 날씨 1244846B - 1245026B -
17 대구 내일 날씨 1305698B - 1305880B -
18 대구 날씨 1231166B - 1231339B -
19 대전 오늘 날씨 1260892B - 1261079B -
20 대전 내일 날씨 1315087B - 1315271B -
21 대전 날씨 1317624B - 1317802B -
22 광주 오늘 날씨 1277429B - 1277605B -
23 광주 내일 날씨 1282066B - 1282246B -
24 광주 날씨 1265430B - 1265611B -
25 울산 오늘 날씨 1238077B - 1238262B -
26 울산 내일 날씨 1213012B - 1213192B -
27 울산 날씨 1257139B - 1257323B -
28 세종 오늘 날씨 1335637B - 1335817B -
29 세종 내일 날씨 1244726B - 1244912B -
30 세종 날씨 1350300B - 1350480B -
31 수원 오늘 날씨 1238160B - 1238344B -
32 수원 내일 날씨 1228071B - 1228249B -
33 수원 날씨 1348504B - 1348684B -
34 성남 오늘 날씨 1279860B - 1280042B -
35 성남 내일 날씨 1189405B - 1189593B -
36 성남 날씨 1239403B - 1239585B -
37 고양 오늘 날씨 1286139B - 1286317B -
38 고양 내일 날씨 1208419B - 1208605B -
39 고양 날씨 1277571B - 1277753B -
40 용인 오늘 날씨 1200469B - 1200659B -
41 용인 내일 날씨 1236616B - 1236798B -
42 용인 날씨 1368350B - 1368532B -
43 창원 오늘 날씨 1244725B - 1244903B -
44 창원 내일 날씨 1203664B - 1203844B -
45 창원 날씨 1280151B - 1280329B -
46 청주 오늘 날씨 1302209B - 1302391B -
47 청주 내일 날씨 1278427B - 1278611B -
48 청주 날씨 1368258B - 1368442B -
49 천안 오늘 날씨 1236997B - 1237182B -
50 천안 내일 날씨 1243104B - 1243289B -
51 천안 날씨 1319722B - 1319904B -
52 전주 오늘 날씨 1800004B - 1800190B -
53 전주 내일 날씨 1783583B - 1783765B -
54 전주 날씨 1261004B - 1261188B -
55 군산 오늘 날씨 1282946B - 1283130B -
56 군산 내일 날씨 1271879B - 1272061B -
57 군산 날씨 1267946B - 1268128B -
58 포항 오늘 날씨 1279182B - 1279362B -
59 포항 내일 날씨 1261670B - 1261854B -
60 포항 날씨 1308817B - 1309003B -
61 제주 오늘 날씨 1253715B - 1253895B -
62 제주 내일 날씨 1334766B - 1334942B -
63 제주 날씨 1308240B - 1308434B -
64 김해 오늘 날씨 1221203B - 1221389B -
65 김해 내일 날씨 1221664B - 1221844B -
66 김해 날씨 1287333B - 1287517B -
67 화성 오늘 날씨 1249282B - 1249468B -
68 화성 내일 날씨 1233491B - 1233673B -
69 화성 날씨 997204B - 997384B -
70 부천 오늘 날씨 924121B - 924303B -
71 부천 내일 날씨 1239101B - 1239281B -
72 부천 날씨 1060555B - 1060741B -
73 안산 오늘 날씨 1271510B - 1271690B -
74 안산 내일 날씨 1590933B - 1591114B -
75 안산 날씨 1273204B - 1273392B -
76 남양주 오늘 날씨 1240661B - 1240841B -
77 남양주 내일 날씨 1263026B - 1263214B -
78 남양주 날씨 1308914B - 1309096B -
79 날씨각 612597B 1 https://weather.o2o.kr/tomorrow/incheon/namdong 612783B 1 https://weather.o2o.kr/tomorrow/incheon/namdong
+20
View File
@@ -0,0 +1,20 @@
날씨각 600502 1 https://weather.o2o.kr/ https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU weather.o2o.kr ko.meteocast.in jongno.webforai.kr gunsan.webforai.kr danyang.webforai.kr gangneung.webforai.kr daegu.webforai.kr gall.dcinside.com chuncheon.webforai.kr busan.webforai.kr haenam.webforai.kr jeju.webforai.kr yeosu.webforai.kr
오늘 날씨 1113195 - weather.go.kr weatheri.co.kr kma.go.kr accuweather.com ytn.co.kr yonhapnewstv.co.kr weeklytoday.com kweather.co.kr
분당구 오늘 날씨 969363 12 https://weather.o2o.kr/ https://weather.o2o.kr/tomorrow/gyeonggi/seongnam/bundang weather.go.kr weatheri.co.kr weather.com accuweather.com kr-weathernews.com here-weather.hongry.dev ryanpp.com skyforecaster.com weawow.com rp5.md rp5.in weather.o2o.kr rp5.kz
분당 날씨 1276832 17 https://weather.o2o.kr/ https://weather.o2o.kr/tomorrow/gyeonggi/seongnam/bundang weather.go.kr weatheri.co.kr accuweather.com bundang-gu.go.kr:10009 weather.com yonhapnewstv.co.kr magazine.hankyung.com doctorstimes.com msn.com kr-weathernews.com ryanpp.com skyforecaster.com here-weather.hongry.dev rp5.kz rp5.in
성남 오늘 날씨 1218291 - weather.go.kr weatheri.co.kr weather.com accuweather.com ko.meteotrend.com kr-weathernews.com here-weather.hongry.dev wikitree.co.kr thefairnews.co.kr jasm.co.kr ko.meteocast.in korea247.kr weatherootd.com temperatureoutfit.com skyforecaster.com
마포구 오늘 날씨 1297676 - weather.go.kr weatheri.co.kr weather.com accuweather.com kr-weathernews.com ko.meteotrend.com here-weather.hongry.dev ko.meteocast.net skyforecaster.com rp5.am rp5.in
마포구 날씨 1328417 - weather.go.kr weatheri.co.kr accuweather.com weather.com ko.weather-forecasts.ru rp5.ru ko.meteotrend.com ko.meteocast.net here-weather.hongry.dev kr-weathernews.com triptokr.com ko.climate-data.org skyforecaster.com rp5.am youtube.com
강남구 오늘 날씨 1218698 - weather.go.kr weatheri.co.kr weather.com accuweather.com weather.guidejung.com ko.meteotrend.com here-weather.hongry.dev kr-weathernews.com roach.kr weawow.com skyforecaster.com ko.meteocast.net ko.climate-data.org rp5.am rp5.ru
세차하기 좋은 날 1350645 - youtube.com koreacarcare.com gjdream.com commercial.platformdodam.com issuetale.kr bigmycn.com 114.co.kr ok114.co.kr xn--hq1bk10a0wb12g.kr bizno.net daangn.com
빨래하기 좋은 날 1407753 - freecolumn.co.kr link.coupang.com animalcrossing.soopoolleaf.com daangn.com melon.com place.udanax.org cokmap.com moneypin.biz tounou.co.kr bizno.net itovic.com tokyobasket.com brunch.co.kr
오늘 노을 시간 899512 4 https://weather.o2o.kr/ https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU weather.go.kr skytime.kr astro.kasi.re.kr weather.o2o.kr namu.wiki hangang.seoul.go.kr cleaveliving.com kr.investing.com bntnews.co.kr wikitree.co.kr hyunbulnews.com where-is-daylight.hongry.dev alpenglowapp.com cafe.ambitstock.com brunch.co.kr
이번 주말 날씨 1296062 - weather.go.kr weatheri.co.kr youtube.com kma.go.kr ytn.co.kr newscj.com weather.daum.net
세차각 941909 2 https://weather.o2o.kr/ https://weather.o2o.kr/gak sechagak.com weather.o2o.kr arca.live fmkorea.com clien.net gall.dcinside.com dogdrip.net godrichstory.com
수원 오늘 날씨 1304854 - weather.go.kr weatheri.co.kr krweb.wni.com kma.go.kr u.suwon.go.kr weather.com accuweather.com pointdaily.co.kr thekpm.com economytalk.kr dailian.co.kr news.tf.co.kr econonews.co.kr kr-weathernews.com ko.meteotrend.com
송파구 오늘 날씨 1229329 - weather.go.kr weatheri.co.kr accuweather.com weather.com kr-weathernews.com here-weather.hongry.dev msn.com rp5.ru ko.meteotrend.com weawow.com skyforecaster.com ko.meteocast.net rp5.in hosting.weatherimc.co.kr
성동구 오늘 날씨 1279146 7 https://weather.o2o.kr/ https://weather.o2o.kr/today/seoul/seongdong https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU https://weather.o2o.kr/shorts/noizuUXFHA8 https://weather.o2o.kr/shorts/YnyzMEublvY weather.go.kr weatheri.co.kr accuweather.com weather.com weatheroutfit.com here-weather.hongry.dev weather.o2o.kr kr-weathernews.com korea247.kr skyforecaster.com weawow.com han-nun.com ko.meteocast.net ko.meteotrend.com rp5.am
연수구 오늘 날씨 1183295 - weather.go.kr weatheri.co.kr weather.com accuweather.com krweb.wni.com here-weather.hongry.dev kr-weathernews.com rp5.am skyforecaster.com 114.ai.kr ko.meteotrend.com rp5.in ko.weather-forecasts.ru weawow.com ko.meteocast.net
구로구 오늘 날씨 1088635 10 https://weather.o2o.kr/ https://weather.o2o.kr/today/seoul/guro https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU weather.go.kr weatheri.co.kr accuweather.com kr-weathernews.com skyforecaster.com ko.meteotrend.com here-weather.hongry.dev rp5.ru weawow.com weather.o2o.kr ko.meteocast.net korea247.kr jusoen.com
부평구 오늘 날씨 980672 - weather.go.kr weatheri.co.kr accuweather.com weather.com here-weather.hongry.dev kr-weathernews.com ko.meteotrend.com ryanpp.com weathernews.com newsinside.kr skyforecaster.com weawow.com hosting.weatherimc.co.kr ko.meteocast.net rp5.in
site:weather.o2o.kr 567809 1 https://weather.o2o.kr/ https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU https://weather.o2o.kr/gak https://weather.o2o.kr/faq https://weather.o2o.kr/sky https://weather.o2o.kr/saju https://weather.o2o.kr/game https://weather.o2o.kr/week https://weather.o2o.kr/faq/busan https://weather.o2o.kr/today/jeonbuk/gunsan https://weather.o2o.kr/today/busan/haeundae https://weather.o2o.kr/faq/sejong https://weather.o2o.kr/faq/jeonbuk https://weather.o2o.kr/faq/gyeonggi https://weather.o2o.kr/faq/chungnam https://weather.o2o.kr/faq/chungbuk https://weather.o2o.kr/faq/gyeongnam https://weather.o2o.kr/today/busan/seo https://weather.o2o.kr/shorts/ZT0p0cM0zrA https://weather.o2o.kr/today/ulsan/nam https://weather.o2o.kr/shorts/noizuUXFHA8 https://weather.o2o.kr/shorts/YnyzMEublvY https://weather.o2o.kr/today/daegu/seo https://weather.o2o.kr/today/seoul/mapo weather.o2o.kr
1 날씨각 600502 1 https://weather.o2o.kr/ https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU weather.o2o.kr ko.meteocast.in jongno.webforai.kr gunsan.webforai.kr danyang.webforai.kr gangneung.webforai.kr daegu.webforai.kr gall.dcinside.com chuncheon.webforai.kr busan.webforai.kr haenam.webforai.kr jeju.webforai.kr yeosu.webforai.kr
2 오늘 날씨 1113195 - weather.go.kr weatheri.co.kr kma.go.kr accuweather.com ytn.co.kr yonhapnewstv.co.kr weeklytoday.com kweather.co.kr
3 분당구 오늘 날씨 969363 12 https://weather.o2o.kr/ https://weather.o2o.kr/tomorrow/gyeonggi/seongnam/bundang weather.go.kr weatheri.co.kr weather.com accuweather.com kr-weathernews.com here-weather.hongry.dev ryanpp.com skyforecaster.com weawow.com rp5.md rp5.in weather.o2o.kr rp5.kz
4 분당 날씨 1276832 17 https://weather.o2o.kr/ https://weather.o2o.kr/tomorrow/gyeonggi/seongnam/bundang weather.go.kr weatheri.co.kr accuweather.com bundang-gu.go.kr:10009 weather.com yonhapnewstv.co.kr magazine.hankyung.com doctorstimes.com msn.com kr-weathernews.com ryanpp.com skyforecaster.com here-weather.hongry.dev rp5.kz rp5.in
5 성남 오늘 날씨 1218291 - weather.go.kr weatheri.co.kr weather.com accuweather.com ko.meteotrend.com kr-weathernews.com here-weather.hongry.dev wikitree.co.kr thefairnews.co.kr jasm.co.kr ko.meteocast.in korea247.kr weatherootd.com temperatureoutfit.com skyforecaster.com
6 마포구 오늘 날씨 1297676 - weather.go.kr weatheri.co.kr weather.com accuweather.com kr-weathernews.com ko.meteotrend.com here-weather.hongry.dev ko.meteocast.net skyforecaster.com rp5.am rp5.in
7 마포구 날씨 1328417 - weather.go.kr weatheri.co.kr accuweather.com weather.com ko.weather-forecasts.ru rp5.ru ko.meteotrend.com ko.meteocast.net here-weather.hongry.dev kr-weathernews.com triptokr.com ko.climate-data.org skyforecaster.com rp5.am youtube.com
8 강남구 오늘 날씨 1218698 - weather.go.kr weatheri.co.kr weather.com accuweather.com weather.guidejung.com ko.meteotrend.com here-weather.hongry.dev kr-weathernews.com roach.kr weawow.com skyforecaster.com ko.meteocast.net ko.climate-data.org rp5.am rp5.ru
9 세차하기 좋은 날 1350645 - youtube.com koreacarcare.com gjdream.com commercial.platformdodam.com issuetale.kr bigmycn.com 114.co.kr ok114.co.kr xn--hq1bk10a0wb12g.kr bizno.net daangn.com
10 빨래하기 좋은 날 1407753 - freecolumn.co.kr link.coupang.com animalcrossing.soopoolleaf.com daangn.com melon.com place.udanax.org cokmap.com moneypin.biz tounou.co.kr bizno.net itovic.com tokyobasket.com brunch.co.kr
11 오늘 노을 시간 899512 4 https://weather.o2o.kr/ https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU weather.go.kr skytime.kr astro.kasi.re.kr weather.o2o.kr namu.wiki hangang.seoul.go.kr cleaveliving.com kr.investing.com bntnews.co.kr wikitree.co.kr hyunbulnews.com where-is-daylight.hongry.dev alpenglowapp.com cafe.ambitstock.com brunch.co.kr
12 이번 주말 날씨 1296062 - weather.go.kr weatheri.co.kr youtube.com kma.go.kr ytn.co.kr newscj.com weather.daum.net
13 세차각 941909 2 https://weather.o2o.kr/ https://weather.o2o.kr/gak sechagak.com weather.o2o.kr arca.live fmkorea.com clien.net gall.dcinside.com dogdrip.net godrichstory.com
14 수원 오늘 날씨 1304854 - weather.go.kr weatheri.co.kr krweb.wni.com kma.go.kr u.suwon.go.kr weather.com accuweather.com pointdaily.co.kr thekpm.com economytalk.kr dailian.co.kr news.tf.co.kr econonews.co.kr kr-weathernews.com ko.meteotrend.com
15 송파구 오늘 날씨 1229329 - weather.go.kr weatheri.co.kr accuweather.com weather.com kr-weathernews.com here-weather.hongry.dev msn.com rp5.ru ko.meteotrend.com weawow.com skyforecaster.com ko.meteocast.net rp5.in hosting.weatherimc.co.kr
16 성동구 오늘 날씨 1279146 7 https://weather.o2o.kr/ https://weather.o2o.kr/today/seoul/seongdong https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU https://weather.o2o.kr/shorts/noizuUXFHA8 https://weather.o2o.kr/shorts/YnyzMEublvY weather.go.kr weatheri.co.kr accuweather.com weather.com weatheroutfit.com here-weather.hongry.dev weather.o2o.kr kr-weathernews.com korea247.kr skyforecaster.com weawow.com han-nun.com ko.meteocast.net ko.meteotrend.com rp5.am
17 연수구 오늘 날씨 1183295 - weather.go.kr weatheri.co.kr weather.com accuweather.com krweb.wni.com here-weather.hongry.dev kr-weathernews.com rp5.am skyforecaster.com 114.ai.kr ko.meteotrend.com rp5.in ko.weather-forecasts.ru weawow.com ko.meteocast.net
18 구로구 오늘 날씨 1088635 10 https://weather.o2o.kr/ https://weather.o2o.kr/today/seoul/guro https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU weather.go.kr weatheri.co.kr accuweather.com kr-weathernews.com skyforecaster.com ko.meteotrend.com here-weather.hongry.dev rp5.ru weawow.com weather.o2o.kr ko.meteocast.net korea247.kr jusoen.com
19 부평구 오늘 날씨 980672 - weather.go.kr weatheri.co.kr accuweather.com weather.com here-weather.hongry.dev kr-weathernews.com ko.meteotrend.com ryanpp.com weathernews.com newsinside.kr skyforecaster.com weawow.com hosting.weatherimc.co.kr ko.meteocast.net rp5.in
20 site:weather.o2o.kr 567809 1 https://weather.o2o.kr/ https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU https://weather.o2o.kr/gak https://weather.o2o.kr/faq https://weather.o2o.kr/sky https://weather.o2o.kr/saju https://weather.o2o.kr/game https://weather.o2o.kr/week https://weather.o2o.kr/faq/busan https://weather.o2o.kr/today/jeonbuk/gunsan https://weather.o2o.kr/today/busan/haeundae https://weather.o2o.kr/faq/sejong https://weather.o2o.kr/faq/jeonbuk https://weather.o2o.kr/faq/gyeonggi https://weather.o2o.kr/faq/chungnam https://weather.o2o.kr/faq/chungbuk https://weather.o2o.kr/faq/gyeongnam https://weather.o2o.kr/today/busan/seo https://weather.o2o.kr/shorts/ZT0p0cM0zrA https://weather.o2o.kr/today/ulsan/nam https://weather.o2o.kr/shorts/noizuUXFHA8 https://weather.o2o.kr/shorts/YnyzMEublvY https://weather.o2o.kr/today/daegu/seo https://weather.o2o.kr/today/seoul/mapo weather.o2o.kr
+45 -14
View File
@@ -34,7 +34,8 @@
- 중구·동구·고성군처럼 이름이 겹치는 곳이 있어서 주소 앞에 시도를 붙였다.
- **앱 동작** (`frontend/src/b/region.tsx`)
- 지역 주소로 들어오면 그 지역을 보여 준다. 위치 권한은 묻지 않고 저장된 선택도 덮어쓰지 않는다.
- 지역 페이지에서 다른 지역을 고르면 주소도 그 지역 주소로 바뀐다.
- 지역 페이지에서 목록으로 다른 지역을 고르면 주소도 그 지역 주소로 바뀐다.
- 지역 페이지에서 '지금 위치로 찾기'를 누르면 처음 화면(`/`)으로 가서 지금 위치의 구를 보여 준다. `/`는 위치를 따라가는 화면이라, 다시 들어오거나 탭으로 돌아오면 지금 위치로 다시 맞춘다.
- `/`로 들어오면 예전 그대로다.
- **지역 목록이 바뀌면**: `python backend/scripts/gen_region_pages.py`를 실행해 `frontend/seo/region.json`을 다시 만든다.
- **매일 돌릴 스케줄은 필요 없다**: 주소와 소개 글은 그대로이고, 그날 값은 요청이 올 때 채운다.
@@ -402,7 +403,13 @@
순위 = 결과에서 weather.o2o.kr이 몇 번째 사이트인지(같은 사이트는 한 번만 셈). `-` 첫 페이지에 없음. 적힌 검색어만 나온 것, 나머지는 `-`.
구글은 첫 페이지(사이트 6~9개)만 본다. 로그인한 브라우저·위치(성남) 기준.
### 최근 요약 (10/29, 직전 측정 대비 — 구글은 10/27, 네이버는 10/28)
### 최근 요약 (10/30, 직전 10/29 대비)
- 새로 잡힘: 없음
- 빠짐: 없음 (10/29에 빠진 `성남 오늘 날씨`·`고양 내일 날씨`·`수원 오늘 날씨`는 구글·네이버 모두 여전히 -)
- 순위 바뀜: 없음 — `날씨각` 네이버 1 그대로(첫 링크가 `/` → `/tomorrow/incheon/namdong`으로 바뀜), 구글은 `제주 날씨`부터 CAPTCHA로 `날씨각` 포함 16개 못 잼
### 지난 요약 (10/29, 직전 측정 대비 — 구글은 10/27, 네이버는 10/28)
- 새로 잡힘: 없음
- 빠짐: `성남 오늘 날씨` → 구글 2p8→-, 네이버 10→-. `고양 내일 날씨` → 구글 2p7→-. `수원 오늘 날씨` → 네이버 14→-. (구글 `site:weather.o2o.kr 성남` 은 9건 나와 색인은 살아 있음)
@@ -430,21 +437,22 @@
실제 검색량이 큰 검색어 78개 + 날씨각. 구글 = 로그인 브라우저·성남 위치, 1~2페이지. 네이버 = 통합검색·웹 탭 첫 화면. `-` = 없음, `?` = 구글 차단으로 못 잼.
| 검색어 | 구글 10/26 | 구글 10/27 | 구글 10/28 | 구글 10/29 | 네이버 10/26 | 네이버 10/27 | 네이버 10/28 | 네이버 10/29 |
|---|---|---|---|---|---|---|---|---|
| 날씨각 | 1p1 | 1p1 | 1p1 | 1p1 | 1 | 1 | 1 | 1 |
| 성남 오늘 날씨 | 2p10 `/today/gyeonggi/seongnam` | 2p8 | ? | - | 10 | 6 | 10 | - |
| 수원 오늘 날씨 | - | - | ? | - | - | - | 14 `/today/gyeonggi/suwon` | - |
| 고양 내일 날씨 | - | 2p7 `/tomorrow/gyeonggi/goyang` | ? | - | - | - | - | - |
| 군산 오늘 날씨 | 3p4 (2p 밖) | ? | ? | - | - | - | - | - |
| 오늘 날씨 · 내일 날씨 · 모레 날씨 · 이번주 날씨 · 주말 날씨 · 날씨 | - | - | ? | - | - | - | - | - |
| 서울 · 부산 · 인천 · 대전 · 광주 · 울산 · 세종 × 오늘/내일/날씨, 수원 내일·수원 날씨, 대구 날씨, 성남 내일·성남 날씨 | - | - | ? | - | - | - | - | - |
| 대구 오늘 날씨 · 대구 내일 날씨 | - | ? | ? | - | - | - | - | - |
| 고양 오늘·고양 날씨, 용인 · 창원 · 청주 · 천안 · 전주 × 오늘/내일/날씨 | - | - | ? | - | - | - | - | - |
| 군산 내일·군산 날씨, 포항 · 제주 · 김해 · 화성 · 부천 · 안산 · 남양주 × 오늘/내일/날씨 | - | ? | ? | - | - | - | - | - |
| 검색어 | 구글 10/26 | 구글 10/27 | 구글 10/28 | 구글 10/29 | 구글 10/30 | 네이버 10/26 | 네이버 10/27 | 네이버 10/28 | 네이버 10/29 | 네이버 10/30 |
|---|---|---|---|---|---|---|---|---|---|---|
| 날씨각 | 1p1 | 1p1 | 1p1 | 1p1 | ? | 1 | 1 | 1 | 1 | 1 `/tomorrow/incheon/namdong` |
| 성남 오늘 날씨 | 2p10 `/today/gyeonggi/seongnam` | 2p8 | ? | - | - | 10 | 6 | 10 | - | - |
| 수원 오늘 날씨 | - | - | ? | - | - | - | - | 14 `/today/gyeonggi/suwon` | - | - |
| 고양 내일 날씨 | - | 2p7 `/tomorrow/gyeonggi/goyang` | ? | - | - | - | - | - | - | - |
| 군산 오늘 날씨 | 3p4 (2p 밖) | ? | ? | - | - | - | - | - | - | - |
| 오늘 날씨 · 내일 날씨 · 모레 날씨 · 이번주 날씨 · 주말 날씨 · 날씨 | - | - | ? | - | - | - | - | - | - | - |
| 서울 · 부산 · 인천 · 대전 · 광주 · 울산 · 세종 × 오늘/내일/날씨, 수원 내일·수원 날씨, 대구 날씨, 성남 내일·성남 날씨 | - | - | ? | - | - | - | - | - | - | - |
| 대구 오늘 날씨 · 대구 내일 날씨 | - | ? | ? | - | - | - | - | - | - | - |
| 고양 오늘·고양 날씨, 용인 · 창원 · 청주 · 천안 · 전주 × 오늘/내일/날씨 | - | - | ? | - | - | - | - | - | - | - |
| 군산 내일·군산 날씨, 포항 · 제주 · 김해 · 화성 · 부천 · 안산 · 남양주 × 오늘/내일/날씨 | - | ? | ? | - | - (제주 날씨·김해·화성·부천·안산·남양주는 ?) | - | - | - | - | - |
- 서울·부산·인천·대구·대전·광주·울산은 시 단위 페이지가 없음(구 페이지만). '서울 날씨'를 받을 페이지 자체가 없다.
- 원본: `docs/search_log/{날짜}_naver_대표검색어.tsv`
- 10/30 구글: 탭에서 열어 63개까지 잼, `제주 날씨`에서 CAPTCHA(sorry)로 멈춤. 나머지 16개(`날씨각` 포함)는 `?`.
- 10/28 구글: 브라우저 fetch 로 받은 검색 결과가 'JavaScript 필요' 안내 페이지로 바뀌어 결과를 못 읽었고, 탭에서 직접 열자 CAPTCHA(sorry)가 떠 멈춤. 다음 측정은 탭에서 실제 페이지를 열어 읽는 방식으로 해야 함.
### 키워드별 잡힘 (10/26)
@@ -506,6 +514,29 @@
| 10/24 | 네이버 | 10/23과 같은 168개 + 내일 4개 | 날씨각 1, 날씨각 성남 1, **성남 오늘 날씨 10 (새로 나옴)**. `{구} 오늘 날씨`: 강남 5·성동 6·구로 6·마포 6·연수 7·송파 7·부평 11. `오늘 {구} 날씨`: 성동 5·강남 6·송파 7·마포 9·연수 10·구로 12·부평 14 | site: 첫 화면 15 (10/23 16, 같은 수준) | 구 39개 0, `내일 날씨` 꼴 0(성동구·군산 포함). 부평은 뉴스 칸 영향으로 ±5 흔들림 |
| 10/26 | 구글 | 10/24와 같은 범위(구 39개 1~2p + 날씨각 + 내일 3개·군산 오늘) | **날씨각 1** `/`(10/24 3). 39개 중 35개 나옴(10/24 34). **청원 1p6**, 만세 1p6→2p1, 효행 2p1, 처인 2p2(새로). 성동구 내일 2p4 `/tomorrow/seoul/seongdong`(10/24 2p3), 분당구 내일 2p7(오늘 페이지). 군산 내일 1~4p 없음, 군산 오늘 3p4 `/today/jeonbuk/gunsan`(로그인 첫 확인) | 약 421 (10/24 383) | 없음 4개: 기흥·동탄·포항남·포항북. 막힘(sorry) 없음 |
| 10/26 | 네이버 | 10/24와 같은 172개 | 날씨각 1, 날씨각 성남 1, 성남 오늘 날씨 11(10/24 10). `{구} 오늘 날씨`: 연수 6·구로 6·마포 6·성동 6·송파 6·강남 8·부평 9. `오늘 {구} 날씨`: 송파 6·연수 8·성동 8·강남 9·마포 9·구로 10·부평 15. **송파구 내일 날씨 14 (새로 나옴, 오늘 페이지)** | site: 첫 화면 16 (10/24 15, 성남 추가) | 구 39개 0, 나머지 `내일 날씨` 꼴 0 |
| 11/10 | 구글 | 날씨각 · `"날씨각"` · `site:` 3개 | 날씨각 **-** (1p 8곳: 기상청·AccuWeather·케이웨더·웨더아이·다음·수도권기상청·네이버·weather.com, "누락된 검색어: 각"). `"날씨각"` 도 - | **약 3** (10/26 약 421): `/tomorrow/gyeonggi/ansan/sangnok`, `/today/seoul/jung`, `/today/gyeonggi/seongnam/jungwon`. 홈 없음 | 사이트 이름 '에이아이오투오'·'AIO2O'. `site:o2o.kr` 약 135(triplepick 정상). Googlebot 응답은 전부 200, 지역 페이지 수집은 11일간 9번. 서치 콘솔은 로그인 계정에 권한 없어 못 봄 |
| 11/10 | 네이버 | 날씨각 · `site:` | 날씨각 1 `/` | site: 첫 화면 30 이상 (홈·faq·gak·game·saju·season·sky·shorts 9·today 7) | 정상 |
| 11/13 | 구글 | 기본 13개 + `"날씨각"` + `site:` (탭 안 fetch, 막힘 없음) | 전부 **-** (날씨각 1p 7곳: AccuWeather·웨더아이·기상청·케이웨더·kma·weather.com·네이버, "누락된 검색어: 각") | **약 2** (11/10 약 3): `/tomorrow/gyeonggi/ansan/sangnok`, `/today/gyeonggi/seongnam/jungwon`. 홈 없음 | 같은 날 사이트맵을 566 → 11개로 줄여 배포·서치 콘솔 재제출(발견된 페이지 11, 읽은 날짜 11/13). 배포 뒤 Googlebot 은 robots.txt 2·sitemap.xml 1 만 가져감 |
| 11/13 | 네이버 | 기본 13개 + 구 6개(수원·송파·성동·연수·구로·부평 오늘 날씨) + `site:` | 날씨각 1 `/`, 세차각 2 `/gak`, 오늘 노을 시간 4 `/`, 성동구 오늘 7, 구로구 오늘 10, **분당구 오늘 날씨 12·분당 날씨 17 (새로, 내일 페이지 `/tomorrow/gyeonggi/seongnam/bundang`)**. 빠짐(10/26 대비): 마포구 오늘 6→-, 강남구 오늘 8→-, 송파구 오늘 6→-, 연수구 오늘 6→-, 부평구 오늘 9→- | site: 첫 화면 31 (홈·faq·gak·game·saju·sky·week, faq 시도 7, shorts 11, today 6) | 빠진 5개 구는 `site:weather.o2o.kr {구}` 에 주소가 있고 Yeti UA 200·제목 정상 → 색인이 아니라 순위. 직전 측정이 10/26 이라 18일 사이 언제 빠졌는지는 모름. 원본 `docs/search_log/2026-11-13_naver.tsv` |
### 11/10 구글 색인 급감 원인 분석
- **상태**: 구글 `날씨각` 1p1(10/29) → 없음. 서치 콘솔 색인 46 / 미색인 523 (크롤링됨 - 현재 색인이 생성되지 않음 327, 발견됨 - 현재 색인이 생성되지 않음 193, 표준 태그가 포함된 대체 페이지 3). 홈도 "크롤링됨 - 현재 색인이 생성되지 않음". 수동 조치·보안 문제 없음. 네이버는 정상(날씨각 1).
- **배제**: 서버 응답(Googlebot 261건 전부 200), robots.txt·noindex·canonical, 렌더 실패(Googlebot UA 헤드리스 렌더 정상), 도메인 전체 문제(triplepick.o2o.kr 정상 색인).
- **가설(추정, 구글이 사유를 알려 주지 않음)**
- 모든 페이지의 닫힌 지역 바꾸기 창 안에 "○○ 오늘 날씨" 링크 269개가 숨어 있었다(10/19 `0a16c53`, 로봇용). 4-4 숨긴 텍스트·링크 정의("검색엔진만을 위해 넣는 내용")에 가깝다.
- 틀이 같은 지역 페이지를 사이트맵 235 → 566개로 단기간에 늘렸다.
- **조치**: 숨은 링크 묶음 제거(`fix/remove-hidden-region-links`, `frontend/src/b/Sheets.tsx`). 지역 페이지는 사이트맵, 지역 페이지 하단 소개 글의 같은 시도 링크, `/faq` → 시도 FAQ 로 발견된다. 홈에서 지역 페이지로 가는 링크는 없어진다(홈 하단 `/faq` 링크는 넣지 않기로 함).
- **서치 콘솔에서 확인한 흐름 (11/10, 날짜는 서치 콘솔 기준 = 태평양 시간)**
- 색인 보고서: 10/17~19 색인 약 77·미색인 약 195 → 10/20~23 색인 약 369·미색인 약 190 → 10/24부터 색인 46·미색인 523 (막대 높이로 읽은 근삿값, 최종 업데이트 11/6).
- "크롤링됨 - 현재 색인이 생성되지 않음" 327개: 내일 237·오늘 70·FAQ 16·홈·`/gak`·`/week`·`/season`. 마지막 크롤링이 10/22 231개, 10/23 41개.
- 실적: 노출 10/22 2,203 → 10/23 21,045 → 10/24 17,956 → 10/25 17,062 → 10/26 14,368 → 10/27 12,200 → **10/28 36** → 10/31 이후 0~2. 28일 합계 클릭 58·노출 8.64만·평균 9.2위.
- 노출 대부분이 일반 검색어: `내일 날씨` 56,790(9.0위, 클릭 21), `날씨` 7,492, `성남시 날씨` 6,082, `익산시 날씨` 3,777. 홈은 노출 106·클릭 20·3.5위.
- 홈 URL 검사: 11/10 12:03 크롤링(배포 전), "크롤링됨 - 현재 색인이 생성되지 않음", 수동 조치 없음. 배포 뒤 14:12 실시간 테스트는 "URL을 Google에 등록할 수 있음", 구글이 렌더한 HTML에 숨은 링크 묶음 0·게시물 카드 52·"불러오는 중" 0.
- 배포 이력(서버 `git reflog`): 10/27 12번 이상, 10/28 8번, 10/29 13번, 10/30 12번. 10/30 15:03 배포(`4b321c1`) 전에는 배포마다 예전 빌드 파일이 지워져, 구글이 먼저 받아 둔 HTML 로 나중에 렌더하면 '날씨 불러오는 중'에서 멈출 수 있었다.
- **가설 추가(추정)**: ① 10/23~27 일반 검색어 9위권에 시험 노출됐다가 클릭률 0.1%로 재평가돼 빠짐. ② 10/27~30 잦은 배포로 구글 렌더가 빈 화면을 봄(10/30 수정됨). 숨은 링크·페이지 대량 추가와 함께 어느 것이 결정적이었는지는 가릴 수 없다.
- **11/13 사이트맵 줄이기**: 지역 오늘 페이지(`/today/…`)·내일 페이지(`/tomorrow/…`)·시도별 FAQ(`/faq/{시도}`)를 사이트맵에서 뺐다(`frontend/vite.config.ts`). 사이트맵에는 홈과 `/faq`·`/gak` 같은 기본 페이지만 남는다. 페이지는 그대로 열리고 noindex 는 넣지 않았다. 지역 페이지는 `/faq` → 시도 FAQ → 지역 페이지 링크로만 발견된다.
- **미결정**: 지역 페이지·시도별 FAQ 에 noindex 를 넣을지. 배포 뒤 몇 주 색인 비율을 보고 정한다.
### 구글 구 39개 표
+3 -2
View File
@@ -7,7 +7,7 @@
| 단계 | 하는 일 | 코드 |
|---|---|---|
| 1. 네 기둥 | 연주는 입춘, 월주는 절입 시각(천문 계산), 일주·시주는 출생지 지방평균시(서머타임 걷어냄)로 가른다 | `services/saju/pillars.py`, `birth.py`, `solar_terms.py` |
| 2. 오행 세력 | 자리 점수(월지 30·일지 20·나머지 10)를 지지는 지장간 날 수대로 나눠 오행별로 더한다. 일간을 돕는 몫이 50% 이상이면 신강 | `services/saju/strength.py` |
| 2. 오행 세력 | 자리 점수(월지 30·일지 20·나머지 10)를 지지는 지장간 날 수대로 나눠 오행별로 더한다. 일간을 돕는 몫 + 득령 가산 0.15 가 55% 이상 신강, 45% 미만 신약, 사이 중화 | `services/saju/strength.py` |
| 3. 조후(내 기운) | 글자마다 한난·조습 값을 두고, 태어난 달(월령)이 다른 글자를 데우거나 식힌다. 흙은 계절 따라 마르고 젖는다. 자리 점수로 평균 → '따뜻·마름' 같은 결 + 계절 = 기운 장면 | `services/saju/climate.py` |
| 4. 사주 점수 | 50에서 시작, 오늘 일진의 십성·원국과의 합충형파해·도화·홍염을 더한다 | `services/saju/daily.py` |
| 5. 날씨 궁합 | 시간별 체감·습도·비가 내 조후를 균형 쪽으로 옮기는지. 50이 보통 | `services/saju/climate.py` |
@@ -36,7 +36,8 @@
- 예: 월지 未 30점 → 丁(화) 9, 乙(목) 3, 己(토) 18.
- `elements`: 일간 포함 오행별 합. `top`: 가장 큰 오행(같으면 木火土金水 순 앞).
- `support` = (일간 빼고) 일간과 같은 오행 + 일간을 생하는 오행 점수 ÷ 일간 뺀 점수 합. 시주가 있으면 분모 100.
- `strong` = support ≥ 0.5 (신강).
- 득령 = 월지 계절 오행(寅卯 木, 巳午 火, 申酉 金, 亥子 水, 辰戌丑未 土)이 일간과 같거나 일간을 생함. 득령이면 support 에 0.15 를 더해 판정.
- `label` = (support + 득령 가산) ≥ 0.55 신강, < 0.45 신약, 사이 중화. 강약은 득령을 먼저 본다 (10/29 사용자 결정 — 未월 己土가 시주 하나로 신약이 되던 문제).
- 근거: 득령(월지)·득지(일지)·득세 판단, 월지 30·일지 20·그 외 10 배점은 흔히 쓰는 예시 배점.
- 화면: API `me.elements`·`top_element`·`strong`·`support`, 기둥별 `stem_ten_god`·`branch_ten_god`(지지는 정기 기준) → 사주 명식 카드.
+9 -3
View File
@@ -41,6 +41,7 @@
| 단기예보 (오늘~모레, 시간별 기온·비·바람·습도·하늘) | 기상청 | 하루 8번: 02·05·08·11·14·17·20·23시 발표, 10분 뒤부터 받을 수 있음 | 가진 예보보다 새 발표가 있으면 |
| 중기예보 (3~10일 뒤, 하루 단위) | 기상청 | 하루 2번: 06·18시 발표 | 발표 30분 뒤부터, 아직 안 받았으면 |
| 초단기예보 (앞으로 6시간 비) | 기상청 | 매시 30분 발표, 45분부터 받을 수 있음 | 새 발표가 있으면 |
| 초단기실황 (지금 관측한 비·기온·습도·바람) | 기상청 | 매 정시 관측, 10분부터 받을 수 있음 | 새 정시 관측이 있으면 |
| 미세먼지 | 에어코리아 | 매시 측정, 20분쯤 뒤에 나옴 | 이번 시각 측정값이 없으면 전국을 한 번에 |
| 기상특보 | 기상청 | 수시 | 1시간에 한 번 |
| 노을·일출 구름 | Open-Meteo | 수시 | 하루 3번: 오전, 13시 이후, 21시 이후 |
@@ -83,6 +84,7 @@
|---|---|---|---|
| 단기예보 | 기상청 | 구 1곳 · 발표 +10분 | 02·05·08·11·14·17·20·23시 10분 |
| 초단기예보 | 기상청 | 구 1곳 | 매시 45분 |
| 초단기실황 | 기상청 | 구 1곳 | 매시 10분 |
| 중기예보 | 기상청 | 4~10일 뒤 | 06:30 · 18:30 |
| 기상특보 | 기상청 | 전국 | 매시 정각 |
| 미세먼지 | 에어코리아 | 전국 | 매시 20분 |
@@ -95,6 +97,7 @@
- **단기예보**: 오늘~글피(4일) 시간별 기온·하늘 상태·비/눈 종류·강수확률·강수량·습도·풍속, 하루 최저·최고기온
- **초단기예보**: 앞으로 6시간 시간별 비/눈 종류·강수량·기온
- **초단기실황**: 지금 정시에 관측한 비/눈 종류·1시간 강수량·기온·습도·풍속. 예보가 아니라 관측이라 비 확률은 없습니다
- **중기예보**: 4~10일 뒤 오전·오후 날씨(맑음·구름·흐림·비)와 최저·최고기온
- **기상특보**: 최근 7일 구역별 특보 종류(강풍·호우 등)와 단계
- **미세먼지**: 전국 측정소별 PM10·PM2.5 농도와 등급
@@ -110,6 +113,7 @@
|---|---|---|---|---|---|
| 시간별·하루 날씨 | 기상청 단기예보 | 구 1곳 | 02·05·08·11·14·17·20·23시 `+10분` | `weather_hourly` `weather_daily` | 잠금만 |
| 앞으로 몇 시간 비 | 기상청 초단기예보 | 구 1곳 | 매시 `:45` | 저장 안 함 | `ultra:{구}` 약 1시간 |
| 지금 관측한 날씨 | 기상청 초단기실황 | 구 1곳 | 매시 `:10` | 저장 안 함 | `ncst:{구}` 약 1시간 |
| 4~10일 뒤 날씨 | 기상청 중기예보 | 예보 구역 1곳 | 06·18시 `+30분` | `weather_daily` | `mid:` 표시 13시간 |
| 기상특보 | 기상청 특보 | 전국 | 매시 정각 | `weather_warning` | `warning:fetched` 1시간 |
| 미세먼지 | 에어코리아 실시간 | 전국 | 매시 `:20` | `air_quality` | `air:tried` 10분 |
@@ -141,7 +145,8 @@
| 기상청 API | 기간 | 단위 | 쓰는 곳 |
|---|---|---|---|
| 초단기예보 | 앞으로 6시간 | 1시간 · 구 | "2시간 안에 비", 지금 날씨 |
| 초단기실황 | 지금 (정시 관측) | 1시간 · 구 | 지금 시각의 비·기온·습도·바람을 예보 대신 관측값으로 바꿈 (히어로, 각 점수, 오늘 날씨) |
| 초단기예보 | 앞으로 6시간 | 1시간 · 구 | "2시간 안에 비", 앞 몇 시간의 비·낙뢰 |
| 단기예보 | 오늘~글피 (4일) | 1시간 · 구 | 오늘·내일 날씨, 각 점수, 출퇴근, 4일 안의 주말 플랜 |
| 중기예보 | 4~10일 뒤 | 오전·오후 · 도 | 주간 날씨, 4일 넘게 남은 주말 예보·플랜 |
@@ -174,7 +179,7 @@
| 콘텐츠 | 출처 | 언제 새로 |
|---|---|---|
| 히어로 기온·체감·불쾌지수 | 기상청 단기예보 · 계산 (체감·불쾌지수는 기온·습도·바람으로 계산) | 하루 8번 발표 |
| 히어로 기온·체감·불쾌지수 | 기상청 단기예보, 지금 시각은 초단기실황 관측값 · 계산 (체감·불쾌지수는 기온·습도·바람으로 계산) | 하루 8번 발표 · 매시 :10 |
| 지금 비 (2시간) | 기상청 초단기예보 | 매시 :45 |
| 오늘 날씨 점수 · 1위 각 | 계산 (예보 + 미세먼지 + 특보로 각 27개 점수) | 예보·미세먼지 바뀔 때 |
| 하늘 배경 시간대 | 계산 (그 구의 일몰 시각으로 아침·낮·저녁·밤) | 시간대 경계 |
@@ -593,7 +598,7 @@
- **켜지는 조건**: 후보 도시(`backend/seed/trip_city.csv`, 지금 강릉·속초·춘천·가평·양평·인천·대전·전주·태안·단양 10곳) 중 내 지역에서 직선 20~200km 안인 곳의 이번 주말(토·일, 오늘 이후) 나들이 점수 1위가 50점 이상일 때. 주말 플랜 바로 뒤.
- **슬라이드**: 첫 장 "당일치기 · 토요일 10.10", 큰 줄 "토요일엔 강릉, 나들이 86점", 표(거리 "여기서 약 160km", 날씨 근거 "비 10% · 체감 21° · 맑음" — 중기예보로 어림하면 "예상 날씨", 기온, 볼거리). 뒤로 그날 그 도시 30km 안 행사 최대 2장(사진 + 장소·기간).
- **본문**: 2위 도시: "다음은 춘천, 일요일 75점이에요." 후보가 하나뿐이면 "아침 일찍 출발하면 하루가 넉넉해요."
- **데이터**: 나들이 날씨 점수(`index_calc.py` `outing`·`outing_estimate`: 낮 10~17시 비 40%·기온 35%(체감 17~24°, 21° 최적)·하늘 15%·바람 10%, 비 확률 60% 이상이거나 비 소식이면 최대 30점). 단기예보 안이면 시간별, 밖이면 중기예보. 워커가 06:40·18:40에 계산해 Redis(`weekend_rank:토요일`)에 둔 값만 쓰고, 없으면 카드를 끄고 피드를 60초만 캐시. 행사는 `WeekService.events`를 그 도시 기준으로 (`weekend_rank.py`, `feed_service.py` `_day_trip`).
- **데이터**: 나들이 날씨 점수(`index_calc.py` `outing`·`outing_estimate`: 낮 10~17시 비 40%·기온 35%(체감 17~24°, 21° 최적)·하늘 15%·바람 10%, 비가 와도 상한 없이 계산한 점수 그대로). 단기예보 안이면 시간별, 밖이면 중기예보. 워커가 06:40·18:40에 계산해 Redis(`weekend_rank:토요일`)에 둔 값만 쓰고, 없으면 카드를 끄고 피드를 60초만 캐시. 행사는 `WeekService.events`를 그 도시 기준으로 (`weekend_rank.py`, `feed_service.py` `_day_trip`).
피드에 같이 나오지만 포스트가 아닌 것: 히어로(지금 기온·체감·불쾌지수·2시간 비·1위 각), 오늘의 각 줄(전체 순위), 띠 3종(행사 4개, TOP5, 계절 글 목록).
@@ -655,6 +660,7 @@ frontend/
|---|---|---|---|
| 공유 | `navigator.share` (이미지 카드 + 링크) | 이미지는 기기에 저장(`File.saveBase64`), 링크는 `Share.createLink` + `Share.sendMessage`. SDK 공유는 글만 보낼 수 있다 | `frontend/src/b/Sheets.tsx` |
| 위치 | `navigator.geolocation` | `Device.getLocation`. 처음 들어올 때는 권한 창을 띄우지 않고, 이미 허용한 사람만 위치로 맞춘다. '내 위치' 버튼을 누를 때 권한 창을 띄운다 | `frontend/src/b/region.tsx` |
| 다시 들어올 때 | 웹·토스 같음. 저장된 지역을 먼저 보여 주고, 위치로 맞춘 사람은 권한이 이미 있으면 새로고침하거나 탭으로 돌아올 때 지금 위치로 조용히 다시 맞춘다 (1분에 한 번). 목록에서 고른 지역은 '지금 위치로 찾기'를 누르기 전까지 그대로 둔다. 예전에 저장한 사람은 목록에서 고른 것으로 본다 | 같음 | `frontend/src/b/region.tsx` `follow` |
| 로그인 | 아이디·비밀번호 | 토스 로그인(`TossAuth.login` → `POST /v1/auth/toss`). 토스가 주는 개인정보는 받지 않고 `userKey`만 저장한다 | `frontend/src/b/Sheets.tsx` (`TossLoginSheet`), `backend/services/external/toss_login.py` |
| 좋아요·댓글 | 있음 | 있음. 신고·차단은 필수가 아니라 만들지 않는다(검수에서 요청하면 만든다) | `frontend/src/b/Post.tsx`, `frontend/src/b/Sheets.tsx` |
| 네이버 지도 링크 | 있음 | 장소 이름만 표시. Q4 답이 '예외 해당'이면 되돌린다 | `frontend/src/b/ui.tsx` (`MapLink`) |
+79 -40
View File
@@ -12,9 +12,11 @@ GA4 태그(`gtag.js`, 측정 ID `G-D378J4X373`)를 `index.html`에 심고, 화
```
- 왜 GTM이 아니라 GA4 직접인가: 이벤트를 코드(`analytics.ts`)에서 정하므로, GTM을 쓰면 이벤트마다 트리거·태그를 한 번 더 만들어야 한다. 광고 픽셀도, 마케터가 직접 손볼 일도 아직 없다.
- 모든 이벤트에 `platform: 'web' | 'toss'`가 붙는다. `index.html`의 `gtag('config')`에서 빌드 모드(`%MODE%`)로 정한다. GA4에서 보려면 맞춤 측정기준(이벤트 범위, `platform`)을 한 번 등록한다.
- 모든 이벤트에 `platform: 'web' | 'toss' | 'android_app'`이 붙는다. `index.html`의 `gtag('config')`에서 빌드 모드(`%MODE%`)와 user agent(앱 웹뷰는 `NalssigakApp/버전`)로 정한다. GA4에서 보려면 맞춤 측정기준(이벤트 범위, `platform`)을 한 번 등록한다.
- 개발 서버(`npm run dev`)에서는 `track()`이 이벤트를 보내지 않는다. 단 `index.html`의 페이지 조회(`page_view`)는 개발 서버에서도 나가므로 GA4에서 `localhost`를 걸러 본다.
- 이벤트 이름은 영어 snake_case. GA4 추천 이벤트(`share`, `login`, `sign_up`, `select_content`)는 이름을 그대로 써야 GA4 기본 보고서에 잡힌다.
- GA 에 찍히는 이벤트 이름은 한국어(띄어쓰기 대신 `_`, 40자 이내). 코드에서는 영어 키로 부르고 `analytics.ts` `GA_NAME` 이 한국어로 바꿔 보낸다. 새 이벤트는 `Events` 와 `GA_NAME` 둘 다 넣는다.
- 로그인·회원가입·공유·글_열기도 한국어라 GA4 기본 보고서(추천 이벤트 집계)에는 안 잡힌다. 탐색 보고서에서 이벤트 이름으로 본다.
- 2026-10-30 전 데이터는 영어 이름(괄호 안 코드 키)으로 남아 있다.
- 값은 사람이 읽을 수 있게 한글 그대로 둔다 (예: `gak_name: '야장각'`).
- 개인정보(아이디, 닉네임 등)는 값에 넣지 않는다.
- 페이지 이동은 코드로 보내지 않는다. GA4 향상된 측정의 "브라우저 기록 이벤트 기반 페이지 변경"이 잡는다(기본 켜짐). 모든 이벤트에 GA4가 `page_location`을 붙이므로 어느 탭에서 일어났는지는 따로 보내지 않는다.
@@ -23,51 +25,88 @@ GA4 태그(`gtag.js`, 측정 ID `G-D378J4X373`)를 `index.html`에 심고, 화
| 이벤트 | 언제 | 값 | 코드 |
|---|---|---|---|
| `view_gak` | 각 상세 시트가 열려 데이터가 뜸 (같은 각은 한 번만) | `index_id`, `gak_name`, `score`, `rank` | `Sheets.tsx` `GakSheet` |
| `select_content` | 글 시트가 열려 데이터가 뜸 (같은 글은 한 번만) | `content_type: 'article'`, `item_id`(글 번호), `category`(분류 이름) | `Sheets.tsx` `ArticleSheet` |
| `share` | 공유창으로 보내기 성공, 또는 이미지 내려받기 | `content_type: 'image'`, `item_id`(공유 제목), `method: 'share_sheet' \| 'download'`, `ratio`(이미지 비율) | `Sheets.tsx` `ShareSheet` `send` |
| `login` | 로그인 성공 (구글로 처음 들어와 자동 가입된 경우도 `login`) | `method: 'id' \| 'google' \| 'toss'`(앱인토스) | `Sheets.tsx` `LoginSheet` `done`, `TossLoginSheet` |
| `sign_up` | 가입 성공 | `method: 'id'` | `Sheets.tsx` `LoginSheet` `done` |
| `region_change` | 지역 목록에서 고름, 또는 위치로 가까운 구를 찾음 | `region_name`, `method: 'list' \| 'location'` | `Sheets.tsx` `RegionSheet`, `region.tsx` `findNearest` |
| `install_banner_view` | 오늘 탭의 '홈 화면에 추가' 카드가 보임 (설치할 수 있는 곳에서, 닫은 지 2주 안 지났으면 안 보임) | 없음 | `installBanner.tsx` `InstallBanner` |
| `install_click` | '홈 화면에 추가'를 누름 | `from: 'banner' \| 'menu'`(카드·내 정보 메뉴), `method: 'prompt' \| 'guide'`(설치창을 띄움·기기별 안내를 염) | `install.ts` `useInstall` |
| `install_choice` | 설치창에서 고름 (안드로이드·PC Chrome·Edge) | `outcome: 'accepted' \| 'dismissed'` | `install.ts` `promptInstall` |
| `install_done` | 설치 완료 (브라우저가 `appinstalled`를 줄 때만. 아이폰은 오지 않음) | 없음 | `install.ts` |
| `app_launch` | 홈 화면 아이콘(설치한 앱)으로 엶 | `mode: 'standalone'` | `main.tsx` |
| `sheet_open` | 아래에서 올라오는 창이 열림 (각·글·보내기·댓글·로그인·내 정보·지역·내 각·홈 화면 추가·점수 근거·이야기 등) | `sheet`(창 종류: `gak`·`article`·`share`·`comments`·`login`·`me`·`region`·`mix`·`myGak`·`install`·`weatherWhy`·`talk`·`seasonWeek`) | `Sheets.tsx` `SheetProvider` `open` |
| `like` | 좋아요 성공 (취소는 안 보냄) | `content_type: 'post' \| 'comment' \| 'talk' \| 'hero_post' \| 'gak_post' \| 'foliage_post' \| 'events_post' \| 'season_post'`, `item_id`(포스트·댓글·글 번호) | `Post.tsx` `FullCard`, `pinnedLike.ts`, `Sheets.tsx` `CommentRow`, `talk.tsx` |
| `comment` | 댓글 올리기 성공 | `post_id` | `Sheets.tsx` `CommentsSheet` `send` |
| `terms_agree` | 댓글 쓰기 전 이용약관 동의 성공 | 없음 | `Sheets.tsx` `CommentsSheet` `agreeAndSend` |
| `report` | 신고 성공 | `content_type: 'comment' \| 'talk'`, `reason`(신고 이유 번호) | `Sheets.tsx` `CommentMenu`, `talk.tsx` |
| `block` | 차단 성공 | `content_type: 'comment' \| 'talk'` | `Sheets.tsx` `CommentMenu`, `talk.tsx` |
| `talk_post` | 이야기 글 올리기 성공 | `topic`(주제 번호), `with_image` | `talk.tsx` 글쓰기 `submit` |
| `hero_day_switch` | 히어로 오늘/내일 스위치를 바꿈 | `day: 'today' \| 'tomorrow'` | `TodayPage.tsx` |
| `shorts_open` | 쇼츠 페이지(/shorts/영상ID)로 들어옴 (오늘 화면 쇼츠 줄·공유 링크) | `video_id` | `Shorts.tsx` `ShortsPage` |
| `shorts_view` | 쇼츠를 넘겨 다른 영상으로 감 | `video_id`, `index`(목록 순서) | `Shorts.tsx` `ShortsPage` |
| `shorts_sound` | 쇼츠 소리 켜기·끄기 | `on` | `Shorts.tsx` `toggleSound` |
| `foliage_open` | 단풍 지도 페이지(/foliage)를 엶 | 없음 | `FoliagePage.tsx` |
| `foliage_spot` | 단풍 명소를 고름 | `spot_name`, `from: 'page' \| 'card'`(지도 페이지·오늘 화면 카드) | `FoliagePage.tsx`, `foliageMap.tsx` |
| `my_gak_save` | 내 각 만들기 성공 (로그인 전엔 기기에 저장) | `gak_name` | `myGakState.ts` `create` |
| `toss_intro_start` | 토스판 첫 소개 화면에서 '시작하기' | 없음 | `tossIntro.tsx` |
| `install_banner_close` | '홈 화면에 추가' 띠를 × 로 닫음 | 없음 | `installBanner.tsx` |
| `fortune_draw` | 오늘 한 장에서 카드를 뽑음 (하루 한 번, 다시 열 때는 안 보냄) | `card`(각 코드) | `fortune.tsx` `useTodayCard` |
| `day_log` | 저녁 체크인을 적어 둠 (고쳐 적어도 보냄). 다녀온 곳 이름은 보내지 않음 | `mood`(1~5), `went_out`, `card_hit`(맞았어요 true·글쎄요 false·안 고름 null) | `fortune.tsx` `useTodayCard` |
| `today_icon` | 오늘 탭 아이콘 줄에서 아이콘을 누름 | `icon`(`tarot`·`saju`·`game`·`foliage`·`shorts`·`myGak`·`talk`) | `todayIcons.tsx` `TodayIcons` |
| `saju_input` | 날씨 사주 생년월일을 넣음 (생년월일 값은 보내지 않음) | `with_time` | `SajuPage.tsx` `BirthForm` |
| `saju_view` | 날씨 사주 결과가 뜸 | `scene`(내 기운 이름), `score`, `strength`(신강·신약), `top_element`(가장 센 오행) | `SajuPage.tsx` `Reading` |
| `game_start` | 구름 합치기 한 판의 첫 그림을 떨어뜨림 (페이지만 열고 안 한 사람과 구분) | `again`(다시 하기로 시작), `logged_in`, `wind_ms`(오늘 우리 구 풍속) | `CloudMergePage.tsx` `onUp` |
| `game_round` | 구름 합치기 라운드를 깸 | `round`(깬 라운드), `score`(그때 총점), `logged_in`(각을 받는지) | `CloudMergePage.tsx` `onScore` |
| `game_over` | 구름 합치기가 넘쳐서 끝남 | `round`(끝난 라운드), `score`, `best`(최고 기록 갱신), `drops`(떨어뜨린 횟수) | `CloudMergePage.tsx` `onOver` |
| `각_보기` (코드 `view_gak`) | 각 상세 시트가 열려 데이터가 뜸 (같은 각은 한 번만) | `index_id`, `gak_name`, `score`, `rank` | `Sheets.tsx` `GakSheet` |
| `글_열기` (코드 `select_content`) | 글 시트가 열려 데이터가 뜸 (같은 글은 한 번만) | `content_type: 'article'`, `item_id`(글 번호), `category`(분류 이름) | `Sheets.tsx` `ArticleSheet` |
| `공유` (코드 `share`) | 공유창으로 보내기 성공, 또는 이미지 내려받기 | `content_type: 'image'`, `item_id`(공유 제목), `method: 'share_sheet' \| 'download'`, `ratio`(이미지 비율) | `Sheets.tsx` `ShareSheet` `send` |
| `로그인` (코드 `login`) | 로그인 성공 (이미 있던 계정) | `method: 'id' \| 'google' \| 'toss'`(앱인토스) | `Sheets.tsx` `LoginSheet` `done`, `TossLoginSheet` |
| `회원가입` (코드 `sign_up`) | 가입 성공 (구글·토스로 처음 들어와 계정이 새로 생김, 서버 응답 `is_new`) | `method: 'id' \| 'google' \| 'toss'` | `Sheets.tsx` `LoginSheet` `done`, `TossLoginSheet` |
| `지역_변경` (코드 `region_change`) | 지역 목록에서 고름, 위치로 가까운 구를 찾음, 또는 다시 들어왔을 때 지금 위치로 구가 바뀜 | `region_name`, `method: 'list' \| 'location' \| 'auto'` | `Sheets.tsx` `RegionSheet`, `region.tsx` `locate`·`follow` |
| `설치배너_노출` (코드 `install_banner_view`) | 오늘 탭의 '홈 화면에 추가' 카드가 보임 (설치할 수 있는 곳에서, 닫은 지 2주 안 지났으면 안 보임) | 없음 | `installBanner.tsx` `InstallBanner` |
| `설치_누름` (코드 `install_click`) | '홈 화면에 추가'를 누름 | `from: 'banner' \| 'menu'`(카드·내 정보 메뉴), `method: 'prompt' \| 'guide'`(설치창을 띄움·기기별 안내를 염) | `install.ts` `useInstall` |
| `설치_선택` (코드 `install_choice`) | 설치창에서 고름 (안드로이드·PC Chrome·Edge) | `outcome: 'accepted' \| 'dismissed'` | `install.ts` `promptInstall` |
| `설치_완료` (코드 `install_done`) | 설치 완료 (브라우저가 `appinstalled`를 줄 때만. 아이폰은 오지 않음) | 없음 | `install.ts` |
| `앱_실행` (코드 `app_launch`) | 홈 화면 아이콘(설치한 앱)으로 엶, 또는 날씨각 안드로이드 앱(웹뷰)을 켬 | `mode: 'standalone' \| 'android_app'`, `version`(앱일 때 앱 버전) | `main.tsx` |
| `앱_연결_오류` (코드 `app_bridge_error`) | 앱 안에서 웹이 앱에 시킨 일이 실패함 (사용자가 구글 계정창·공유창을 닫거나 위치 권한을 거부한 것은 안 보냄) | `action: 'google_login' \| 'share' \| 'location'` | `googleLogin.tsx` `AppGoogleButton`, `Sheets.tsx` `ShareSheet` `send`, `region.tsx` `findNearest` |
| `첫화면_멈춤` (코드 `boot_stuck`) | 8초 넘게 '날씨 불러오는 중' 첫 화면이 남음 (페이지마다 한 번) | `reason`(첫 오류 문구, 100자), `seconds`, `tries`(연달아 다시 불러온 횟수), `app_started`(앱 파일 실행 여부) | `index.html` 첫 화면 스크립트 |
| `창_열기` (코드 `sheet_open`) | 아래에서 올라오는 창이 열림 (각·글·보내기·댓글·로그인·내 정보·지역·내 각·홈 화면 추가·점수 근거·이야기 등) | `sheet`(창 종류: `gak`·`article`·`share`·`comments`·`login`·`me`·`region`·`mix`·`myGak`·`install`·`weatherWhy`·`talk`·`seasonWeek`·`contact`) | `Sheets.tsx` `SheetProvider` `open` |
| `좋아요` (코드 `like`) | 좋아요 성공 (취소는 안 보냄) | `content_type: 'post' \| 'comment' \| 'talk' \| 'hero_post' \| 'gak_post' \| 'foliage_post' \| 'events_post' \| 'season_post'`, `item_id`(포스트·댓글·글 번호). `foliage_post`는 계절 지도 카드 자리라 단풍 지도가 끝나면 첫눈 지도 카드(~12/20), 그 뒤 해돋이 지도 카드(~2월)의 좋아요가 이 값으로 찍힌다 | `Post.tsx` `FullCard`, `pinnedLike.ts`, `Sheets.tsx` `CommentRow`, `talk.tsx` |
| `댓글` (코드 `comment`) | 댓글 올리기 성공 | `post_id` | `Sheets.tsx` `CommentsSheet` `send` |
| `이야기_댓글` (코드 `talk_comment`) | 사람 글에 댓글 올리기 성공 (로그인한 사람만) | `talk_id`(글 번호) | `Sheets.tsx` `CommentsSheet` `send` |
| `약관_동의` (코드 `terms_agree`) | 댓글 쓰기 전 이용약관 동의 성공 | 없음 | `Sheets.tsx` `CommentsSheet` `agreeAndSend` |
| `신고` (코드 `report`) | 신고 성공 | `content_type: 'comment' \| 'talk'`, `reason`(신고 이유 번호) | `Sheets.tsx` `CommentMenu`, `talk.tsx` |
| `차단` (코드 `block`) | 차단 성공 | `content_type: 'comment' \| 'talk'` | `Sheets.tsx` `CommentMenu`, `talk.tsx` |
| `이야기_올림` (코드 `talk_post`) | 이야기 글 올리기 성공 | `topic`(주제 번호, 6~11 은 기념일: 할로윈·빼빼로데이·크리스마스·추석·수능 응원·연말·새해), `with_image` | `talk.tsx` 글쓰기 `submit` |
| `피드_항목_노출` (코드 `feed_item_view`) | 오늘 피드에 섞인 사람 글·행사 포스트가 처음 반쯤 보임 (한 장에 한 번) | `item_type: 'talk' \| 'event'`, `position`(피드에서 그 종류의 몇 번째) | `TodayPage.tsx` `Seen` |
| `오늘내일_전환` (코드 `hero_day_switch`) | 히어로 오늘/내일 스위치를 바꿈 | `day: 'today' \| 'tomorrow'` | `TodayPage.tsx` |
| `내일에서_오늘로` (코드 `tomorrow_to_today`) | 내일 날씨 페이지(`/tomorrow/...`) 맨 아래 '오늘 ○○ 소식 보기'를 누름 | `region_name` | `TomorrowFeed.tsx` |
| `검색_유입` (코드 `search_landing`) | 구글·네이버 검색 결과에서 지역 오늘·내일 페이지(/today·/tomorrow)로 들어옴 (페이지 열 때 한 번). 검색 결과 제목·설명 새 문구와 예전 문구의 유입을 견주려고 | `page: 'today' \| 'tomorrow'`, `engine: 'google' \| 'naver'`, `copy: 'new' \| 'old' \| 'none'`(서버가 넣은 `seo-copy` 표시, 서버가 못 채운 정적 페이지면 none. 새 문구 페이지 목록은 `backend/services/seo_copy_test.json`) | `regionContext.ts` |
| `지역안내_펼침` (코드 `region_about_open`) | 지역 오늘·내일 페이지 맨 아래 접어 둔 '○○ 날씨 안내 · 자주 묻는 질문'을 펼침 | `region_name` | `TodayPage.tsx` |
| `쇼츠_열기` (코드 `shorts_open`) | 쇼츠 페이지(/shorts/영상ID)로 들어옴 (오늘 화면 쇼츠 줄·공유 링크) | `video_id` | `Shorts.tsx` `ShortsPage` |
| `쇼츠_보기` (코드 `shorts_view`) | 쇼츠를 넘겨 다른 영상으로 감 | `video_id`, `index`(목록 순서) | `Shorts.tsx` `ShortsPage` |
| `쇼츠_소리` (코드 `shorts_sound`) | 쇼츠 소리 켜기·끄기 | `on` | `Shorts.tsx` `toggleSound` |
| `쇼츠_미리보기` (코드 `shorts_preview`) | 오늘 화면 쇼츠 줄 카드가 소리 없이 재생을 시작함 (카드마다 한 번. 웹만) | `video_id`, `trigger: 'hover' \| 'auto'`(데스크톱에서 마우스를 올림·터치 기기에서 첫 터치 뒤 첫 카드 자동) | `Shorts.tsx` `ShortCard` |
| `단풍지도_열기` (코드 `foliage_open`) | 단풍 지도 페이지(/foliage)를 엶 | 없음 | `FoliagePage.tsx` |
| `단풍명소_보기` (코드 `foliage_spot`) | 단풍 명소를 고름 | `spot_name`, `from: 'page' \| 'card'`(지도 페이지·오늘 화면 카드) | `FoliagePage.tsx`, `foliageMap.tsx` |
| `첫눈지도_열기` (코드 `first_snow_open`) | 첫눈 지도 페이지(/first-snow)를 엶 | 없음 | `FirstSnowPage.tsx` |
| `첫눈지점_보기` (코드 `first_snow_spot`) | 첫눈 지도에서 지점을 고름 | `spot_name`, `from: 'page' \| 'card'`(지도 페이지·오늘 화면 카드) | `FirstSnowPage.tsx`, `firstSnowMap.tsx` |
| `해돋이지도_열기` (코드 `sunrise_open`) | 해돋이 지도 페이지(/sunrise)를 엶 | 없음 | `SunrisePage.tsx` |
| `해돋이명소_보기` (코드 `sunrise_spot`) | 해돋이 명소를 고름 | `spot_name`, `from: 'page' \| 'card'`(지도 페이지·오늘 화면 카드) | `SunrisePage.tsx`, `sunriseMap.tsx` |
| `해돋이날짜_전환` (코드 `sunrise_day`) | 해돋이 지도 페이지에서 날짜 칩을 바꿈 (12월에만 칩이 둘) | `day: 'newyear' \| 'next'`(새해 첫날·오늘/내일) | `SunrisePage.tsx` |
| `내각_저장` (코드 `my_gak_save`) | 내 각 만들기 성공 (로그인 전엔 기기에 저장) | `gak_name` | `myGakState.ts` `create` |
| `토스소개_시작` (코드 `toss_intro_start`) | 토스판 첫 소개 화면에서 '시작하기' | 없음 | `tossIntro.tsx` |
| `토스광고_누름` (코드 `toss_ad_click`) | 토스판 오늘 탭의 '광고 보고 응원하기' 카드를 누름 (광고를 지원하는 토스 앱에서만 카드가 보임) | 없음 | `tossAd.tsx` |
| `토스광고_노출` (코드 `toss_ad_impression`) | 광고가 실제로 노출됨 (토스 SDK `impression`, 토스 광고 그룹의 노출 이력과 같은 시점) | 없음 | `tossAd.tsx` |
| `토스광고_닫음` (코드 `toss_ad_dismiss`) | 광고를 닫음 (토스 안드로이드 5.255.0 은 닫힘 이벤트가 오지 않아 안 보내질 수 있음) | 없음 | `tossAd.tsx` |
| `토스광고_실패` (코드 `toss_ad_fail`) | 광고를 불러오지 못하거나 보여 주지 못함 | `stage: 'load' \| 'show' \| 'timeout'`(불러오기 실패·보여 주기 실패·10초 넘게 불러오는 중) | `tossAd.tsx` |
| `설치배너_닫기` (코드 `install_banner_close`) | '홈 화면에 추가' 띠를 × 로 닫음 | 없음 | `installBanner.tsx` |
| `맨위로_누름` (코드 `top_button`) | 오른쪽 아래 둥근 버튼(내려갔을 때 '맨 위로')을 눌러 맨 위로 올라감 | `page`(누른 화면: `today`·`sky`·`gak`·`week`·`season`·`talk` 등) | `BLayout.tsx` `FloatButton` |
| `문의_누름` (코드 `contact_click`) | 문의 창에서 전화·이메일을 누름 (창 열림은 `창_열기`의 `sheet: 'contact'`) | `method: 'phone' \| 'email'` | `Sheets.tsx` `ContactSheet` |
| `타로_뽑기` (코드 `fortune_draw`) | 오늘 한 장에서 카드를 뽑음 (하루 한 번, 다시 열 때는 안 보냄) | `card`(각 코드) | `fortune.tsx` `useTodayCard` |
| `하루_기록` (코드 `day_log`) | 저녁 체크인을 적어 둠 (고쳐 적어도 보냄). 다녀온 곳 이름은 보내지 않음 | `mood`(1~5), `went_out`, `card_hit`(맞았어요 true·글쎄요 false·안 고름 null) | `fortune.tsx` `useTodayCard` |
| `오늘아이콘_누름` (코드 `today_icon`) | 오늘 탭 아이콘 줄에서 아이콘을 누름 | `icon`(`tarot`·`saju`·`game`·`foliage`·`firstSnow`·`sunrise`·`shorts`·`myGak`·`talk`) | `todayIcons.tsx` `TodayIcons` |
| `사주_입력` (코드 `saju_input`) | 날씨 사주 생년월일을 넣음 (생년월일 값은 보내지 않음) | `with_time` | `SajuPage.tsx` `BirthForm` |
| `사주_결과` (코드 `saju_view`) | 날씨 사주 결과가 뜸 | `scene`(내 기운 이름), `score`, `strength`(신강·중화·신약), `top_element`(가장 센 오행) | `SajuPage.tsx` `Reading` |
| `게임_시작` (코드 `game_start`) | 구름 합치기 한 판의 첫 그림을 떨어뜨림 (페이지만 열고 안 한 사람과 구분) | `again`(다시 하기로 시작), `logged_in`, `wind_ms`(오늘 우리 구 풍속), `theme`(그림: `basic`·`halloween`·`pepero`·`christmas`·`chuseok`·`suneung`·`newyear`, `holiday.ts`) | `CloudMergePage.tsx` `onUp` |
| `게임_라운드` (코드 `game_round`) | 구름 합치기 라운드를 깸 | `round`(깬 라운드), `score`(그때 총점), `logged_in`(각을 받는지) | `CloudMergePage.tsx` `onScore` |
| `게임_끝` (코드 `game_over`) | 구름 합치기가 넘쳐서 끝남 | `round`(끝난 라운드), `score`, `best`(최고 기록 갱신), `drops`(떨어뜨린 횟수) | `CloudMergePage.tsx` `onOver` |
- 공유창에서 사용자가 취소하면 `share`를 보내지 않는다.
- 구름 합치기 게임 방법 창은 `sheet_open`(`sheet: 'gameHelp'`)으로 잡혀 따로 보내지 않는다.
- 토스판은 로그인이 없어 `login` `toss`는 나가지 않는다. `id`·`sign_up`도 지금 화면에 아이디 가입이 없어 나가지 않는다.
- 가입·로그인은 둘 중 하나만 나간다: 처음이면 `sign_up`, 다시 들어오면 `login`. `id` 는 지금 화면에 아이디 가입·로그인이 없어 나가지 않는다.
- 점수 근거·댓글창 열기처럼 창으로 여는 기능은 따로 이벤트를 두지 않고 `sheet_open`의 `sheet`로 나눠 본다.
- `region_change`의 `location`은 처음 온 사람의 자동 위치 맞춤도 포함한다.
- `region_change`의 `location`은 처음 온 사람의 자동 위치 맞춤도 포함한다. `auto`는 위치로 맞춘 사람이 새로고침하거나 탭으로 돌아왔을 때 조용히 다시 맞춘 것으로, 구가 실제로 바뀐 때만 나간다 (목록에서 고른 사람은 나가지 않는다).
- 설치는 카드 노출 → 누름 → 설치 완료 → 홈 화면 실행 순서로 본다. 아이폰은 설치 완료를 알 수 없어 `app_launch`로 대신 본다.
- 새 이벤트는 `analytics.ts`의 `Events` 타입에 먼저 더한다. 타입에 없는 이름은 빌드에서 걸린다.
- 새 이벤트는 `shared/lib/analytics.ts`의 `Events` 타입과 `GA_NAME` 에 먼저 더한다 (웹·앱이 같이 씀). 타입에 없는 이름은 빌드에서 걸린다.
## 앱 (안드로이드, `mobile/`)
- **웹뷰 셸 전환(`feat/app-webview-shell`)**: 앱이 날씨각 웹을 웹뷰로 띄우는 껍데기가 되면 아래 앱 이벤트는 쓰지 않고, 웹이 같은 이벤트를 그대로 보내며 `platform: 'android_app'`으로 찍힌다. 앱 안에서 구글 로그인·공유·위치가 실패하면 `app_bridge_error`, 앱을 켜면 `app_launch`(`mode: 'android_app'`)가 나간다. 앱 사용자는 `platform`으로 가른다.
- 앱도 같은 이벤트 이름·값으로 `track()`을 부른다 (`mobile/src/lib/analytics.ts`). 모든 이벤트에 `platform: 'app'`이 붙는다.
- **아직 GA4로 보내지 않는다 (2026-11-04).** Firebase Analytics(`google-services.json`)를 붙이면 앱 시작 때 `setAnalyticsSender`로 보내는 함수를 단다. 그 전까지 `track()`은 아무것도 보내지 않는다. 개발 빌드(`__DEV__`)는 붙인 뒤에도 보내지 않는다.
- 앱에서 부르는 곳: `sheet_open`(`components/sheets/index.tsx`), `view_gak`(`sheets/gak.tsx`), `select_content`(`sheets/article.tsx`), `login`·`sign_up`(`sheets/login.tsx`, 구글만), `region_change`(`sheets/region.tsx`·`lib/region.tsx`), `like`(`post/post-card.tsx` 글, `sheets/comments.tsx` 댓글), `comment`·`report`·`block`·`terms_agree`(`sheets/comments.tsx`), `share`(`lib/share-image.ts`), `hero_day_switch`(`today/hero.tsx`), `like`의 `hero_post`·`gak_post`(`lib/pinned-like.ts`). 레벨 창·레벨업 창은 `sheet_open`(`level`·`levelUp`)으로 잡힌다. 동네 이야기: `talk_post`(`components/talk/talk.tsx` `Composer`), `like`·`report`·`block`의 `talk`(`talk/talk.tsx`), `talk_comment`(`sheets/comments.tsx`), `feed_item_view`(`app/(tabs)/index.tsx` `useSeen`, 화면에 반쯤 보일 때). 내 각: `my_gak_save`(`lib/my-gak.ts`), 만들기·상세 창은 `sheet_open`(`mix`·`myGak`). 오늘 아이콘 줄: `today_icon`(`components/today/icons.tsx`). 사주: `saju_input`(`components/saju/birth-form.tsx`), `saju_view`(`saju/reading.tsx`). 단풍 지도: `foliage_open`(`app/foliage.tsx`), `foliage_spot`(`components/foliage/*`, 화면 `page`·피드 카드 `card`). 쇼츠: `shorts_open`·`shorts_view`·`shorts_sound`(`app/shorts/[id].tsx`). 구름 합치기 게임은 앱이 웹 `/game`을 웹뷰로 띄우므로 `game_start`·`game_round`·`game_over`는 웹 페이지가 보내고 `platform: 'web'`으로 찍힌다(앱 안 게임과 웹 게임을 GA에서 나눠 볼 수 없음).
- 앱 `share`의 `ratio`는 `'card'` — 보이는 카드를 그대로 찍어 보내 비율을 고르지 않는다.
## GA4 설정
- 맞춤 값(`gak_name`, `ratio`, `region_name` 등)으로 보고서를 나눠 보려면 GA4 관리 → 맞춤 정의에서 이벤트 범위 측정기준으로 등록한다. 등록 전 값은 보고서에 소급되지 않는다.
- 확인은 GA4 보고서 → 실시간, 또는 관리 → DebugView에서 한다. 운영 빌드(`docker compose up --build frontend`, http://localhost:8080)나 운영 사이트에서 눌러 본다.
## 분석 기록
`/ga-report` 로 GA4·운영 DB 를 앞 같은 길이 기간과 비교한 기록. 사람 수 기준.
| 날짜 | 기간 | 활성 사용자(앞 기간) | 신규 | 가입(DB) | 바뀐 것 | 할 일 |
|---|---|---|---|---|---|---|
| 10/29 | 10/22~10/28 (앞: 10/15~10/21) | 206 (33). 그중 약 146명은 성남·아이폰 390x844·근무시간·한 번 열고 2~3초(자동 화면 테스트로 추정). 성남 밖 76 (약 26) | 187 (21) | 7 (구글 4·토스 3), 앞 기간 0 | 구글 검색 유입 37명(12)·참여율 72%로 실제 성장 대부분. 내일 페이지(서귀포·평택·성동·정읍)로 들어옴. 설치 카드 본 사람(테스트 뺀) 77명 중 누른 사람 0. 인스타 유입 5명. 사주 페이지 7명→결과 3명(10/28 출시, 판단 보류). 게임 GA 이벤트는 10/29부터 | 테스트 트래픽 GA에서 빼기, 맞춤 측정기준 등록, 설치 카드 손보기 (TODO.md 'GA 분석') |
+10 -7
View File
@@ -18,7 +18,7 @@
1. 요소(기온·비·바람·습도·미세먼지·햇빛 등)마다 0~100점을 매깁니다.
2. 비중(합 100%)대로 섞습니다.
3. 가장 낮은 요소로 깎습니다: **최종 = 섞은 점수 × (0.75 + 0.25 × 가장 낮은 요소 ÷ 100)**. 비중 0%인 요소는 빼고 봅니다. 한 요소가 0점이면 최대 25% 깎입니다.
3. 가장 낮은 요소로 깎습니다: **최종 = 섞은 점수 × (0.75 + 0.25 × 가장 낮은 요소 ÷ 100)**. 비중 0%인 요소는 빼고 봅니다. 한 요소가 0점이면 최대 25% 깎입니다. 비중이 있는 요소가 하나뿐인 각(우산각·우산분실각)은 깎지 않습니다.
4. 0점 조건·최대 N점 조건이 있으면 적용합니다.
그래서 100점은 **비중이 있는 요소가 모두 100점**일 때만 나옵니다.
@@ -88,7 +88,8 @@
- 1의 방식. 요소·비중·시간대·0점 조건은 각마다 다르며 [각_계산기준.md](../backend/docs/각_계산기준.md)에 있습니다.
- **오늘 점수 = 지금 구간 점수.** 지금 구간의 날씨로 계산하며, 현재 구간은 이미 지난 시각을 제외합니다. 비가 오면 그 뒤 구간 점수가 내려갑니다.
- 각의 시간대가 지금 구간과 겹치지 않아도 **현재 구간의 날씨 점수로 활성화하고 순위·피드 카드·히어로 1위 후보에 포함합니다.** 제철이 아닌 각의 비활성화는 유지합니다.
- **시간대 알맞음:** 활동 시간대와 겹치면 요소 점수 100점, 아니면 0점입니다. 가중치가 10%라면 10점 또는 0점을 반영하고, 불일치에 따른 추가 최저 요소 감점은 없습니다. 요일·달·노을·일출 요소는 기존 계산을 유지합니다.
- **시간대 알맞음은 점수에 쓰지 않습니다.** 활동 시간대에 해당하는지로 점수나 0점 조건이 달라지지 않습니다. 활동 시간대는 내일·토·일 점수에서 볼 시각을 정하는 데만 쓰입니다. 요일·달·노을·일출 요소는 기존 계산을 유지합니다.
- **우산각**은 비 한 가지로 계산합니다: 지금부터 자정까지 남은 시각의 비 확률 평균이 점수이고, 지금 비가 오면 70점에서 시작해 평균 × 30점을 더합니다 (10-7).
- 각 상세 창과 시간대 미리보기의 아침·낮·저녁·밤 점수도 각 구간의 날씨로 계산하며 하루 점수로 대체하지 않습니다.
- 내일·토·일 칸은 하루 점수(가장 좋은 시간대)입니다.
- 최종 점수는 원점수 × 중요도 배율(상 1.0 · 중 0.85 · 하 0.7)을 정수로 반올림한 값입니다. 순위와 화면 표시 모두 이 최종 점수를 사용합니다.
@@ -106,11 +107,11 @@
| 바람 | 10% | 초속 1m 이하 100 → 2m에서 85 → 12m에서 0 |
- 1처럼 가장 낮은 요소로 깎습니다.
- 비 소식이 있거나 비 확률 60% 이상이면 **최대 30점**.
- 비가 와도 따로 상한으로 묶지 않습니다. 비 소식이 있으면 비 점수가 0점이라 원래 점수는 0~45점 안에서 기온·하늘·바람에 따라 갈립니다. (예전엔 최대 30점으로 묶어, 전국이 비인 날 모든 지역이 같은 점수가 됐습니다.)
- 중기예보뿐인 날은 기온을 어림하고 바람은 70점입니다.
- 위 계산으로 나온 점수가 **원래 점수**이고, 화면에는 지금 날씨 점수(3절)와 같은 방식으로 **표시 점수로 바꿔** 보여 줍니다. 1년 치 원래 점수 분포의 순위를 평균 60·표준편차 15 정규분포의 같은 위치 점수로 바꾸는 것으로, 순서는 그대로입니다. 구간은 낮 하나라 표도 하나입니다. 원래 점수 50은 62점이고, 90점 이상은 원래 점수 94 이상에서만 나옵니다. 위쪽 끝은 3절처럼 직선으로 이어(`straighten_top`) **100점은 원래 점수 100(완벽한 날)일 때만** 나오고, 그 아래는 99→98, 97→95, 96→93, 95→92, 94→90처럼 서로 다른 점수가 됩니다. 맑고 알맞은 날이 100점으로 몰려 동점이 되던 것을 막습니다.
- 바꾸기 표: `backend/services/calc/outing_score_table.json` (`calibrated_outing`, `weekend_rank.py`). 만드는 법: `cd backend && python scripts/gen_outing_score_table.py`. 나들이 점수 규칙이 바뀌면 다시 만들어야 합니다. 표는 Open-Meteo 과거 예보(32개 지역, 364일)로 만들어 기상청 예보와 분포가 조금 다를 수 있습니다. 중기예보로 어림한 예상 점수에도 같은 표를 씁니다.
- 순위 캐시(`weekend_rank:v2:<토요일 날짜>`)는 표시 점수를 담습니다. 바꾸기 표를 적용하면서 키를 올려 옛 점수 캐시를 쓰지 않게 했습니다.
- 순위 캐시(`weekend_rank:v3:<토요일 날짜>`)는 표시 점수를 담습니다. 비 상한을 없애면서 키를 올려 옛 점수 캐시를 쓰지 않게 했습니다.
- 전국 순위: 노을 순위 대표 30곳을 점수순으로 정렬합니다.
- 당일치기: 내 지역에서 직선 20~200km 안 후보 도시 중 토·일 중 더 좋은 날 점수가 가장 높은 곳입니다. 동점이면 비 확률이 낮은 곳 → 이른 날 → 가까운 곳 순입니다. 1위가 50점 미만이면 카드를 보이지 않습니다. 표시 점수 기준 최소 62점(원래 점수 50과 같은 날씨 수준, `TRIP_MIN_SCORE`) 이상이어야 추천합니다.
@@ -294,7 +295,7 @@
> **섞은 점수** = (요소1 점수 × 비중1 + 요소2 점수 × 비중2 + …) ÷ 100
> **최종 점수** = 섞은 점수 × (0.75 + 0.25 × 가장 낮은 요소 점수 ÷ 100), 반올림
- 비중이 0%인 요소는 '가장 낮은 요소'를 고를 때 뺍니다.
- 비중이 0%인 요소는 '가장 낮은 요소'를 고를 때 뺍니다. 비중이 있는 요소가 하나뿐인 각은 깎지 않습니다.
- 가장 낮은 요소가 0점이면 25%, 50점이면 12.5%가 깎입니다. 100점은 비중이 있는 요소가 모두 100점일 때만 나옵니다.
**예시: 저녁 구간 지금 날씨 점수**
@@ -344,10 +345,12 @@
| 종류 | 식 | 쓰는 각 |
|---|---|---|
| 요일 | 요일·공휴일마다 정한 점수 | 19개 |
| 시간대 알맞음 | 활동 시간대와 겹치면 100점, 아니면 0점. 가중치 10%라면 10점 또는 0점 반영(불일치 추가 감점 없음) | fixed 유형 |
| 달 | 20 + 80 × (1 − 달이 비추는 정도). 달이 비추는 정도 = 달의 빛나는 면 × 21~26시 중 달이 떠 있는 비율 | 별보기각 |
| 노을 | 그날 노을 점수 (10-9) | 사진산책각 |
- **시간대 알맞음은 없습니다.** 야장각은 저녁에 하는 행동이라는 건 이름이 말해 주므로, 활동 시간대에 해당하는지는 점수에 넣지 않습니다. 시간 요소는 위 표의 요일·달·노을뿐이고, 이 요소가 없던 각의 비중은 다른 요소로 5% 단위로 나눴습니다. 요소가 3개 미만이 된 각에는 알맞은 요소를 더했습니다 (뜨아각 비·바람, 파전각·감성노래각 습도, 감사각 바람, 선크림각 햇빛).
- **우산각(비 한 가지):** 지금부터 자정까지 남은 시각의 비 확률 평균이 점수입니다. 지금 비가 오면 70점에서 시작해 평균 × 30점을 더하고(그 시각은 100%로 침), 비가 안 오면 평균 × 100점입니다. '지금 비'는 초단기실황 관측값으로 정하고, 실황이 없으면 초단기예보·단기예보를 씁니다. 남은 시각이 모두 100%이고 지금 비가 오면 100점입니다. 내일·토·일 칸과 구간 미리보기의 다른 구간은 '지금'이 없어 평균 × 100점입니다. 예(오전 11시, 남은 13시간): 지금 비 오고 하루 종일 100% → 100점, 지금 비 오는데 오후 3시에 그침 → 79점, 지금은 안 오고 저녁 6시~자정 100% → 46점, 하루 종일 30% → 30점.
- **우산분실각(비 한 가지, 지금과 앞으로만):** 점수 = 우산을 챙겼을 정도 × 비가 안 오는 시간의 비율. 챙겼을 정도는 지금 비가 오면 100%, 아니면 지금부터 자정까지 가장 높은 비 확률입니다. 비가 안 오는 시간의 비율은 100% − 남은 시각의 비 확률 평균입니다(지금 비가 오면 그 시각은 100%로 침). 지난 시각에 비가 왔는지는 보지 않습니다. 저장된 지난 시각 값은 관측이 아니라 예보라서 실제와 다를 수 있기 때문입니다. 0점 조건은 없습니다. 예(오전 11시, 남은 13시간): 지금 비 오고 곧 그침 → 92점, 지금은 안 오는데 저녁 6시~자정 비 100% → 54점, 지금 비 오고 계속 60% → 37점, 하루 종일 비 → 0점, 비 소식 없음 → 0점. 내일·토·일 칸은 그날 9~22시로 같은 식을 씁니다.
- **며칠 뒤 비까지 보는 각:** 세차각은 비 올 확률을 2일 뒤까지 보고, 그중 가장 높은 값을 씁니다.
- **최종 점수**는 원점수 × 중요도 배율(상 1.0 · 중 0.85 · 하 0.7)을 정수로 반올림한 값입니다. 순위와 화면 표시에 같은 점수를 사용합니다.
- **먼 날의 예상 점수:** 단기예보가 닿지 않는 날(주말 등)은 중기예보의 최저·최고 기온으로 시간별 기온을 어림합니다(새벽 6시 최저, 오후 3시 최고, 그 사이는 코사인 곡선). 비 확률은 오전·오후 값을 쓰고, 바람·습도·미세먼지·햇빛은 정보 없음(70점)입니다. 조건은 비 확률만 봅니다.
@@ -363,7 +366,7 @@
| 하늘 | 15% | 시간마다 맑음 100 · 구름많음 80 · 흐림 50 점의 평균 |
| 바람 | 10% | ③ 괜찮은 바람 초속 4m, 한계 12m |
- 비 소식이 있거나 비 확률이 60% 이상이면 **최대 30점**입니다.
- 비가 와도 따로 상한으로 묶지 않습니다. 비 소식이 있으면 비 점수가 0점이라 원래 점수는 0~45점 안에서 갈립니다.
- 중기예보뿐인 날은 기온을 어림하고(10-7), 하늘은 그날 하늘 하나, 바람은 70점입니다.
- **전국 순위:** 대표 30곳을 점수 순으로 줄 세웁니다.
- **당일치기:** 내 지역에서 직선 20~200km 안 후보 도시 중 토·일 가운데 더 좋은 날의 점수가 가장 높은 곳입니다. 동점이면 비 확률이 낮은 곳, 이른 날, 가까운 곳 순입니다. 1위가 50점 미만이면 카드를 보여 주지 않습니다.
+278
View File
@@ -0,0 +1,278 @@
# 지역 주소 목록
`region.json`에서 name과 path만 뽑은 목록으로 총 269개.
## 사용법
연결링크 https://weather.o2o.kr/today/{path}
| name | path |
|---|---|
| 서울 종로구 | seoul/jongno |
| 서울 중구 | seoul/jung |
| 서울 용산구 | seoul/yongsan |
| 서울 성동구 | seoul/seongdong |
| 서울 광진구 | seoul/gwangjin |
| 서울 동대문구 | seoul/dongdaemun |
| 서울 중랑구 | seoul/jungnang |
| 서울 성북구 | seoul/seongbuk |
| 서울 강북구 | seoul/gangbuk |
| 서울 도봉구 | seoul/dobong |
| 서울 노원구 | seoul/nowon |
| 서울 은평구 | seoul/eunpyeong |
| 서울 서대문구 | seoul/seodaemun |
| 서울 마포구 | seoul/mapo |
| 서울 양천구 | seoul/yangcheon |
| 서울 강서구 | seoul/gangseo |
| 서울 구로구 | seoul/guro |
| 서울 금천구 | seoul/geumcheon |
| 서울 영등포구 | seoul/yeongdeungpo |
| 서울 동작구 | seoul/dongjak |
| 서울 관악구 | seoul/gwanak |
| 서울 서초구 | seoul/seocho |
| 서울 강남구 | seoul/gangnam |
| 서울 송파구 | seoul/songpa |
| 서울 강동구 | seoul/gangdong |
| 전남 목포시 | jeonnam/mokpo |
| 전남 여수시 | jeonnam/yeosu |
| 전남 순천시 | jeonnam/suncheon |
| 전남 나주시 | jeonnam/naju |
| 전남 광양시 | jeonnam/gwangyang |
| 광주 동구 | gwangju/dong |
| 광주 서구 | gwangju/seo |
| 광주 남구 | gwangju/nam |
| 광주 북구 | gwangju/buk |
| 광주 광산구 | gwangju/gwangsan |
| 전남 담양군 | jeonnam/damyang |
| 전남 곡성군 | jeonnam/gokseong |
| 전남 구례군 | jeonnam/gurye |
| 전남 고흥군 | jeonnam/goheung |
| 전남 보성군 | jeonnam/boseong |
| 전남 화순군 | jeonnam/hwasun |
| 전남 장흥군 | jeonnam/jangheung |
| 전남 강진군 | jeonnam/gangjin |
| 전남 해남군 | jeonnam/haenam |
| 전남 영암군 | jeonnam/yeongam |
| 전남 무안군 | jeonnam/muan |
| 전남 함평군 | jeonnam/hampyeong |
| 전남 영광군 | jeonnam/yeonggwang |
| 전남 장성군 | jeonnam/jangseong |
| 전남 완도군 | jeonnam/wando |
| 전남 진도군 | jeonnam/jindo |
| 전남 신안군 | jeonnam/sinan |
| 부산 중구 | busan/jung |
| 부산 서구 | busan/seo |
| 부산 동구 | busan/dong |
| 부산 영도구 | busan/yeongdo |
| 부산 부산진구 | busan/busanjin |
| 부산 동래구 | busan/dongnae |
| 부산 남구 | busan/nam |
| 부산 북구 | busan/buk |
| 부산 해운대구 | busan/haeundae |
| 부산 사하구 | busan/saha |
| 부산 금정구 | busan/geumjeong |
| 부산 강서구 | busan/gangseo |
| 부산 연제구 | busan/yeonje |
| 부산 수영구 | busan/suyeong |
| 부산 사상구 | busan/sasang |
| 부산 기장군 | busan/gijang |
| 대구 중구 | daegu/jung |
| 대구 동구 | daegu/dong |
| 대구 서구 | daegu/seo |
| 대구 남구 | daegu/nam |
| 대구 북구 | daegu/buk |
| 대구 수성구 | daegu/suseong |
| 대구 달서구 | daegu/dalseo |
| 대구 달성군 | daegu/dalseong |
| 대구 군위군 | daegu/gunwi |
| 인천 제물포구 | incheon/jemulpo |
| 인천 영종구 | incheon/yeongjong |
| 인천 미추홀구 | incheon/michuhol |
| 인천 연수구 | incheon/yeonsu |
| 인천 남동구 | incheon/namdong |
| 인천 부평구 | incheon/bupyeong |
| 인천 계양구 | incheon/gyeyang |
| 인천 서해구 | incheon/seohae |
| 인천 검단구 | incheon/geomdan |
| 인천 강화군 | incheon/ganghwa |
| 인천 옹진군 | incheon/ongjin |
| 대전 동구 | daejeon/dong |
| 대전 중구 | daejeon/jung |
| 대전 서구 | daejeon/seo |
| 대전 유성구 | daejeon/yuseong |
| 대전 대덕구 | daejeon/daedeok |
| 울산 중구 | ulsan/jung |
| 울산 남구 | ulsan/nam |
| 울산 동구 | ulsan/dong |
| 울산 북구 | ulsan/buk |
| 울산 울주군 | ulsan/ulju |
| 세종시 | sejong/sejong |
| 경기 수원시 | gyeonggi/suwon |
| 경기 수원시 장안구 | gyeonggi/suwon/jangan |
| 경기 수원시 권선구 | gyeonggi/suwon/gwonseon |
| 경기 수원시 팔달구 | gyeonggi/suwon/paldal |
| 경기 수원시 영통구 | gyeonggi/suwon/yeongtong |
| 경기 성남시 | gyeonggi/seongnam |
| 경기 성남시 수정구 | gyeonggi/seongnam/sujeong |
| 경기 성남시 중원구 | gyeonggi/seongnam/jungwon |
| 경기 성남시 분당구 | gyeonggi/seongnam/bundang |
| 경기 의정부시 | gyeonggi/uijeongbu |
| 경기 안양시 | gyeonggi/anyang |
| 경기 안양시 만안구 | gyeonggi/anyang/manan |
| 경기 안양시 동안구 | gyeonggi/anyang/dongan |
| 경기 부천시 | gyeonggi/bucheon |
| 경기 부천시 원미구 | gyeonggi/bucheon/wonmi |
| 경기 부천시 소사구 | gyeonggi/bucheon/sosa |
| 경기 부천시 오정구 | gyeonggi/bucheon/ojeong |
| 경기 광명시 | gyeonggi/gwangmyeong |
| 경기 평택시 | gyeonggi/pyeongtaek |
| 경기 동두천시 | gyeonggi/dongducheon |
| 경기 안산시 | gyeonggi/ansan |
| 경기 안산시 상록구 | gyeonggi/ansan/sangnok |
| 경기 안산시 단원구 | gyeonggi/ansan/danwon |
| 경기 고양시 | gyeonggi/goyang |
| 경기 고양시 덕양구 | gyeonggi/goyang/deogyang |
| 경기 고양시 일산동구 | gyeonggi/goyang/ilsandong |
| 경기 고양시 일산서구 | gyeonggi/goyang/ilsanseo |
| 경기 과천시 | gyeonggi/gwacheon |
| 경기 구리시 | gyeonggi/guri |
| 경기 남양주시 | gyeonggi/namyangju |
| 경기 오산시 | gyeonggi/osan |
| 경기 시흥시 | gyeonggi/siheung |
| 경기 군포시 | gyeonggi/gunpo |
| 경기 의왕시 | gyeonggi/uiwang |
| 경기 하남시 | gyeonggi/hanam |
| 경기 용인시 | gyeonggi/yongin |
| 경기 용인시 처인구 | gyeonggi/yongin/cheoin |
| 경기 용인시 기흥구 | gyeonggi/yongin/giheung |
| 경기 용인시 수지구 | gyeonggi/yongin/suji |
| 경기 파주시 | gyeonggi/paju |
| 경기 이천시 | gyeonggi/icheon |
| 경기 안성시 | gyeonggi/anseong |
| 경기 김포시 | gyeonggi/gimpo |
| 경기 화성시 | gyeonggi/hwaseong |
| 경기 화성시 만세구 | gyeonggi/hwaseong/manse |
| 경기 화성시 효행구 | gyeonggi/hwaseong/hyohaeng |
| 경기 화성시 병점구 | gyeonggi/hwaseong/byeongjeom |
| 경기 화성시 동탄구 | gyeonggi/hwaseong/dongtan |
| 경기 광주시 | gyeonggi/gwangju |
| 경기 양주시 | gyeonggi/yangju |
| 경기 포천시 | gyeonggi/pocheon |
| 경기 여주시 | gyeonggi/yeoju |
| 경기 연천군 | gyeonggi/yeoncheon |
| 경기 가평군 | gyeonggi/gapyeong |
| 경기 양평군 | gyeonggi/yangpyeong |
| 충북 청주시 | chungbuk/cheongju |
| 충북 청주시 상당구 | chungbuk/cheongju/sangdang |
| 충북 청주시 서원구 | chungbuk/cheongju/seowon |
| 충북 청주시 흥덕구 | chungbuk/cheongju/heungdeok |
| 충북 청주시 청원구 | chungbuk/cheongju/cheongwon |
| 충북 충주시 | chungbuk/chungju |
| 충북 제천시 | chungbuk/jecheon |
| 충북 보은군 | chungbuk/boeun |
| 충북 옥천군 | chungbuk/okcheon |
| 충북 영동군 | chungbuk/yeongdong |
| 충북 증평군 | chungbuk/jeungpyeong |
| 충북 진천군 | chungbuk/jincheon |
| 충북 괴산군 | chungbuk/goesan |
| 충북 음성군 | chungbuk/eumseong |
| 충북 단양군 | chungbuk/danyang |
| 충남 천안시 | chungnam/cheonan |
| 충남 천안시 동남구 | chungnam/cheonan/dongnam |
| 충남 천안시 서북구 | chungnam/cheonan/seobuk |
| 충남 공주시 | chungnam/gongju |
| 충남 보령시 | chungnam/boryeong |
| 충남 아산시 | chungnam/asan |
| 충남 서산시 | chungnam/seosan |
| 충남 논산시 | chungnam/nonsan |
| 충남 계룡시 | chungnam/gyeryong |
| 충남 당진시 | chungnam/dangjin |
| 충남 금산군 | chungnam/geumsan |
| 충남 부여군 | chungnam/buyeo |
| 충남 서천군 | chungnam/seocheon |
| 충남 청양군 | chungnam/cheongyang |
| 충남 홍성군 | chungnam/hongseong |
| 충남 예산군 | chungnam/yesan |
| 충남 태안군 | chungnam/taean |
| 경북 포항시 | gyeongbuk/pohang |
| 경북 포항시 남구 | gyeongbuk/pohang/nam |
| 경북 포항시 북구 | gyeongbuk/pohang/buk |
| 경북 경주시 | gyeongbuk/gyeongju |
| 경북 김천시 | gyeongbuk/gimcheon |
| 경북 안동시 | gyeongbuk/andong |
| 경북 구미시 | gyeongbuk/gumi |
| 경북 영주시 | gyeongbuk/yeongju |
| 경북 영천시 | gyeongbuk/yeongcheon |
| 경북 상주시 | gyeongbuk/sangju |
| 경북 문경시 | gyeongbuk/mungyeong |
| 경북 경산시 | gyeongbuk/gyeongsan |
| 경북 의성군 | gyeongbuk/uiseong |
| 경북 청송군 | gyeongbuk/cheongsong |
| 경북 영양군 | gyeongbuk/yeongyang |
| 경북 영덕군 | gyeongbuk/yeongdeok |
| 경북 청도군 | gyeongbuk/cheongdo |
| 경북 고령군 | gyeongbuk/goryeong |
| 경북 성주군 | gyeongbuk/seongju |
| 경북 칠곡군 | gyeongbuk/chilgok |
| 경북 예천군 | gyeongbuk/yecheon |
| 경북 봉화군 | gyeongbuk/bonghwa |
| 경북 울진군 | gyeongbuk/uljin |
| 경북 울릉군 | gyeongbuk/ulleung |
| 경남 창원시 | gyeongnam/changwon |
| 경남 창원시 의창구 | gyeongnam/changwon/uichang |
| 경남 창원시 성산구 | gyeongnam/changwon/seongsan |
| 경남 창원시 마산합포구 | gyeongnam/changwon/masanhappo |
| 경남 창원시 마산회원구 | gyeongnam/changwon/masanhoewon |
| 경남 창원시 진해구 | gyeongnam/changwon/jinhae |
| 경남 진주시 | gyeongnam/jinju |
| 경남 통영시 | gyeongnam/tongyeong |
| 경남 사천시 | gyeongnam/sacheon |
| 경남 김해시 | gyeongnam/gimhae |
| 경남 밀양시 | gyeongnam/miryang |
| 경남 거제시 | gyeongnam/geoje |
| 경남 양산시 | gyeongnam/yangsan |
| 경남 의령군 | gyeongnam/uiryeong |
| 경남 함안군 | gyeongnam/haman |
| 경남 창녕군 | gyeongnam/changnyeong |
| 경남 고성군 | gyeongnam/goseong |
| 경남 남해군 | gyeongnam/namhae |
| 경남 하동군 | gyeongnam/hadong |
| 경남 산청군 | gyeongnam/sancheong |
| 경남 함양군 | gyeongnam/hamyang |
| 경남 거창군 | gyeongnam/geochang |
| 경남 합천군 | gyeongnam/hapcheon |
| 제주 제주시 | jeju/jeju |
| 제주 서귀포시 | jeju/seogwipo |
| 강원 춘천시 | gangwon/chuncheon |
| 강원 원주시 | gangwon/wonju |
| 강원 강릉시 | gangwon/gangneung |
| 강원 동해시 | gangwon/donghae |
| 강원 태백시 | gangwon/taebaek |
| 강원 속초시 | gangwon/sokcho |
| 강원 삼척시 | gangwon/samcheok |
| 강원 홍천군 | gangwon/hongcheon |
| 강원 횡성군 | gangwon/hoengseong |
| 강원 영월군 | gangwon/yeongwol |
| 강원 평창군 | gangwon/pyeongchang |
| 강원 정선군 | gangwon/jeongseon |
| 강원 철원군 | gangwon/cheorwon |
| 강원 화천군 | gangwon/hwacheon |
| 강원 양구군 | gangwon/yanggu |
| 강원 인제군 | gangwon/inje |
| 강원 고성군 | gangwon/goseong |
| 강원 양양군 | gangwon/yangyang |
| 전북 전주시 | jeonbuk/jeonju |
| 전북 전주시 완산구 | jeonbuk/jeonju/wansan |
| 전북 전주시 덕진구 | jeonbuk/jeonju/deokjin |
| 전북 군산시 | jeonbuk/gunsan |
| 전북 익산시 | jeonbuk/iksan |
| 전북 정읍시 | jeonbuk/jeongeup |
| 전북 남원시 | jeonbuk/namwon |
| 전북 김제시 | jeonbuk/gimje |
| 전북 완주군 | jeonbuk/wanju |
| 전북 진안군 | jeonbuk/jinan |
| 전북 무주군 | jeonbuk/muju |
| 전북 장수군 | jeonbuk/jangsu |
| 전북 임실군 | jeonbuk/imsil |
| 전북 순창군 | jeonbuk/sunchang |
| 전북 고창군 | jeonbuk/gochang |
| 전북 부안군 | jeonbuk/buan |
+4
View File
@@ -25,3 +25,7 @@ dist-ssr
dist-toss
*.ait
# deploy.sh 가 모아 두는 지난 배포 빌드 파일
.old-assets/*
!.old-assets/.gitkeep
View File
Whitespace-only changes.
+2
View File
@@ -32,6 +32,8 @@ RUN npm run build
# ---- prod: nginx로 정적 파일 제공 ----
FROM nginx:1.29-alpine AS prod
COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
# 지난 배포의 빌드 파일(deploy.sh 가 모아 둠). 이미 열어 둔 탭·구글 렌더가 예전 HTML 로 예전 파일을 불러도 뜨게 한다
COPY frontend/.old-assets/ /usr/share/nginx/html/assets/
COPY --from=build /app/frontend/dist /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s CMD wget -q -O /dev/null http://127.0.0.1/ || exit 1
+74 -7
View File
@@ -8,29 +8,92 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-D378J4X373', { platform: '%MODE%' === 'toss' ? 'toss' : 'web' });
gtag('config', 'G-D378J4X373', { platform: '%MODE%' === 'toss' ? 'toss' : /NalssigakApp\//.test(navigator.userAgent) ? 'android_app' : 'web' });
</script>
<!-- 유입 추적 (analytics.webforai.kr) — weather.o2o.kr 에서만 보낸다 -->
<script defer src="https://analytics.webforai.kr/script.js"
data-website-id="b2244cf7-9b43-49c0-b1c0-acfaaab95ddb"
data-domains="weather.o2o.kr,www.weather.o2o.kr"
data-exclude-search="true"
data-exclude-hash="true"></script>
<script>
// 이미 열었던 탭을 다시 열면 브라우저가 예전 HTML 을 다시 쓰고, 그 HTML 이 부르는 예전 빌드 파일은 배포로 지워져 첫 화면에서 멈춘다.
// 돌아왔을 때 망이 아직 안 붙어 다시 불러온 것까지 실패하기도 하니, 첫 화면이 남아 있는 동안은 계속 다시 시도한다:
// 빌드 파일을 못 받았을 때, 12초마다, 탭을 다시 볼 때, 망이 다시 붙을 때 (10초 안에 또 하지는 않는다)
// 빌드 파일을 못 받았을 때, 12초마다, 탭을 다시 볼 때, 망이 다시 붙을 때 (10초 안에 또 하지는 않는다).
// 연달아 3번 다시 불러와도 그대로면 멈추고, 8초 넘게 첫 화면이면 그 까닭과 '다시 불러오기'를 보여 주고 GA boot_stuck 으로 보낸다
(function () {
var KEY = 'nalssigak.bootReload'
var TRIES = 'nalssigak.bootTries'
var errs = []
var start = Date.now()
function tries() {
try {
return Date.now() - Number(sessionStorage.getItem(KEY) || 0) < 60000 ? Number(sessionStorage.getItem(TRIES) || 0) : 0
} catch (e) {
console.error('[boot] storage', e)
return 0
}
}
function retry() {
if (!document.getElementById('boot') || document.hidden) return
var n = tries()
try {
var last = Number(sessionStorage.getItem(KEY) || 0)
if (Date.now() - last < 10000) return
if (Date.now() - Number(sessionStorage.getItem(KEY) || 0) < 10000 || n >= 3) return
sessionStorage.setItem(KEY, String(Date.now()))
sessionStorage.setItem(TRIES, String(n + 1))
} catch (e) {
console.error('[boot] storage', e)
}
location.reload()
if (n < 1) return location.reload()
// 두 번째부터는 폰에 남은 빌드 파일(1년 캐시)이 깨졌을 수 있어 새로 받아 덮고, 서비스 워커도 걷어낸 뒤 다시 불러온다
var files = [].map.call(document.querySelectorAll('script[src^="/"],link[rel=stylesheet][href^="/"],link[rel=modulepreload][href^="/"]'), function (el) {
return fetch(el.src || el.href, { cache: 'reload' }).catch(function (e) {
console.error('[boot] refetch', e)
})
})
var sw = navigator.serviceWorker ? navigator.serviceWorker.getRegistrations().then(function (rs) {
return Promise.all(rs.map(function (r) { return r.unregister() }))
}) : null
Promise.all(files.concat(sw ? [sw] : [])).then(function () { location.reload() }, function (e) {
console.error('[boot] cleanup', e)
location.reload()
})
}
function note(msg) {
if (errs.length < 3) errs.push(String(msg).slice(0, 160))
}
window.addEventListener('error', function (e) {
var el = e.target
if (el && (el.tagName === 'SCRIPT' || el.tagName === 'LINK') && (el.src || el.href || '').indexOf(location.origin + '/') === 0) retry()
if (el && (el.tagName === 'SCRIPT' || el.tagName === 'LINK')) {
var url = el.src || el.href || ''
if (url.indexOf(location.origin + '/') !== 0) return
note('파일 못 받음 ' + url.slice(location.origin.length))
retry()
return
}
note((e.message || 'error') + (e.filename ? ' @' + e.filename.split('/').pop() + ':' + e.lineno : ''))
}, true)
window.addEventListener('unhandledrejection', function (e) {
var r = e.reason
note('promise ' + (r && r.message ? r.message : String(r)))
})
setTimeout(function () {
var boot = document.getElementById('boot')
if (!boot) return
var reason = errs[0] || (window.__appStarted ? '앱이 떴지만 첫 화면을 못 걷음' : '앱 파일이 실행되지 않음')
var p = document.createElement('p')
p.style.cssText = 'margin:0 24px;font:12px/1.5 sans-serif;opacity:.7;text-align:center;word-break:break-all'
p.textContent = errs.length ? errs.join(' / ') : reason
var b = document.createElement('button')
b.textContent = '다시 불러오기'
b.style.cssText = 'padding:10px 20px;border:0;border-radius:999px;background:#28304a;color:#fff;font:16px Jua,sans-serif'
b.onclick = function () {
location.reload()
}
boot.appendChild(p)
boot.appendChild(b)
gtag('event', '첫화면_멈춤', { reason: reason.slice(0, 100), seconds: Math.round((Date.now() - start) / 1000), tries: tries(), app_started: !!window.__appStarted })
}, 8000)
var timer = setInterval(function () {
if (document.getElementById('boot')) retry()
else clearInterval(timer)
@@ -120,7 +183,7 @@
<body>
<!-- 앱이 뜨기 전 첫 화면: 정적 소개 글이 잠깐 보이지 않게 덮는다. 앱이 뜨면 지운다 -->
<div id="boot" data-nosnippet role="status" style="position:fixed;inset:0;z-index:60;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#d6ebff;color:#28304a;font:19px Jua,sans-serif">
<img src="/icons/rabbit.png" alt="" width="88" height="88" />
<img src="/icons/rabbit.webp" alt="날씨각 토끼 캐릭터" width="88" height="88" />
<p style="margin:0">날씨 불러오는 중…</p>
</div>
<!-- 검색 결과 요약은 화면 글 대신 description 을 쓰게 한다 (지역 페이지는 서버가 오늘 날씨로 채움) -->
@@ -142,6 +205,10 @@
<p>같은 날씨끼리 합쳐 해를 만드는 구름 합치기 게임이에요. 우리 동네 지금 바람만큼 구름이 옆으로 밀려 떨어져요.</p>
<h2><a href="/foliage">단풍 지도</a></h2>
<p>산림청 단풍 절정 예측으로 전국 단풍 명소의 절정 시기를 지도에서 확인하세요.</p>
<h2><a href="/first-snow">첫눈 지도</a></h2>
<p>서울, 춘천, 대전, 광주, 대구, 부산, 제주 등 전국 지역별 평년 첫눈 날짜와 앞으로 7일 눈 예보를 지도에서 확인하세요.</p>
<h2><a href="/sunrise">해돋이 지도</a></h2>
<p>정동진, 호미곶, 간절곶, 성산일출봉 같은 전국 해돋이 명소의 새해 첫날 해 뜨는 시각을 지도에서 확인하세요.</p>
<h2><a href="/talk">동네 이야기</a></h2>
<p>지금 우리 동네 하늘과 노을, 비·눈, 단풍·꽃, 오늘 옷차림 이야기를 동네 사람들과 나눠요.</p>
<h2><a href="/shorts">날씨 쇼츠</a></h2>
+5
View File
@@ -26,6 +26,11 @@ server {
try_files $uri =404;
}
location /b/icons/ {
add_header Cache-Control "public, max-age=604800";
try_files $uri =404;
}
# 인스타 올리기는 백엔드가 인스타 쪽 처리(캐러셀 컨테이너·영상 변환)를 기다리느라 1분을 넘길 수 있다 (기본 60s 면 504)
location ~ ^/v1/(card|reel)/[0-9]+/instagram$ {
resolver 127.0.0.11 valid=10s ipv6=off;
@@ -0,0 +1,10 @@
[
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "kr.o2o.nalssigak",
"sha256_cert_fingerprints": ["A8:AB:9E:E2:CF:BA:38:22:91:4D:82:4C:C2:50:AB:2A:85:2E:42:9C:0C:E3:D5:5F:AE:0C:C1:DE:60:95:07:DF"]
}
}
]
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Loaded 100 of 442 files, more files were not shown because too many files have changed in this diff. Show more