Repository navigation
[FEAT/#109] 로그아웃/회원탈퇴 구현 #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
7b51c01
[feat/#109] 마이페이지 바텀 네비바 숨김 처리 및 상단 바 제작
Hiimynameiss 98e6774
[feat/#109] 마이페이지 뒤로 가기 버튼 연결
Hiimynameiss f8db424
[feat/#109] 마이페이지 - 설정 화면 연결
Hiimynameiss d8c7e01
[feat/#109] 설정 화면 구현
Hiimynameiss 08cd12b
[mod/#109] 설정 화면 컴포넌트화
Hiimynameiss 29363c8
[feat/#109] 아이콘 없 ver 다이얼로그 추가
Hiimynameiss a6bdbd5
[feat/#109] 로그아웃 다이얼로그 연결
Hiimynameiss 7f340b7
[mod/#109] 공고 등록 화면의 다이얼로그 아이콘 있게 수정, 다이얼로그 너비 수정
Hiimynameiss 0b59317
[feat/#109] 탈퇴 화면 구현
Hiimynameiss 5a3dae5
[feat/#109] 사유 입력 창 카운터 추가
Hiimynameiss 2ad6a97
[rename/#109] LeaveCheckList -> LeaveCheckItem
Hiimynameiss 8a5d9bb
[feat/#109] 버튼 비활성화 구현
Hiimynameiss 83e1781
[mod/#109] 사유 입력 텍스트 필드 기획 반영
Hiimynameiss 54a47bb
[feat/#109] 화면 연결
Hiimynameiss 293f8d2
[mod/#109] 자잘하게 디자인 반영
Hiimynameiss 1a595b9
[del/#109] 주석 삭제
Hiimynameiss c236a1d
[feat/#109] 키보드가 사유 입력 칸 안 가리게
Hiimynameiss 5fb4bde
[merge/#109] pulled develop
Hiimynameiss 55ab088
[feat/#109] 회원 탈퇴 완료 화면 구현
Hiimynameiss ac54111
[mod/#109] 탈퇴 유의 사항 영역 색칠
Hiimynameiss 7b1db5d
[feat/#109] 로그아웃 API 연동
Hiimynameiss 9e05cbb
[feat/#109] FCM 토큰 삭제 한수 추가
Hiimynameiss 22e9c9e
[feat/#109] 로그아웃 API Repository 구현
Hiimynameiss fbb28ff
[feat/#109] 로그아웃 네비게이션
Hiimynameiss 6e1efd9
[fix/#109] Authorization 헤더 직접 전달
Hiimynameiss fac76f4
[mod/#109] 로그아웃 성공했을 때만 로컬 토큰 정리
Hiimynameiss 9379108
[mod/#109] 중복 방지 및 로그아웃 실패 시 상태 유지
Hiimynameiss d9ef455
[mod/#109] 중복 방지 코드 수정
Hiimynameiss 50d5a06
[feat/#109] 회원탈퇴 API 연동
Hiimynameiss 0ed888c
[mod/#109] 탈퇴 사유 enum에 서버 값 연결
Hiimynameiss 1b06b3b
[feat/#109] 회원 탈퇴 Contract에 로딩 상태 추가
Hiimynameiss 31dbff7
[feat/#109] 회원 탈퇴 ViewModel 구현
Hiimynameiss a689868
[refactor/#109] 로그아웃 로직 Auth -> mypage
Hiimynameiss c6938f2
[mod/#109] 마이페이지를 네비게이션 바 예외에서 제외
Hiimynameiss 14d88dd
[mod/#109] 이모지 포함 글자수 세기
Hiimynameiss 3c8d4d6
[mod/#109] 다이얼로그 기본 여백 제거
Hiimynameiss b5a86ed
[del/#109] 불필요한 괄호 제거
Hiimynameiss eff33bb
[mod/#109] @Immutable 붙임
Hiimynameiss 873ca9b
[merge/#109] pulled develop
Hiimynameiss 4e7f215
[mod/#109] 불필요한 BoxWithConstraints 대체
Hiimynameiss dcc2e89
[mod/#109] 탈퇴 완료 화면의 navGraph 삭제
Hiimynameiss 7b77682
[mod/#109] p3 리뷰 반영
Hiimynameiss 88be358
[mod/#109] 탈퇴 화면 버튼 bottom 패딩 수정
Hiimynameiss 5f0716b
[mod/#109] FCM 실패와 인증 토큰 삭제를 별도 작업으로 취급
Hiimynameiss 36ab9d8
[mod/#109] deviceId가 null이면 서버 요청을 건너뜀
Hiimynameiss e84dd04
[merge/#109] pulled develop
Hiimynameiss 571b586
[del/#109] 잘못된 import문 제거
Hiimynameiss 15494a3
[mod/#109] 키보드만큼의 여백 주기 방법 간소화
Hiimynameiss 6c3ba7c
[feat/#109] isNewUser 필드 추가, 기존 유저와 새로운 유저 구분 -> 회원가입 완료 화면 분기
Hiimynameiss 80ada5e
[mod/#109] 중괄호 없앰
Hiimynameiss 3cf0c41
[mod/#109] 인증 토큰만 관리
Hiimynameiss 75d61f2
[del/#109] 불필요한 패딩 처리 삭제
Hiimynameiss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/haphap/app/data/remote/datasource/api/mypage/MyPageDataSource.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,13 @@ | ||
| package com.haphap.app.data.remote.datasource.api.mypage | ||
|
|
||
| import com.haphap.app.data.remote.dto.BaseResponse | ||
| import com.haphap.app.data.remote.dto.mypage.LeaveRequestDto | ||
| import com.haphap.app.data.remote.dto.mypage.LogoutRequestDto | ||
| import com.haphap.app.data.remote.dto.mypage.MyPageResponseDto | ||
| import retrofit2.Response | ||
|
|
||
| interface MyPageDataSource{ | ||
| suspend fun getMyPage(): BaseResponse<MyPageResponseDto> | ||
| suspend fun deleteMember(requestDto: LeaveRequestDto): Response<Unit> | ||
| suspend fun postLogout(requestDto: LogoutRequestDto): Response<Unit> | ||
| } |
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
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
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/haphap/app/data/remote/dto/mypage/LeaveRequestDto.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.haphap.app.data.remote.dto.mypage | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class LeaveRequestDto( | ||
| @SerialName("reason") | ||
| val reason: String, | ||
| @SerialName("etcReason") | ||
| val etcReason: String? = null, | ||
| ) |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/haphap/app/data/remote/dto/mypage/LogoutRequestDto.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package com.haphap.app.data.remote.dto.mypage | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class LogoutRequestDto( | ||
| @SerialName("deviceId") | ||
| val deviceId: String, | ||
| ) |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/haphap/app/data/remote/service/MyPageService.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,22 @@ | ||
| package com.haphap.app.data.remote.service | ||
|
|
||
| import com.haphap.app.data.remote.dto.BaseResponse | ||
| import com.haphap.app.data.remote.dto.mypage.LeaveRequestDto | ||
| import com.haphap.app.data.remote.dto.mypage.LogoutRequestDto | ||
| import com.haphap.app.data.remote.dto.mypage.MyPageResponseDto | ||
| import retrofit2.Response | ||
| import retrofit2.http.Body | ||
| import retrofit2.http.GET | ||
| import retrofit2.http.HTTP | ||
| import retrofit2.http.POST | ||
|
|
||
| interface MyPageService { | ||
| @GET("api/v1/members/me") | ||
| suspend fun getMyPage(): BaseResponse<MyPageResponseDto> | ||
|
|
||
| @HTTP(method = "DELETE", path = "api/v1/members/me", hasBody = true) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p3: 오오 바디가 있어서 어노테이션을 HTTP로 쓰는구나.. 배워갑니닷!!
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. POST, PUT, PATCH처럼 body가 있어도 @http 말고 어노테이션 그대로 사용할 수 있는 메서드들도 있답니당~😆 |
||
| suspend fun deleteMember(@Body request: LeaveRequestDto): Response<Unit> | ||
|
|
||
| @POST("api/v1/auth/logout") | ||
| suspend fun logout(@Body request: LogoutRequestDto): Response<Unit> | ||
| } | ||
1 change: 0 additions & 1 deletion
1
app/src/main/java/com/haphap/app/data/repository/api/auth/AuthRepository.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
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
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/haphap/app/data/repository/impl/mypage/MyPageRepositoryImpl.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,58 @@ | ||
| package com.haphap.app.data.repository.impl.mypage | ||
|
|
||
| import com.haphap.app.core.fcm.FirebaseMessagingManager | ||
| import com.haphap.app.core.util.suspendRunCatching | ||
| import com.haphap.app.data.local.datasource.api.LocalFcmDataSource | ||
| import com.haphap.app.data.local.datasource.api.LocalTokenDataSource | ||
| import com.haphap.app.data.mapper.mypage.toModel | ||
| import com.haphap.app.data.model.mypage.MyPageModel | ||
| import com.haphap.app.data.remote.datasource.api.mypage.MyPageDataSource | ||
| import com.haphap.app.data.remote.dto.checkData | ||
| import com.haphap.app.data.remote.dto.mypage.LeaveRequestDto | ||
| import com.haphap.app.data.remote.dto.mypage.LogoutRequestDto | ||
| import com.haphap.app.data.repository.api.mypage.MyPageRepository | ||
| import jakarta.inject.Inject | ||
| import retrofit2.HttpException | ||
| import timber.log.Timber | ||
|
|
||
| class MyPageRepositoryImpl @Inject constructor( | ||
| private val myPageDataSource: MyPageDataSource, | ||
| private val localTokenDataSource: LocalTokenDataSource, | ||
| private val localFcmDataSource: LocalFcmDataSource, | ||
| private val firebaseMessagingManager: FirebaseMessagingManager, | ||
| ): MyPageRepository { | ||
| override suspend fun getMyPage(): Result<MyPageModel> = | ||
| suspendRunCatching { | ||
| val response = myPageDataSource.getMyPage().checkData() | ||
| response.toModel() | ||
| } | ||
|
|
||
| override suspend fun deleteMember(reason: String, etcReason: String?): Result<Unit> = | ||
| suspendRunCatching { | ||
| val response = myPageDataSource.deleteMember( | ||
| LeaveRequestDto(reason = reason, etcReason = etcReason), | ||
| ) | ||
|
|
||
| if (!response.isSuccessful && response.code() != 404) throw HttpException(response) | ||
|
|
||
| localTokenDataSource.clearTokens() | ||
| } | ||
|
|
||
| override suspend fun postLogout(): Result<Unit> = | ||
| suspendRunCatching { | ||
| val accessToken = localTokenDataSource.getAccessToken() | ||
|
|
||
| if (!accessToken.isNullOrBlank()) { | ||
| val deviceId = firebaseMessagingManager.getInstallationId() | ||
|
|
||
| if (deviceId != null) { | ||
| val response = myPageDataSource.postLogout(LogoutRequestDto(deviceId)) | ||
| if (!response.isSuccessful && response.code() != 401) throw HttpException(response) | ||
| } else { | ||
| Timber.w("Installation id is null. Skip remote logout") | ||
| } | ||
| } | ||
|
|
||
| localTokenDataSource.clearTokens() | ||
| } | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p1: 다이얼로그는 기본 여백이 있어서 요거 있으면 오히려 다이얼로그 사이즈가 더 줄어들텐뎅?? 여백 제거하고 한번 확인해보셔용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dialog에
usePlatformDefaultWidth = false를 주면 기본 여백을 없앨 수 있다고 해서 기본 여백을 없애고 horizontal 패딩을 유지하는 방향으로 수정했습니당!!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오호 혹시 왜 기본 여백 없앴는지 알 수 있을까용..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기본 여백만 주었더니 좌우 패딩이 디자인과 다르게 주어져서 기본 여백 없애고 디자인 상의 패딩을 주는 걸로 결정했습니다...!!