-
Notifications
You must be signed in to change notification settings - Fork 3
[feat] 마이페이지 화면 compose로 마이그레이션 #603
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 16 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
f9830b5
feat: 마이페이지 UI 구현
yrsel 0610284
feat: 북마크 컨텐츠 API 연동
yrsel 10e6009
feat: 고객 지원 및 설정 API 연동
yrsel 48dd2b2
refactor: 홈 화면에 임시 마이페이지 확인용 진입점 생성
yrsel bd3b0d7
refactor: 마이페이지 activity 생성 및 콘텐츠 컴포넌트 수정
yrsel 7112763
feat: 프로필 API 연동
yrsel 9e55c7e
refactor: ktlintformat
yrsel c2c63b3
refactor: 마이그레이션으로 사용 안되는 기존 파일 제거 및 패키지 이동
yrsel afee69e
refactor: Profile 영역 로딩 상태 제거
yrsel 5b605a1
refactor: 로그아웃, 회원탈퇴 시 토큰 초기화 실패시에도 로그인 화면으로 이동하도록 수정
yrsel 828390e
refactor: 프로필 기본 이미지 Compose 제공 아이콘으로 수정
yrsel 485af5a
refactor: 마이페이지 북마크 콘텐츠 테두리 설정 추가
yrsel 839a9b9
refactor: 회원탈퇴 아이템 색상 수정 및 Preview 추가
yrsel 8cf8210
refactor: MyPageScreen Content 분리
yrsel 17fbad3
refactor: MyPageViewModel 토큰 초기화 메서드 중복 제거
yrsel 09caa67
refactor: MyPageSettingItem 화살표 Compose 제공 Icon으로 수정
yrsel 2aeff70
refactor: ProfileSection 로딩 상태 제거에 따른 Preview 제거
yrsel f3d580b
refactor: MyPageAppBar 타이틀 문자열 추출
yrsel 54a15fc
refactor: ProfileSection 중복 적용 modifier 제거
yrsel f6eb327
refactor: MyPageScreen 파라미터에 on 접두사 추가
yrsel d91dc1d
refactor: Mypage Mapper util 패키지로 이동
yrsel c9cdf74
refactor: Modifier matchParentSize 수정
yrsel ffc304f
refactor: dialog 상태 null 분기 제거
yrsel 08f6f05
feat: 마이페이지 프로필 영역 재시도 요청 UI 반영
yrsel 67800ad
refactor: 기본 프로필 아이콘 크기 조절
yrsel 67e323e
refactor: 프로필 실패 시 스낵바로 알려주도록 수정
yrsel 83ab948
refactor: 북마크들 불러오기 실패 시 스낵바로 알려주도록 수정
yrsel 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
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
12 changes: 12 additions & 0 deletions
12
android/app/src/main/java/com/on/turip/data/accounts/AccountMapper.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.on.turip.data.accounts | ||
|
|
||
| import com.on.turip.data.accounts.dto.MyProfileResponse | ||
| import com.on.turip.domain.accounts.Account | ||
| import com.on.turip.domain.accounts.Role | ||
|
|
||
| fun MyProfileResponse.toDomain(): Account = | ||
| Account( | ||
| id = id, | ||
| nickname = nickname, | ||
| role = Role.from(role), | ||
| ) |
8 changes: 8 additions & 0 deletions
8
android/app/src/main/java/com/on/turip/data/accounts/datasource/AccountRemoteDataSource.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,8 @@ | ||
| package com.on.turip.data.accounts.datasource | ||
|
|
||
| import com.on.turip.core.result.TuripResult | ||
| import com.on.turip.data.accounts.dto.MyProfileResponse | ||
|
|
||
| interface AccountRemoteDataSource { | ||
| suspend fun getMyProfile(): TuripResult<MyProfileResponse> | ||
| } |
13 changes: 13 additions & 0 deletions
13
...app/src/main/java/com/on/turip/data/accounts/datasource/DefaultAccountRemoteDataSource.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,13 @@ | ||
| package com.on.turip.data.accounts.datasource | ||
|
|
||
| import com.on.turip.core.result.TuripResult | ||
| import com.on.turip.data.accounts.dto.MyProfileResponse | ||
| import com.on.turip.data.accounts.service.AccountService | ||
| import com.on.turip.data.result.safeApiCall | ||
| import javax.inject.Inject | ||
|
|
||
| class DefaultAccountRemoteDataSource @Inject constructor( | ||
| private val accountService: AccountService, | ||
| ) : AccountRemoteDataSource { | ||
| override suspend fun getMyProfile(): TuripResult<MyProfileResponse> = safeApiCall { accountService.getMyProfile() } | ||
| } |
14 changes: 14 additions & 0 deletions
14
android/app/src/main/java/com/on/turip/data/accounts/dto/MyProfileResponse.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,14 @@ | ||
| package com.on.turip.data.accounts.dto | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class MyProfileResponse( | ||
| @SerialName("id") | ||
| val id: Long, | ||
| @SerialName("nickname") | ||
| val nickname: String, | ||
| @SerialName("role") | ||
| val role: String, | ||
| ) |
15 changes: 15 additions & 0 deletions
15
android/app/src/main/java/com/on/turip/data/accounts/repository/DefaultAccountRepository.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,15 @@ | ||
| package com.on.turip.data.accounts.repository | ||
|
|
||
| import com.on.turip.core.result.TuripResult | ||
| import com.on.turip.core.result.mapCatching | ||
| import com.on.turip.data.accounts.datasource.AccountRemoteDataSource | ||
| import com.on.turip.data.accounts.toDomain | ||
| import com.on.turip.domain.accounts.Account | ||
| import com.on.turip.domain.accounts.AccountRepository | ||
| import javax.inject.Inject | ||
|
|
||
| class DefaultAccountRepository @Inject constructor( | ||
| private val accountRemoteDataSource: AccountRemoteDataSource, | ||
| ) : AccountRepository { | ||
| override suspend fun loadMyProfile(): TuripResult<Account> = accountRemoteDataSource.getMyProfile().mapCatching { it.toDomain() } | ||
| } |
9 changes: 9 additions & 0 deletions
9
android/app/src/main/java/com/on/turip/data/accounts/service/AccountService.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,9 @@ | ||
| package com.on.turip.data.accounts.service | ||
|
|
||
| import com.on.turip.data.accounts.dto.MyProfileResponse | ||
| import de.jensklingenberg.ktorfit.http.GET | ||
|
|
||
| interface AccountService { | ||
| @GET("accounts/me") | ||
| suspend fun getMyProfile(): MyProfileResponse | ||
| } |
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
7 changes: 7 additions & 0 deletions
7
android/app/src/main/java/com/on/turip/domain/accounts/Account.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,7 @@ | ||
| package com.on.turip.domain.accounts | ||
|
|
||
| data class Account( | ||
| val id: Long, | ||
| val nickname: String, | ||
| val role: Role, | ||
| ) |
7 changes: 7 additions & 0 deletions
7
android/app/src/main/java/com/on/turip/domain/accounts/AccountRepository.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,7 @@ | ||
| package com.on.turip.domain.accounts | ||
|
|
||
| import com.on.turip.core.result.TuripResult | ||
|
|
||
| interface AccountRepository { | ||
| suspend fun loadMyProfile(): TuripResult<Account> | ||
| } |
16 changes: 16 additions & 0 deletions
16
android/app/src/main/java/com/on/turip/domain/accounts/Role.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,16 @@ | ||
| package com.on.turip.domain.accounts | ||
|
|
||
| enum class Role( | ||
| private val tag: String, | ||
| ) { | ||
| MEMBER("MEMBER"), | ||
| GUEST("GUEST"), | ||
| ; | ||
|
|
||
| companion object { | ||
| fun from(role: String): Role { | ||
| val tag = role.uppercase() | ||
| return entries.firstOrNull { it.tag == tag } ?: GUEST | ||
| } | ||
| } | ||
| } | ||
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
7 changes: 7 additions & 0 deletions
7
android/app/src/main/java/com/on/turip/ui/compose/mypage/MyPageDialogState.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,7 @@ | ||
| package com.on.turip.ui.compose.mypage | ||
|
|
||
| sealed interface MyPageDialogState { | ||
| data object LogoutRequired : MyPageDialogState | ||
|
|
||
| data object ConfirmWithdraw : MyPageDialogState | ||
| } |
11 changes: 11 additions & 0 deletions
11
android/app/src/main/java/com/on/turip/ui/compose/mypage/MyPageMapper.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,11 @@ | ||
| package com.on.turip.ui.compose.mypage | ||
|
|
||
| import com.on.turip.domain.accounts.Account | ||
| import com.on.turip.ui.compose.mypage.model.ProfileModel | ||
|
|
||
| fun Account.toUiModel(): ProfileModel = | ||
| ProfileModel( | ||
| id = id, | ||
| nickname = nickname, | ||
| imageUrl = null, | ||
| ) |
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.
알 수 없는 역할 수신 시 경고 로그 누락
from()이 서버에서 알 수 없는 역할 문자열을 수신할 경우 아무런 경고 없이GUEST로 폴백합니다. API 계약 위반이나 역할 추가 시 디버깅이 어려워질 수 있습니다.🔍 제안 수정
companion object { fun from(role: String): Role { - val tag = role.uppercase() - return entries.firstOrNull { it.tag == tag } ?: GUEST + val normalized = role.uppercase() + return entries.firstOrNull { it.tag == normalized } ?: run { + Timber.w("알 수 없는 역할 수신: $role — GUEST로 폴백합니다.") + GUEST + } } }추가로, 람다 내부에서
it.tag == tag의tag는 지역 변수(line 12)를 참조하고,it.tag는 enum의 private 필드를 참조합니다. 이름이 동일해 혼란스러울 수 있으므로 지역 변수명을normalized처럼 구분해 주는 것이 가독성에 좋습니다.🤖 Prompt for AI Agents