[ Refactor ] - 잡 변경 시 추천 근무시간 즉시 재계산 및 날씨 API 캐싱 적용 - #176
Merged
Conversation
added 3 commits
August 18, 2026 17:30
- JobCreateRequest, JobUpdateRequest의 FIXED_TASK_PER_HOUR(전 카테고리 3 고정)를 DEFAULT_TASK_PER_HOUR_BY_CATEGORY 맵으로 교체 - 배달(1)=3.5, 대리운전(2)=1.5, 가사·청소 도우미(4)=0.25 - 매핑 없는 카테고리(택배/물류 상하차, 펫시터·돌봄, 콘텐츠 제작)는 null 유지 - JobService의 기존 null-safe 예상소득 계산 경로로 흡수됨, 별도 처리 없음
- KmaForecastClient에 (nx, ny) 격자 단위 인메모리 캐시 추가 - 기상청 단기예보는 발표시각(02/05/08/11/14/17/20/23시) 단위로만 갱신되므로, 같은 격자에 대해 발표시각이 그대로면 캐시를 재사용하고 발표시각이 바뀌면 그때만 실제 API를 호출 - 일별/월별 캘린더 조회마다 매번 실제 HTTP 요청이 나가던 문제 해결 - KmaForecastClientTest 추가: 같은 격자 연속 조회 시 API 1회만 호출되는지, 다른 격자는 각각 호출되는지 검증
- JobService.registerJob/updateJob/deactivateJob에서 기존 이번 달 ALLOCATION_GOAL 삭제 후, 조회 시점까지 기다리지 않고 RecommendedWorkHoursService를 즉시 호출해 재계산·저장 - RecommendedWorkHoursService가 JobService 대신 JobMapper를 직접 주입받도록 변경 JobService -> RecommendedWorkHoursService 의존 방향을 추가하면서 생기는 순환 의존성 방지 - 위 생성자 시그니처 변경에 맞춰 JobServiceTest 등 관련 테스트 6개 수정
hanjyoon01
requested review from
KSBoscoKim,
Kimd0ng,
SOOsuhyuncho,
bigwaveBigwave and
shinh09
August 19, 2026 00:37
KSBoscoKim
approved these changes
Aug 19, 2026
shinh09
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈
작업 사항
같은 격자·같은 발표시각이면 캐시를 재사용하고 발표시각이 바뀔 때만 실제 호출
KmaForecastClientTest추가ALLOCATION_GOAL)을다음 조회 시점까지 기다리지 않고 즉시 재계산·저장하도록 변경
RecommendedWorkHoursService가JobService대신JobMapper를 직접 참조하도록 변경해 순환 의존성 방지