Skip to content

[Feature] 사용자 위치별 미세먼지 조회 기능 구현 #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

limseohyeon
Copy link
Collaborator

@limseohyeon limseohyeon commented May 12, 2025

#️⃣ 연관된 이슈

✅ 체크리스트

  • 🔀 PR 제목의 형식 맞추기
  • 💡 이슈 등록
  • 🏷️ 라벨 등록
  • 🧹 불필요한 코드 제거
  • 🧪 로컬 테스트 완료
  • 🏗️ 빌드 성공
  • 💯 테스트 통과

📝 작업 내용

기존 서울 대기 평균 값만 조회할 수 있던 것을 사용자 위치별로 조회할 수 있도록 확장했습니다.

사용자 위치 좌표 기준으로 제일 가까운 관측소 조회

  • 관측소가 서울인 경우 - 서울시 대기질 평균 조회 API 요청
  • 그 외 지역인 경우 - 관측소별 대기질 조회 API 요청

📸 스크린샷 (UI 변경 시 필수)

👀 리뷰어 가이드라인

현재 Service에 많은 역할이 할당 되어 있어 추후 리팩터링을 거칠 예정입니다.

@limseohyeon limseohyeon added this to the 미세먼지 milestone May 12, 2025
@limseohyeon limseohyeon self-assigned this May 12, 2025
@limseohyeon limseohyeon linked an issue May 12, 2025 that may be closed by this pull request
1 task
Copy link

github-actions bot commented May 12, 2025

Test Results

 81 files   81 suites   4m 52s ⏱️
286 tests 286 ✅ 0 💤 0 ❌
287 runs  287 ✅ 0 💤 0 ❌

Results for commit 4f5b6fb.

♻️ This comment has been updated with latest results.

@Dongjin0224
Copy link
Collaborator

    ObservatoryResponse observatoryResponse = getObservatory(lat, lng);
    if (isSeoul(observatoryResponse)) {
      return getCachedAirQuality("seoul").orElseGet(this::updateAriQuality);
    }

Provider에서 보면 getObservatory 가 null 값도 반환할 수 있던데 그럴 가능성은 없나요?

만약 null 이 넘어오게 된다면 isSeoul 메서드에서 널포인터가 발생할 거 같습니다

@limseohyeon
Copy link
Collaborator Author

    ObservatoryResponse observatoryResponse = getObservatory(lat, lng);
    if (isSeoul(observatoryResponse)) {
      return getCachedAirQuality("seoul").orElseGet(this::updateAriQuality);
    }

Provider에서 보면 getObservatory 가 null 값도 반환할 수 있던데 그럴 가능성은 없나요?

만약 null 이 넘어오게 된다면 isSeoul 메서드에서 널포인터가 발생할 거 같습니다

헉 그러네요! 말씀해주신 부분 확인하고 Optional로 처리한 후 널포인터 발생하지 않도록 수정했습니다.
해당 내용은 방금 커밋 및 푸시 완료했습니다.
감사합니다!

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

사용자 위치 별 미세먼지 조회 구현
2 participants