Skip to content

[Feat/#135] 회원가입 api 연결#136

Merged
jyvnee merged 1 commit intodevelopfrom
feat/#135
Jan 23, 2026
Merged

[Feat/#135] 회원가입 api 연결#136
jyvnee merged 1 commit intodevelopfrom
feat/#135

Conversation

@jyvnee
Copy link
Contributor

@jyvnee jyvnee commented Jan 23, 2026

Related issue 🛠️

Work Description ✏️

  • 회원탈퇴 연동

Uncompleted Tasks 😅

N/A

To Reviewers 📢

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 계정 탈퇴 기능 추가
    • 마이페이지에서 아티스트 선택 기능 연결
  • 버그 수정

    • 마이페이지 배지 버튼 클릭 핸들러 수정

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

@jyvnee jyvnee self-assigned this Jan 23, 2026
@jyvnee jyvnee added 🌟 Feat 새로운 기능 구현 💻 API 서버 통신 작업 ✨ 지현 labels Jan 23, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

사용자 회원탈퇴 기능을 구현하기 위해 API 연동 레이어부터 프레젠테이션 레이어까지 전반적인 기능을 추가했습니다. 원격 데이터 소스, 저장소, 뷰모델에 회원탈퇴 메서드를 추가하고, 로컬 저장소의 캐시 및 기본설정을 초기화하는 기능도 함께 구현했습니다.

Changes

Cohort / File(s) 변경 사항
원격 서비스 및 데이터 소스 계층
app/src/main/java/com/poti/android/data/remote/service/AuthService.kt,
app/src/main/java/com/poti/android/data/remote/datasource/AuthRemoteDataSource.kt
DELETE /api/v1/auth/withdrawal 엔드포인트 추가 및 서비스 위임 함수 구현
로컬 데이터 소스
app/src/main/java/com/poti/android/data/local/datasource/PreferenceDataSource.kt
clearAll() 메서드 추가로 캐시된 토큰과 모든 저장소 데이터 초기화 기능 구현
저장소 계층
app/src/main/java/com/poti/android/data/repository/AuthRepositoryImpl.kt,
app/src/main/java/com/poti/android/domain/repository/AuthRepository.kt
withdrawal() 메서드 추가 및 saveOnboardingState() 반환타입을 Result로 변경, AuthSessionManager 의존성 추가
프레젠테이션 계층 - 로그인
app/src/main/java/com/poti/android/presentation/auth/LoginViewModel.kt
KakaoLoginManager 의존성 제거로 불필요한 결합도 감소
프레젠테이션 계층 - 마이페이지
app/src/main/java/com/poti/android/presentation/user/mypage/MyPageScreen.kt,
app/src/main/java/com/poti/android/presentation/user/mypage/MyPageViewModel.kt,
app/src/main/java/com/poti/android/presentation/user/mypage/model/Contracts.kt
OnMyArtistSelectClick UI 인텐트 추가 및 배지 버튼 클릭 처리로 회원탈퇴 기능 연결, authRepository 의존성 추가

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant MyPageScreen
    participant MyPageViewModel
    participant AuthRepository
    participant AuthRemoteDataSource
    participant AuthService
    participant PreferenceDataSource
    participant AuthSessionManager

    User->>MyPageScreen: BadgeButton 클릭
    MyPageScreen->>MyPageViewModel: OnMyArtistSelectClick
    MyPageViewModel->>AuthRepository: withdrawal()
    
    par 원격 탈퇴 처리
        AuthRepository->>AuthRemoteDataSource: withdrawal()
        AuthRemoteDataSource->>AuthService: DELETE /api/v1/auth/withdrawal
        AuthService-->>AuthRemoteDataSource: BaseResponse<Unit>
        AuthRemoteDataSource-->>AuthRepository: Result.success()
    and 로컬 데이터 정리
        AuthRepository->>PreferenceDataSource: clearAll()
        PreferenceDataSource->>PreferenceDataSource: _cachedAccessToken = null
        PreferenceDataSource->>PreferenceDataSource: _cachedRefreshToken = null
    end
    
    AuthRepository->>AuthSessionManager: logout()
    AuthSessionManager-->>MyPageViewModel: 로그아웃 완료
    MyPageViewModel->>MyPageViewModel: Timber.i() 성공 로깅
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • [Feat/#52] 마이페이지 뷰 UI 구현 #55: MyPage UI 계약 및 뷰모델 수정으로 아티스트 클릭 인텐트/이펙트 구조를 먼저 준비했으며, 본 PR의 마이페이지 회원탈퇴 기능이 이를 기반으로 구현됨
  • [Feat/#22] 카카오 로그인 & 온보딩 API 연결 #61: 인증 스택(PreferenceDataSource, AuthRemoteDataSource, AuthService, AuthRepositoryImpl, AuthSessionManager) 초기 구현을 담당했으며, 본 PR에서 회원탈퇴 및 기본설정 초기화 로직으로 확장됨

Suggested reviewers

  • doyeon0307
  • cmj7271
🚥 Pre-merge checks | ✅ 2 | ❌ 3
❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Title check ⚠️ Warning PR 제목은 '[Feat/#135] 회원가입 api 연결'이지만, 실제 변경 내용은 회원탈퇴 API 연동입니다. [Feat/#135] 회원탈퇴 API 연동으로 변경하세요. PR 제목이 실제 작업 내용을 정확히 반영해야 합니다.
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.
Out of Scope Changes check ❓ Inconclusive LoginViewModel에서 KakaoLoginManager 제거와 MyPageScreen의 UI 바인딩 변경이 회원탈퇴 기능과 직접적인 관계가 명확하지 않습니다. LoginViewModel의 KakaoLoginManager 제거와 MyPageScreen의 변경이 회원탈퇴 기능과 어떤 관계가 있는지 설명해 주세요.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed PR 설명은 필수 섹션을 대부분 포함하고 있으며, 관련 이슈와 작업 내용이 명확히 작성되어 있습니다.
Linked Issues check ✅ Passed 회원탈퇴 API 연동 요구사항이 PreferenceDataSource, AuthRemoteDataSource, AuthService, AuthRepositoryImpl, AuthRepository, MyPageViewModel 등에서 구현되어 있습니다.

✏️ 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.

Copy link

@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/poti/android/data/repository/AuthRepositoryImpl.kt`:
- Around line 42-46: The remote withdrawal result is not being checked: modify
AuthRepositoryImpl.withdrawal() so it captures the response from
authRemoteDataSource.withdrawal(), verify the response indicates success (e.g.,
response.isSuccessful / response.status / throws on error), and only call
preferenceDataSource.clearAll() and authSessionManager.triggerLogout() after
confirming success; if the remote call fails, propagate/return the error via
httpResponseHandler.safeApiCall rather than performing local cleanup. Ensure you
reference authRemoteDataSource.withdrawal(), httpResponseHandler.safeApiCall,
preferenceDataSource.clearAll(), and authSessionManager.triggerLogout() when
making this change.

In
`@app/src/main/java/com/poti/android/presentation/user/mypage/MyPageViewModel.kt`:
- Around line 32-35: The OnMyArtistSelectClick intent in MyPageViewModel is
incorrectly invoking authRepository.withdrawal(), causing account deletion on
artist-selection clicks; update MyPageViewModel so
MyPageUiIntent.OnMyArtistSelectClick triggers the artist-selection flow (e.g.,
call a method to open artist selection UI or emit an event) and remove the
withdrawal() call from that intent, and instead add a distinct intent (e.g.,
MyPageUiIntent.OnWithdrawalClick) that alone calls authRepository.withdrawal()
within launchScope and handles onSuccess/onFailure; adjust any consumers of
MyPageUiIntent accordingly.
🧹 Nitpick comments (1)
app/src/main/java/com/poti/android/presentation/user/mypage/MyPageViewModel.kt (1)

32-36: 회원탈퇴 결과를 UI로 전달하는 사이드 이펙트 추가 권장

현재 성공/실패가 Timber 로그에만 기록되고 UI에는 전달되지 않습니다. 탈퇴 완료 후 로그인/온보딩 이동, 토스트 등 일회성 이벤트는 sendEffect로 분리해 처리해주세요. 코딩 가이드라인에 따라.

Comment on lines +42 to +46
override suspend fun withdrawal(): Result<Unit> = httpResponseHandler.safeApiCall {
authRemoteDataSource.withdrawal()
preferenceDataSource.clearAll()
authSessionManager.triggerLogout()
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

탈퇴 응답을 확인하지 않아 실패가 누락될 수 있습니다.
withdrawal() 결과를 처리하지 않아 서버 실패가 성공으로 간주될 수 있습니다. 성공 확인 후 로컬 정리/로그아웃을 수행하는 흐름으로 수정해 주세요.

🔧 수정 제안
override suspend fun withdrawal(): Result<Unit> = httpResponseHandler.safeApiCall {
-    authRemoteDataSource.withdrawal()
+    authRemoteDataSource.withdrawal()
+        .handleApiResponse()
+        .getOrThrow()
    preferenceDataSource.clearAll()
    authSessionManager.triggerLogout()
}
🤖 Prompt for AI Agents
In `@app/src/main/java/com/poti/android/data/repository/AuthRepositoryImpl.kt`
around lines 42 - 46, The remote withdrawal result is not being checked: modify
AuthRepositoryImpl.withdrawal() so it captures the response from
authRemoteDataSource.withdrawal(), verify the response indicates success (e.g.,
response.isSuccessful / response.status / throws on error), and only call
preferenceDataSource.clearAll() and authSessionManager.triggerLogout() after
confirming success; if the remote call fails, propagate/return the error via
httpResponseHandler.safeApiCall rather than performing local cleanup. Ensure you
reference authRemoteDataSource.withdrawal(), httpResponseHandler.safeApiCall,
preferenceDataSource.clearAll(), and authSessionManager.triggerLogout() when
making this change.

Comment on lines +32 to +35
MyPageUiIntent.OnMyArtistSelectClick -> launchScope {
authRepository.withdrawal()
.onSuccess { Timber.d("Withdrawal Success") }
.onFailure { e -> Timber.e(e, "Withdrawal Failed") }
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

아티스트 선택 인텐트가 회원탈퇴로 연결되는 치명적 오동작

Line 32-35에서 OnMyArtistSelectClickauthRepository.withdrawal()로 바로 이어집니다. MyPageScreen에서는 이 인텐트가 아티스트 선택(BadgeButton) 클릭에 연결되어 있어, 사용자가 아티스트 선택을 누를 때 계정이 탈퇴될 수 있습니다. 회원탈퇴 전용 인텐트/버튼으로 분리하거나, 이 인텐트는 아티스트 선택 흐름으로 처리해주세요.

🤖 Prompt for AI Agents
In
`@app/src/main/java/com/poti/android/presentation/user/mypage/MyPageViewModel.kt`
around lines 32 - 35, The OnMyArtistSelectClick intent in MyPageViewModel is
incorrectly invoking authRepository.withdrawal(), causing account deletion on
artist-selection clicks; update MyPageViewModel so
MyPageUiIntent.OnMyArtistSelectClick triggers the artist-selection flow (e.g.,
call a method to open artist selection UI or emit an event) and remove the
withdrawal() call from that intent, and instead add a distinct intent (e.g.,
MyPageUiIntent.OnWithdrawalClick) that alone calls authRepository.withdrawal()
within launchScope and handles onSuccess/onFailure; adjust any consumers of
MyPageUiIntent accordingly.

@jyvnee jyvnee merged commit d97eb18 into develop Jan 23, 2026
3 checks passed
@github-project-automation github-project-automation bot moved this from To-do to Done in POTI-ANDROID Jan 23, 2026
@jyvnee jyvnee deleted the feat/#135 branch January 23, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ 지현 💻 API 서버 통신 작업 🌟 Feat 새로운 기능 구현

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feat] 회원탈퇴 API 연동

1 participant