Conversation
WalkthroughRetrofit 서비스, DTO/모델, 데이터소스(인터페이스+구현), 저장소(인터페이스+구현), DI 바인딩을 추가하고 MyPageViewModel을 저장소 주입 및 초기 로드로 변경합니다. Changes
Sequence Diagram(s)sequenceDiagram
participant VM as MyPageViewModel
participant Repo as MyPageRepository
participant DS as MyPageDataSource
participant Svc as MyPageService
participant API as Remote API
VM->>Repo: getUsersProfile()
Repo->>DS: getUsersProfile()
DS->>Svc: getUsersProfile()
Svc->>API: GET /api/users
API-->>Svc: BaseResponse<UsersResponseDto>
Svc-->>DS: BaseResponse<UsersResponseDto>
DS-->>Repo: BaseResponse<UsersResponseDto>
Repo->>Repo: suspendRunCatching { data!!.toModel() }
Repo-->>VM: Result<UsersResponseModel>
VM->>VM: update UiState (Success/Failure)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
# Conflicts: # app/src/main/java/com/cherrish/android/data/di/DataSourceModule.kt # app/src/main/java/com/cherrish/android/data/di/RepositoryModule.kt # app/src/main/java/com/cherrish/android/data/di/ServiceModule.kt
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@app/src/main/java/com/cherrish/android/data/repositoryimpl/MyPageRepositoryImpl.kt`:
- Around line 13-16: The getUsers implementation in MyPageRepositoryImpl
currently uses a forced non-null (!!) on myPageDataSource.getUsers().data which
can throw an NPE; update the suspendRunCatching block in getUsers to check
whether myPageDataSource.getUsers().data is null and return a failed Result (or
throw a controlled exception) when null, otherwise map toModel() to
UsersResponseModel; ensure error information is propagated (e.g., create and
throw a descriptive exception or call Result.failure) so callers receive a
proper failure instead of a runtime crash.
In
`@app/src/main/java/com/cherrish/android/presentation/mypage/MyPageViewModel.kt`:
- Around line 27-38: The failure handler in loadMyPageProfile currently does
nothing, risking a stuck loading UI; inside the onLogFailure lambda of
myPageRepository.getUsers() update _uiState to an error state (e.g.,
UiState.Error with a descriptive message or the throwable) and stop any loading
flags so the UI can recover; locate loadMyPageProfile, viewModelScope.launch,
the myPageRepository.getUsers() call and replace the empty onLogFailure { } with
code that maps the failure (throwable) to _uiState.update { UiState.Error(...) }
and optionally processLogger/error logging.
usuuhyn
approved these changes
Jan 20, 2026
| import com.cherrish.android.data.model.UsersResponseModel | ||
|
|
||
| interface MyPageRepository { | ||
| suspend fun getUsers(): Result<UsersResponseModel> |
Contributor
There was a problem hiding this comment.
P99: getUserProfile() 네이밍 어떠신가염????
# Conflicts: # app/src/main/java/com/cherrish/android/data/di/DataSourceModule.kt # app/src/main/java/com/cherrish/android/data/di/RepositoryModule.kt # app/src/main/java/com/cherrish/android/data/di/ServiceModule.kt
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.

Related issue 🛠
Work Description ✏️
Screenshot 📸
Uncompleted Tasks 😅
To Reviewers 📢
마이페이지 서버를 연결했어요
Summary by CodeRabbit
릴리스 노트
새로운 기능
개선
✏️ Tip: You can customize this high-level summary in your review settings.