Skip to content

[FEAT/#111] 마이페이지 API 연결#115

Merged
nhyeonii merged 11 commits intodevelopfrom
feat/#111-my-page-api
Jan 20, 2026
Merged

[FEAT/#111] 마이페이지 API 연결#115
nhyeonii merged 11 commits intodevelopfrom
feat/#111-my-page-api

Conversation

@nhyeonii
Copy link
Copy Markdown
Contributor

@nhyeonii nhyeonii commented Jan 20, 2026

Related issue 🛠

Work Description ✏️

  • 마이페이지에서 데이터를 받아와요

Screenshot 📸

image

Uncompleted Tasks 😅

  • N/A

To Reviewers 📢

마이페이지 서버를 연결했어요

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 마이페이지용 원격 프로필 조회 기능 추가
    • 사용자 이름 및 가입 경과일 표시
    • 앱 실행 시 마이페이지 프로필 자동 로드 및 초기 로딩 상태 반영
  • 개선

    • 원격 응답을 화면용 데이터로 변환해 표시
    • 데이터 로딩 실패 시 로그 훅으로 오류 흐름 보강

✏️ Tip: You can customize this high-level summary in your review settings.

@nhyeonii nhyeonii self-assigned this Jan 20, 2026
@nhyeonii nhyeonii requested a review from a team as a code owner January 20, 2026 13:20
@nhyeonii nhyeonii added FEAT✨ 새로운 기능 구현 나현🍒 나현 담당 labels Jan 20, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 20, 2026

Walkthrough

Retrofit 서비스, DTO/모델, 데이터소스(인터페이스+구현), 저장소(인터페이스+구현), DI 바인딩을 추가하고 MyPageViewModel을 저장소 주입 및 초기 로드로 변경합니다.

Changes

코호트 / 파일(s) 변경 요약
DI 모듈
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
MyPage 관련 바인딩/제공자 추가: @BindsMyPageDataSource/MyPageRepository 등록 및 @ProvidesMyPageService 제공(싱글톤)
원격 서비스
app/src/main/java/com/cherrish/android/data/remote/service/MyPageService.kt
GET "api/users" 엔드포인트를 갖는 MyPageService 인터페이스 추가
DTO / 모델
app/src/main/java/com/cherrish/android/data/remote/dto/response/UsersResponseDto.kt, app/src/main/java/com/cherrish/android/data/model/UsersResponseModel.kt
UsersResponseDto(@Serializable) 및 UsersResponseModel 데이터 클래스 추가, UsersResponseDto.toModel() 변환 확장함수 추가
데이터소스 계층
app/src/main/java/com/cherrish/android/data/remote/datasource/MyPageDataSource.kt, app/src/main/java/com/cherrish/android/data/remote/datasourceimpl/MyPageDataSourceImpl.kt
MyPageDataSource 인터페이스와 MyPageDataSourceImpl(주입된 MyPageService에 위임) 추가
저장소 계층
app/src/main/java/com/cherrish/android/data/repository/MyPageRepository.kt, app/src/main/java/com/cherrish/android/data/repositoryimpl/MyPageRepositoryImpl.kt
MyPageRepository 인터페이스 및 MyPageRepositoryImpl 추가. 데이터소스 호출을 suspendRunCatching으로 래핑하고 DTO→모델 변환 후 Result 반환
프레젠테이션 / ViewModel
app/src/main/java/com/cherrish/android/presentation/mypage/MyPageViewModel.kt
생성자를 MyPageRepository 주입으로 변경, 초기 상태를 Loading으로 변경, init에서 프로필 자동 로드(loadMyPageProfile) 및 UI 상태 갱신 로직 추가

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)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • hyeminililo
  • sohee6989
  • usuuhyn
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목 '[FEAT/#111] 마이페이지 API 연결'은 마이페이지 서버 API 연결이라는 주요 변경사항을 명확하고 간결하게 설명합니다.
Description check ✅ Passed PR 설명이 템플릿의 주요 섹션(관련 이슈, 작업 내용, 스크린샷, 미완료 항목, 리뷰 알림)을 모두 포함하고 있습니다.
Linked Issues check ✅ Passed 마이페이지 API 연결 요구사항이 충분히 구현되었습니다: 서비스, 데이터소스, 저장소 계층이 추가되었고 ViewModel에서 사용자 프로필을 자동으로 로드합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 마이페이지 API 연결 구현(#111)의 범위 내에 있으며 out-of-scope 변경사항은 없습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

# 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
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@usuuhyn usuuhyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셧습니다. .. . .. .. ... 완벽하네요잉. ..
400476535bfd83be64d6ad0e23f85198

import com.cherrish.android.data.model.UsersResponseModel

interface MyPageRepository {
suspend fun getUsers(): Result<UsersResponseModel>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P99: getUserProfile() 네이밍 어떠신가염????

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네에 ~~

Copy link
Copy Markdown
Contributor

@sohee6989 sohee6989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확완~~~~
수고하셨습니다!!!!

# 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
@nhyeonii nhyeonii merged commit a6dad19 into develop Jan 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FEAT✨ 새로운 기능 구현 나현🍒 나현 담당

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 마이페이지 API 연결

3 participants