Conversation
…eLocationPermissionUseCase로 교체
There was a problem hiding this comment.
🤖 AI 코드 리뷰 - 아키텍처 관점
이번 PR은 위치 권한 로직을 ViewModel에서 분리해 Data/Domain 계층으로 이동시킨 리팩토링이다. CoreLocationRepository가 LocationPermissionRepository를 추가로 구현하도록 확장하고, ObserveLocationPermissionUseCase를 통해 ViewModel이 CoreLocation에 직접 의존하던 구조를 제거했다. 전반적인 방향은 계층 분리 측면에서 타당하나, 구체 타입을 Presentation 계층에서 직접 조립하는 방식과 UseCase 설계에 구조적 문제가 있다.
sangYuLv
approved these changes
Aug 14, 2026
sangYuLv
left a comment
Collaborator
There was a problem hiding this comment.
Combine을 잘 활용해주셨네요! (복습했습니다...)
LocationPermissionStatus와 LocationPermissionState가 다른 계층에 있는 모델인데, 비슷해서 헷갈릴 것 같아요. 다른 방안이 안 떠올라서 넘어가도 좋을 듯 합니다.
위 AI 리뷰에 답변하신 내용도 모두 확인했습니다.
수고 많으셨습니다 🦦
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.
JIRA
📝 작업 내용
📌 요약
MyPageViewModel(Presentation)에서CLLocationManager를 직접 소유하는 구조였습니다.CoreLocationRepository)으로 옮기고,Presentation은 Domain 타입(UseCase)을 통해서만 위치 권한 상태를 알 수 있도록 정리했습니다.
LocationPermissionRepository프로토콜을 새로 추가했습니다.🔍 상세
1. Domain 확장
LocationPermissionStatusCLAuthorizationStatus에 대응하는 순수 Domain 엔티티를 추가했습니다.LocationPermissionRepositoryauthorizationStatus)구독(
authorizationStatusPublisher)요청(
requestAuthorization())을 담당하는 프로토콜을 새로 추가했습니다.ObserveLocationPermissionUseCase2. Data 구현
authorizationStatus를 좌표 조회 내부 분기용으로만 쓰고 있었는데,이번에
LocationPermissionRepository를 채택해 권한 상태를 외부에 노출하도록 확장했습니다.CurrentValueSubject로 발행하며,기존
CLLocationManagerDelegate의locationManagerDidChangeAuthorization을 활용합니다.3. Presentation 정리
MyPageViewModel에서 사용되지 않을 코드를 모두 제거했습니다.ObserveLocationPermissionUseCase를 생성자로 주입받아,최초 상태 조회와 변경 구독(Combine)을 모두 UseCase를 통해 처리합니다.
LocationPermissionState(표시 전용 모델)에LocationPermissionStatus를 받는 이니셜라이저를 추가했습니다.MyPageViewController에서CoreLocationRepository()를 조립해ObserveLocationPermissionUseCase로 감싸 주입합니다.(DI 관련 추후 수정)💬 리뷰 노트