[SCRUM-293] 대한민국 판별 API 구현 (#140)#142
Merged
moonxxpower merged 5 commits intodevelopfrom Sep 23, 2025
Hidden character warning
The head ref may contain hidden characters: "SCRUM-293-\ub300\ud55c\ubbfc\uad6d-\ud310\ubcc4-API-\uad6c\ud604"
Merged
Conversation
카카오 지도에서 제공하는 좌표로 행정구역 정보를 변환하는 API를 연동했습니다. 주소가 등록되지 않은 지역에서도 결과값을 도출할 수 있습니다.
사용자가 생성한 코스의 시작점, 경유지, 도착점 좌표가 대한민국 내에 있는지 검증하여, 대한민국이 아닌 코스 데이터를 필터링합니다. 아래와 같은 방식으로 동작합니다. - 대한민국 경계 좌표를 통해 1차 필터링 - 통과한 좌표에 한해 카카오 지도 API를 통해 행정구역 정보를 조회 - 맞닿아 있는 해외에 한해 (일본, 중국, 북한 등) 응답이 옴으로 시도단위인 region_1depth_name 유무로 판별
대한민국 판별 API의 서비스 메서드들에 대하여 테스트 코드를 구현하고 테스트를 진행했습니다. (성공 2개)
ssggii
reviewed
Sep 22, 2025
src/main/java/com/server/running_handai/domain/course/service/CourseService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/server/running_handai/domain/course/service/CourseService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/server/running_handai/domain/course/service/CourseService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/server/running_handai/domain/course/service/KakaoMapService.java
Outdated
Show resolved
Hide resolved
Contributor
|
Member
Author
|
넵! 정확도가 행정구역 분리 API가 더 높은 것 같아 건의드렸습니다:) 사실 코스 지역, 테마 판별 로직이 추후에 수정될 수 있을거 같아서 그때 수정해도 될 거 같습니다! |
경계좌표를 상수로 선언해 관리 편의성을 증가시키고, 단일 좌표 판별 로직을 별도 메서드로 분리하여 재사용성을 향상시켰습니다. 추가적으로 allMatch를 사용해 false가 나오면 즉시 종료하게 만들어 불필요한 호출 횟수를 줄였습니다.
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.
✏️ 연관 이슈
#140
⛳ 작업 내용
💬리뷰 요구사항
📍 참고사항
address_name으로 제공합니다.{ "code": -2, "msg": "The input parameter value is not in the service area" }{ "meta": { "total_count": 2 }, "documents": [ { "region_type": "B", "code": "2650010300", "address_name": "부산광역시 수영구 민락동", "region_1depth_name": "부산광역시", "region_2depth_name": "수영구", "region_3depth_name": "민락동", "region_4depth_name": "", "x": 129.1254459421262, "y": 35.15726484072749 }, { "region_type": "H", "code": "2650080000", "address_name": "부산광역시 수영구 민락동", "region_1depth_name": "부산광역시", "region_2depth_name": "수영구", "region_3depth_name": "민락동", "region_4depth_name": "", "x": 129.1254459421262, "y": 35.15726484072749 } ] }