Skip to content

Conversation

@s9hn
Copy link
Member

@s9hn s9hn commented May 15, 2025

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • 회원탈퇴 기능을 리팩터링 했습니다.

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴

로그아웃 기능과 마찬가지로, 회원탈퇴 또한 플랫폼에 대한 회원탈퇴는 백엔드에서 진행하므로 불필요한 클라이언트 코드는 삭제했습니다.

@s9hn s9hn self-assigned this May 15, 2025
@s9hn s9hn added ♻️ [REFACTOR] 기존 코드를 리팩토링합니다. ⚖️ 재상 세훈 전지적 세훈 시점 labels May 15, 2025
@coderabbitai
Copy link

coderabbitai bot commented May 15, 2025

Walkthrough

회원탈퇴(Withdraw) 기능이 기존 Auth 도메인에서 Account 도메인으로 이동되었습니다. 이에 따라 관련 API, 데이터소스, 레포지토리, ViewModel, UI의 의존성과 호출 흐름이 변경되었으며, 불필요해진 Auth 관련 withdraw 메서드 및 DTO가 제거되고 Account 관련 withdraw 메서드와 DTO가 새로 추가·이동되었습니다.

Changes

파일/경로 그룹 변경 요약
app/src/main/java/com/into/websoso/data/remote/api/AuthApi.kt, core/auth/src/main/java/com/into/websoso/core/auth/AuthClient.kt, core/auth-kakao/src/main/java/com/into/websoso/core/auth_kakao/KakaoAuthClient.kt, app/src/main/java/com/into/websoso/data/repository/AuthRepository.kt 회원탈퇴 관련 withdraw 메서드 및 관련 DTO/토큰 클리어 함수 삭제
core/network/src/main/java/com/into/websoso/core/network/datasource/account/AccountApi.kt, core/network/src/main/java/com/into/websoso/core/network/datasource/account/DefaultAccountDataSource.kt, data/account/src/main/java/com/into/websoso/data/account/AccountRepository.kt, data/account/src/main/java/com/into/websoso/data/account/datasource/AccountRemoteDataSource.kt Account 도메인에 withdraw API 및 메서드 추가, KakaoWithdrawRequestDto 사용
core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/request/KakaoWithdrawRequestDto.kt WithdrawRequestDto → KakaoWithdrawRequestDto로 클래스명 변경, refreshToken 프로퍼티 삭제, internal로 변경 및 패키지 이동
app/src/main/java/com/into/websoso/ui/withdraw/second/WithdrawSecondActivity.kt, app/src/main/java/com/into/websoso/ui/withdraw/second/WithdrawSecondViewModel.kt ViewModel에서 AuthRepository → AccountRepository로 의존성 변경, UI에서 NavigatorProvider 통한 이동 등 회원탈퇴 흐름 변경
core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/request/KakaoLogoutRequestDto.kt, core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/request/TokenReissueRequestDto.kt, core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/response/KakaoLoginResponseDto.kt, core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/response/TokenReissueResponseDto.kt 패키지 구조 정리 및 이동(기능 영향 없음)

Sequence Diagram(s)

sequenceDiagram
    participant UI as WithdrawSecondActivity
    participant VM as WithdrawSecondViewModel
    participant Repo as AccountRepository
    participant RDS as AccountRemoteDataSource
    participant API as AccountApi

    UI->>VM: withdraw() 호출
    VM->>Repo: deleteAccount(reason)
    Repo->>RDS: postWithdraw(reason)
    RDS->>API: postWithdrawWithKakao(KakaoWithdrawRequestDto)
    API-->>RDS: 응답
    RDS-->>Repo: 완료
    Repo->>Repo: accountLocalDataSource.clearTokens()
    Repo-->>VM: 완료
    VM-->>UI: _isWithDrawSuccess 업데이트
    UI->>UI: websosoNavigator.navigateToLoginActivity()
Loading

Assessment against linked issues

Objective Addressed Explanation
회원탈퇴 기능을 Account 도메인으로 리팩터링 (#688)
기존 Auth 관련 withdraw 로직 및 의존성 제거 (#688)
KakaoWithdrawRequestDto로 DTO 통일 및 불필요 필드 제거 (#688)
회원탈퇴 성공 시 토큰 삭제 및 로그인 화면 이동 (#688)

Suggested reviewers

  • m6z1
  • junseo511
  • yeonjeen

Poem

🐇
토끼가 뛰노는 소스의 들판,
회원탈퇴 기능이 새로이 탄생!
Auth는 안녕, Account로 이동,
깔끔한 흐름에 개발자도 윙크!
이제 탈퇴도 한결 쉬워졌네,
코드 속 토끼도 기쁘게 춤추네!
🥕

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f28f8c and b1b7962.

📒 Files selected for processing (15)
  • app/src/main/java/com/into/websoso/data/remote/api/AuthApi.kt (0 hunks)
  • app/src/main/java/com/into/websoso/data/repository/AuthRepository.kt (0 hunks)
  • app/src/main/java/com/into/websoso/ui/withdraw/second/WithdrawSecondActivity.kt (4 hunks)
  • app/src/main/java/com/into/websoso/ui/withdraw/second/WithdrawSecondViewModel.kt (3 hunks)
  • core/auth-kakao/src/main/java/com/into/websoso/core/auth_kakao/KakaoAuthClient.kt (0 hunks)
  • core/auth/src/main/java/com/into/websoso/core/auth/AuthClient.kt (0 hunks)
  • core/network/src/main/java/com/into/websoso/core/network/datasource/account/AccountApi.kt (2 hunks)
  • core/network/src/main/java/com/into/websoso/core/network/datasource/account/DefaultAccountDataSource.kt (2 hunks)
  • core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/request/KakaoLogoutRequestDto.kt (1 hunks)
  • core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/request/KakaoWithdrawRequestDto.kt (1 hunks)
  • core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/request/TokenReissueRequestDto.kt (1 hunks)
  • core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/response/KakaoLoginResponseDto.kt (1 hunks)
  • core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/response/TokenReissueResponseDto.kt (1 hunks)
  • data/account/src/main/java/com/into/websoso/data/account/AccountRepository.kt (1 hunks)
  • data/account/src/main/java/com/into/websoso/data/account/datasource/AccountRemoteDataSource.kt (1 hunks)
💤 Files with no reviewable changes (4)
  • app/src/main/java/com/into/websoso/data/remote/api/AuthApi.kt
  • core/auth/src/main/java/com/into/websoso/core/auth/AuthClient.kt
  • app/src/main/java/com/into/websoso/data/repository/AuthRepository.kt
  • core/auth-kakao/src/main/java/com/into/websoso/core/auth_kakao/KakaoAuthClient.kt
🔇 Additional comments (20)
core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/request/TokenReissueRequestDto.kt (1)

1-1: 패키지 구조 개선이 잘 이루어졌습니다.

request와 response 타입을 구분하여 패키지를 분리한 것은 코드 구조와 가독성 측면에서 좋은 개선입니다. 이러한 일관된 패키지 구조는 추후 코드 유지보수와 확장성에 도움이 됩니다.

core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/response/KakaoLoginResponseDto.kt (1)

1-1: 패키지 구조 개선이 잘 이루어졌습니다.

response 타입을 위한 별도 패키지로 이동시킨 것은 코드 조직화 측면에서 좋은 접근입니다. 이는 request/response 모델의 일관된 구조를 유지하고 코드 탐색을 용이하게 합니다.

core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/request/KakaoLogoutRequestDto.kt (1)

1-1: 일관된 패키지 구조 리팩토링이 잘 적용되었습니다.

request DTO를 위한 별도 패키지로 이동시킨 것은 다른 DTO들과 동일한 패턴을 따르고 있어 일관성 있는 구조를 만들었습니다. 이는 코드베이스 전반에 일관된 패턴을 적용하는 좋은 사례입니다.

core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/response/TokenReissueResponseDto.kt (1)

1-1: 패키지 구조 개선이 일관되게 적용되었습니다.

response DTO를 별도 패키지로 이동한 리팩토링은 다른 DTO들과 일관된 방식으로 적용되어 전체적인 코드 구조가 개선되었습니다. 이처럼 일관된 구조는 새로운 팀원이 코드를 이해하는 데도 도움이 됩니다.

data/account/src/main/java/com/into/websoso/data/account/datasource/AccountRemoteDataSource.kt (1)

19-20: 회원탈퇴 기능이 적절하게 추가되었습니다.

Auth 도메인에서 Account 도메인으로 회원탈퇴 기능을 이동시키는 것은 도메인 책임 분리 측면에서 좋은 변경입니다. 회원탈퇴 이유(reason)를 파라미터로 받는 것도 적절합니다.

이제 이 인터페이스 구현체에서 실제 API 호출 로직을 구현하여 완성시키면 될 것 같습니다.

data/account/src/main/java/com/into/websoso/data/account/AccountRepository.kt (1)

45-49: 깔끔한 계정 삭제 로직 구현

기존 Auth 도메인에서 Account 도메인으로 회원탈퇴 기능이 잘 이동되었습니다. 삭제 이유와 함께 원격 데이터 소스의 postWithdraw를 호출하고, 로컬 토큰을 정리하는 흐름이 deleteToken 메서드와 일관되게 유지되어 있습니다.

core/network/src/main/java/com/into/websoso/core/network/datasource/account/AccountApi.kt (2)

3-7: import 구문 정리 적절

요청 모델과 응답 모델이 명확하게 구분되어 정리되었습니다. 패키지 구조를 따라 import 구문이 잘 정리되어 있습니다.


29-33: 회원탈퇴 API 엔드포인트 추가 완료

Auth 도메인에서 Account 도메인으로 회원탈퇴 기능이 잘 이동되었습니다. API 엔드포인트 구현이 기존 패턴을 따르고 있어 일관성이 유지되었습니다.

core/network/src/main/java/com/into/websoso/core/network/datasource/account/model/request/KakaoWithdrawRequestDto.kt (1)

1-10: DTO 클래스 리팩토링 적절

WithdrawRequestDto에서 KakaoWithdrawRequestDto로 이름 변경과 패키지 이동이 잘 이루어졌습니다. 내부(internal) 가시성 변경과 불필요한 refreshToken 속성 제거로 코드가 간결해졌습니다. 회원탈퇴 이유만 필요한 단순화된 구조로 잘 개선되었습니다.

core/network/src/main/java/com/into/websoso/core/network/datasource/account/DefaultAccountDataSource.kt (2)

5-7: import 구문 패키지 구조 반영

요청 모델 클래스의 새로운 패키지 구조가 import 구문에 잘 반영되었습니다.


47-53: 회원탈퇴 데이터소스 메서드 구현 완료

회원탈퇴 기능에 대한 데이터소스 메서드가 적절하게 구현되었습니다. 기존 메서드들과 동일한 패턴을 따르고 있어 코드 일관성이 유지되었습니다. 이유 파라미터만 받아서 API를 호출하는 간결한 구현이 좋습니다.

app/src/main/java/com/into/websoso/ui/withdraw/second/WithdrawSecondActivity.kt (5)

9-9: 적절한 import 추가

NavigatorProvider 클래스를 새롭게 가져와서 화면 이동 로직을 분리했습니다. 이는 SRP(단일 책임 원칙)에 맞게 리팩토링된 좋은 변화입니다.


21-21: 의존성 주입을 위한 import 추가

의존성 주입에 필요한 Inject 어노테이션을 위한 import가 적절하게 추가되었습니다.


28-30: 네비게이션 로직 분리를 위한 의존성 주입 적용

NavigatorProvider를 의존성 주입으로 받아 화면 전환 책임을 분리한 것은 좋은 접근입니다. 이를 통해 화면 이동 로직에 대한 테스트 용이성이 향상되고, 관심사 분리 원칙이 지켜졌습니다.


85-85: 메서드 레퍼런스를 활용한 간결한 코드 작성

throttleFirst 함수에 메서드 레퍼런스를 직접 전달하여 코드가 더 간결해졌습니다. 불필요한 코드를 제거하는 개선이 이루어졌습니다.


107-107: 네비게이션 로직 개선

기존의 직접적인 Intent 생성 및 화면 전환 대신 주입된 navigator를 사용하여 LoginActivity로 이동하도록 변경되었습니다. 이는 테스트 용이성을 높이고 Activity 간의 결합도를 낮추는 좋은 리팩토링입니다.

app/src/main/java/com/into/websoso/ui/withdraw/second/WithdrawSecondViewModel.kt (4)

8-8: 도메인 변경에 따른 import 수정

회원탈퇴 기능이 Auth 도메인에서 Account 도메인으로 이동됨에 따라 AuthRepository 대신 AccountRepository를 import하도록 변경했습니다. 이는 기능에 대한 책임을 더 명확한 도메인으로 이동시킨 좋은 리팩토링입니다.


19-19: 의존성 변경

AuthRepository에서 AccountRepository로 의존성이 변경되었습니다. 회원탈퇴 기능은 계정 관련 도메인에 더 적합하므로 이러한 변경은 도메인 로직의 명확성을 높입니다.


78-80: 탈퇴 사유 처리 로직 개선

로컬 변수를 사용하여 탈퇴 사유 결정 로직을 보다 명확하게 표현했습니다. 직접 입력 사유인 경우와 아닌 경우의 처리가 한눈에 이해되도록 개선되었습니다.


81-81: 도메인 변경에 따른 메서드 호출 변경

AuthRepository의 withdraw() 메서드 대신 AccountRepository의 deleteAccount() 메서드를 호출하도록 변경되었습니다. 이는 도메인 책임 변경에 맞게 적절하게 수정되었습니다. 또한 탈퇴 사유를 매개변수로 전달하여 데이터 흐름이 더 명확해졌습니다.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@s9hn s9hn changed the title Feat/688 refactor: 회원탈퇴 구현 May 15, 2025
@s9hn
Copy link
Member Author

s9hn commented May 15, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented May 15, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@s9hn s9hn merged commit 2dd8942 into feat/657 May 16, 2025
1 check passed
@m6z1 m6z1 deleted the feat/688 branch August 11, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ [REFACTOR] 기존 코드를 리팩토링합니다. ⚖️ 재상 세훈 전지적 세훈 시점

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants