-
Notifications
You must be signed in to change notification settings - Fork 0
[Refactor/#207] 루틴 데이터 아키텍처 개선 #208
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
Open
wjdrjs00
wants to merge
17
commits into
develop
Choose a base branch
from
refactor/#207-routine-logic
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+840
−435
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
faea8a4
Refactor: Home 레이어 Type-safe navigation 적용
wjdrjs00 822a734
Refactor: RoutineLocalDataSource 추가 및 DI 연결
wjdrjs00 ca58d92
Refactor: RoutineRepository를 Flow 기반으로 전환 및 Optimistic Update 책임 이동
wjdrjs00 efae7ac
Refactor: ToggleStrategy 도메인으로 이동 및 루틴 UseCase 재구성
wjdrjs00 a0ce38b
Refactor: HomeViewModel 단순화
wjdrjs00 1ddcf38
Refactor: RoutineListViewModel 단순화
wjdrjs00 ad48939
Refactor: OnBoarding 루틴 캐시 무효화 data 레이어 위임
wjdrjs00 3b674a6
Test: RoutineRepositoryImpl 단위 테스트 추가
wjdrjs00 d4abc0e
Refactor: syncTrigger의 BufferOverflow 전략 수정
wjdrjs00 836b342
Refactor: 펜딩 변경사항 동기화 및 동시성 제어 개선
wjdrjs00 baa4572
Refactor: syncError 노출 및 ObserveRoutineSyncErrorUseCase 추가
wjdrjs00 4ec0a5b
Refactor: BitnagilConfirmDialog 디자인시스템으로 추출
wjdrjs00 e7a6b02
Refactor: 롤백 에러 다이얼로그 HomeState로 관리
wjdrjs00 9e0fcaf
Refactor: 동기화 로직 배치 처리로 수정
wjdrjs00 7362cdf
Refactor: fetch 및 동기화 에러 핸들링 로직 수정
wjdrjs00 09eb7bb
Refactor: 루틴 동기화 요청 시 재시도(Retry) 로직 추가
wjdrjs00 0edc72f
Test: RoutineRepositoryImpl 동기화 재시도 및 디바운스 로직 테스트 수정
wjdrjs00 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
18 changes: 18 additions & 0 deletions
18
app/src/main/java/com/threegap/bitnagil/di/data/CoroutineModule.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,18 @@ | ||
| package com.threegap.bitnagil.di.data | ||
|
|
||
| import com.threegap.bitnagil.data.di.IoDispatcher | ||
| import dagger.Module | ||
| import dagger.Provides | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
| import kotlinx.coroutines.CoroutineDispatcher | ||
| import kotlinx.coroutines.Dispatchers | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| object CoroutineModule { | ||
|
|
||
| @Provides | ||
| @IoDispatcher | ||
| fun provideIoDispatcher(): CoroutineDispatcher = Dispatchers.IO | ||
| } |
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
42 changes: 21 additions & 21 deletions
42
app/src/main/java/com/threegap/bitnagil/navigation/home/HomeRoute.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,28 +1,28 @@ | ||
| package com.threegap.bitnagil.navigation.home | ||
|
|
||
| import com.threegap.bitnagil.R | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| enum class HomeRoute( | ||
| val route: String, | ||
| val title: String, | ||
| val icon: Int, | ||
| ) { | ||
| Home( | ||
| route = "home/home", | ||
| title = "홈", | ||
| icon = R.drawable.ic_home, | ||
| ), | ||
| @Serializable | ||
| sealed interface HomeRoute { | ||
| @Serializable | ||
| data object Home : HomeRoute | ||
|
|
||
| RecommendRoutine( | ||
| route = "home/recommend_routine", | ||
| title = "추천 루틴", | ||
| icon = R.drawable.ic_routine_recommend, | ||
| ), | ||
| @Serializable | ||
| data object RecommendRoutine : HomeRoute | ||
|
|
||
| MyPage( | ||
| route = "home/my_page", | ||
| title = "마이페이지", | ||
| icon = R.drawable.ic_profile, | ||
| ), | ||
| ; | ||
| @Serializable | ||
| data object MyPage : HomeRoute | ||
| } | ||
|
|
||
| data class HomeTab( | ||
| val route: HomeRoute, | ||
| val title: String, | ||
| val icon: Int, | ||
| ) | ||
|
|
||
| val homeTabList = listOf( | ||
| HomeTab(HomeRoute.Home, "홈", R.drawable.ic_home), | ||
| HomeTab(HomeRoute.RecommendRoutine, "추천 루틴", R.drawable.ic_routine_recommend), | ||
| HomeTab(HomeRoute.MyPage, "마이페이지", R.drawable.ic_profile), | ||
| ) |
85 changes: 85 additions & 0 deletions
85
...src/main/java/com/threegap/bitnagil/designsystem/component/block/BitnagilConfirmDialog.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,85 @@ | ||
| package com.threegap.bitnagil.designsystem.component.block | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.BasicAlertDialog | ||
| import androidx.compose.material3.ExperimentalMaterial3Api | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.window.DialogProperties | ||
| import com.threegap.bitnagil.designsystem.BitnagilTheme | ||
| import com.threegap.bitnagil.designsystem.modifier.clickableWithoutRipple | ||
|
|
||
| @OptIn(ExperimentalMaterial3Api::class) | ||
| @Composable | ||
| fun BitnagilConfirmDialog( | ||
| title: String, | ||
| description: String, | ||
| confirmButtonText: String, | ||
| onConfirm: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| dismissOnBackPress: Boolean = true, | ||
| dismissOnClickOutside: Boolean = true, | ||
| ) { | ||
| BasicAlertDialog( | ||
| onDismissRequest = onConfirm, | ||
| modifier = modifier, | ||
| properties = DialogProperties( | ||
| dismissOnBackPress = dismissOnBackPress, | ||
| dismissOnClickOutside = dismissOnClickOutside, | ||
| ), | ||
wjdrjs00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) { | ||
| Column( | ||
| modifier = Modifier | ||
| .background( | ||
| color = BitnagilTheme.colors.white, | ||
| shape = RoundedCornerShape(12.dp), | ||
| ) | ||
| .padding(vertical = 20.dp, horizontal = 24.dp), | ||
| ) { | ||
| Text( | ||
| text = title, | ||
| color = BitnagilTheme.colors.coolGray10, | ||
| style = BitnagilTheme.typography.subtitle1SemiBold, | ||
| modifier = Modifier.padding(bottom = 6.dp), | ||
| ) | ||
|
|
||
| Text( | ||
| text = description, | ||
| color = BitnagilTheme.colors.coolGray40, | ||
| style = BitnagilTheme.typography.body2Medium, | ||
| modifier = Modifier.padding(bottom = 18.dp), | ||
| ) | ||
|
|
||
| Text( | ||
| text = confirmButtonText, | ||
| color = BitnagilTheme.colors.orange500, | ||
| style = BitnagilTheme.typography.body2Medium, | ||
| textAlign = TextAlign.End, | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .clickableWithoutRipple { onConfirm() }, | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| private fun Preview() { | ||
| BitnagilConfirmDialog( | ||
| title = "루틴 완료를 저장하지 못했어요", | ||
| description = "네트워크 연결에 문제가 있었던 것 같아요.\n다시 한 번 시도해 주세요.", | ||
| confirmButtonText = "확인", | ||
| onConfirm = {}, | ||
| ) | ||
| } | ||
7 changes: 7 additions & 0 deletions
7
data/src/main/java/com/threegap/bitnagil/data/di/CoroutineQualifier.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.threegap.bitnagil.data.di | ||
|
|
||
| import javax.inject.Qualifier | ||
|
|
||
| @Qualifier | ||
| @Retention(AnnotationRetention.BINARY) | ||
| annotation class IoDispatcher |
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.
Uh oh!
There was an error while loading. Please reload this page.