Skip to content

[Fix/Refactor] Facility API distanceM 버그 수정 및 facilityType 타입 통일#79

Merged
angoroa merged 2 commits intodevelopfrom
fix/facility
Mar 14, 2026
Merged

[Fix/Refactor] Facility API distanceM 버그 수정 및 facilityType 타입 통일#79
angoroa merged 2 commits intodevelopfrom
fix/facility

Conversation

@angoroa
Copy link
Member

@angoroa angoroa commented Mar 14, 2026

#️⃣Issue Number

📝 요약(Summary)

구장 마커 API 응답에서 distanceM이 항상 0으로 반환되는 버그를 수정하고,
Facility 응답 DTO의 facilityType 필드 타입을 String에서 FacilityType enum으로 통일했습니다.

버그 원인: FacilityMapper.toMarkerResponse()에서 .distanceM() 매핑 호출이 누락되어 기본값 0이 반환됨.

타입 통일 이유: FacilityNearResponse, FacilityMarkerResponseString을 사용하고 FacilityResponseFacilityType enum을 사용하는 불일치
상태였음. 클라이언트에서 일관된 타입으로 응답을 받을 수 있도록 통일.

🛠️PR 유형

어떤 변경 사항이 있나요?

  • 새로운 기능 추가
  • 버그 수정
  • CSS 등 사용자 UI 디자인 변경
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

📸스크린샷 (선택)

💬 공유사항 to 리뷰어

  • FacilityMapper.toMarkerResponse().distanceM((int) Math.round(p.getDistanceM())) 한 줄 추가로 버그 수정
  • FacilityNearResponse, FacilityMarkerResponsefacilityType 필드를 FacilityType enum으로 변경하고, Mapper에서 FacilityType.valueOf()로 변환 처리

✅ PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

Summary by CodeRabbit

변경 사항

  • 리팩토링
    • 시설 정보 응답 데이터 구조가 개선되었습니다. 시설 마커 및 인근 시설 조회에서 시설 유형 데이터가 더욱 일관되게 처리됩니다.

@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: a076ddaa-34e6-4786-9153-e8db81532e8a

📥 Commits

Reviewing files that changed from the base of the PR and between 9720da6 and 04b9bfd.

📒 Files selected for processing (3)
  • src/main/java/com/be/sportizebe/domain/facility/dto/response/FacilityMarkerResponse.java
  • src/main/java/com/be/sportizebe/domain/facility/dto/response/FacilityNearResponse.java
  • src/main/java/com/be/sportizebe/domain/facility/mapper/FacilityMapper.java

Walkthrough

Facility API 응답 DTO의 facilityType 필드 타입을 String에서 FacilityType enum으로 변경하고, 매퍼에서 문자열을 enum으로 변환하는 로직을 추가했습니다.

Changes

Cohort / File(s) Summary
DTO 타입 변경
src/main/java/com/be/sportizebe/domain/facility/dto/response/FacilityMarkerResponse.java, src/main/java/com/be/sportizebe/domain/facility/dto/response/FacilityNearResponse.java
facilityType 필드를 String에서 FacilityType enum으로 변경하고 해당 import 추가. 직렬화/역직렬화 데이터 타입 변경.
매퍼 로직 업데이트
src/main/java/com/be/sportizebe/domain/facility/mapper/FacilityMapper.java
toNearResponsetoMarkerResponse 메서드에서 FacilityType.valueOf()를 사용하여 문자열을 enum으로 변환. toMarkerResponse에 거리(distanceM) 계산 로직 추가.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 문자열을 enum으로 변신시키니,
API 응답이 더욱 단단해지네!
세 파일이 함께 춤을 추며,
타입 안정성을 맞이하도다. ✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/facility
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can disable poems in the walkthrough.

Disable the reviews.poem setting to disable the poems in the walkthrough.

@angoroa angoroa merged commit 4d0d478 into develop Mar 14, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix/Refactor] Facility API 응답 데이터 오류 수정

1 participant