From 76a2ed0120e2a0291bf17d9596cceabcc256ceb0 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 03:04:14 +0900 Subject: [PATCH 01/11] [FEAT/#94] Filtering state, side effect --- .../com/terning/feature/main/MainNavigator.kt | 3 +- .../filtering/FilteringOneScreen.kt | 13 ++++---- .../filtering/FilteringSideEffect.kt | 8 +++++ .../onboarding/filtering/FilteringState.kt | 8 +++++ .../filtering/FilteringThreeScreen.kt | 17 ++++++---- .../filtering/FilteringTwoScreen.kt | 9 +++--- .../filtering/FilteringViewModel.kt | 31 ++++++++++++++++++- 7 files changed, 71 insertions(+), 18 deletions(-) create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringSideEffect.kt create mode 100644 feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringState.kt diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index b538c3e58..ecfb36b5c 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -12,6 +12,7 @@ import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage +import com.terning.feature.onboarding.filtering.navigation.FilteringOne import com.terning.feature.onboarding.signin.navigation.SignIn import com.terning.feature.search.search.navigation.navigateSearch @@ -22,7 +23,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = SignIn + val startDestination = FilteringOne val currentTab: MainTab? @Composable get() = MainTab.find { tab -> diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index 33c76066f..8178b7b78 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -26,8 +26,8 @@ import com.terning.feature.onboarding.filtering.navigation.navigateFilteringTwo fun FilteringOneScreen( navController: NavController, modifier: Modifier = Modifier, - filteringViewModel: FilteringViewModel = hiltViewModel(), - onButtonClick: () -> Unit = {}, + viewModel: FilteringViewModel = hiltViewModel(), + onButtonClick: (Int) -> Unit = {}, ) { val isButtonValid = remember { mutableStateOf(false) } @@ -54,7 +54,7 @@ fun FilteringOneScreen( Text( text = stringResource( id = R.string.filtering_status1_title, - filteringViewModel.name + viewModel.name ), style = TerningTheme.typography.title3, modifier = modifier.padding( @@ -63,7 +63,7 @@ fun FilteringOneScreen( ) ) Text( - text = stringResource(id = R.string.filtering_status1_sub, filteringViewModel.name), + text = stringResource(id = R.string.filtering_status1_sub, viewModel.name), style = TerningTheme.typography.body5, modifier = modifier.padding( top = 3.dp, @@ -72,9 +72,10 @@ fun FilteringOneScreen( ) ) StatusOneRadioGroup( - onButtonClick = { - onButtonClick() + onButtonClick = { index -> + onButtonClick(index) isButtonValid.value = true + viewModel.fetchGrade(index) } ) Text( diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringSideEffect.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringSideEffect.kt new file mode 100644 index 000000000..e5b56ef95 --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringSideEffect.kt @@ -0,0 +1,8 @@ +package com.terning.feature.onboarding.filtering + +import androidx.annotation.StringRes + +sealed class FilteringSideEffect { + data object NavigateToHome : FilteringSideEffect() + data class ShowToast(@StringRes val message: Int) : FilteringSideEffect() +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringState.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringState.kt new file mode 100644 index 000000000..f06e666fb --- /dev/null +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringState.kt @@ -0,0 +1,8 @@ +package com.terning.feature.onboarding.filtering + +data class FilteringState( + val grade: Int = -1, + val workingPeriod: Int = -1, + val startYear: Int = -1, + val startMonth: Int = -1 +) \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt index bf16f2a1e..f370db0c6 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt @@ -7,8 +7,9 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier @@ -22,20 +23,24 @@ import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R -import com.terning.feature.onboarding.starthome.navigation.navigateStartHome import java.util.Calendar @Composable fun FilteringThreeScreen( navController: NavController, modifier: Modifier = Modifier, - filteringViewModel: FilteringViewModel = hiltViewModel(), + viewModel: FilteringViewModel = hiltViewModel(), ) { val currentYear = Calendar.getInstance().get(Calendar.YEAR) val currentMonth = Calendar.getInstance().get(Calendar.MONTH) - var chosenYear by remember { mutableStateOf(currentYear) } - var chosenMonth by remember { mutableStateOf(currentMonth) } + var chosenYear by remember { mutableIntStateOf(currentYear) } + var chosenMonth by remember { mutableIntStateOf(currentMonth) } + + LaunchedEffect(key1 = chosenYear, key2 = chosenMonth) { + viewModel.fetchStartYear(chosenYear) + viewModel.fetchStartMonth(chosenMonth) + } Scaffold( modifier = modifier, @@ -86,7 +91,7 @@ fun FilteringThreeScreen( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.filtering_button, - onButtonClick = { navController.navigateStartHome() }, + onButtonClick = { viewModel.postFilteringWithServer() }, modifier = modifier.padding(bottom = 12.dp), ) } diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt index 0f07a9d11..b6de15c11 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt @@ -26,8 +26,8 @@ import com.terning.feature.onboarding.filtering.navigation.navigateFilteringThre fun FilteringTwoScreen( navController: NavController, modifier: Modifier = Modifier, - filteringViewModel: FilteringViewModel = hiltViewModel(), - onButtonClick: () -> Unit = {}, + viewModel: FilteringViewModel = hiltViewModel(), + onButtonClick: (Int) -> Unit = {}, ) { val isButtonValid = remember { mutableStateOf(false) } @@ -70,9 +70,10 @@ fun FilteringTwoScreen( ) ) StatusTwoRadioGroup( - onButtonClick = { - onButtonClick() + onButtonClick = {index -> + onButtonClick(index) isButtonValid.value = true + viewModel.fetchWorkingPeriod(index) } ) Text( diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt index b05c6266f..aefffd084 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt @@ -1,12 +1,41 @@ package com.terning.feature.onboarding.filtering import androidx.lifecycle.ViewModel +import com.terning.domain.repository.AuthRepository import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow import javax.inject.Inject @HiltViewModel -class FilteringViewModel @Inject constructor() : ViewModel() { +class FilteringViewModel @Inject constructor( + private val authRepository: AuthRepository, +) : ViewModel() { val name = "남지우" + private val _state = MutableStateFlow(FilteringState()) + val state: StateFlow get() = _state.asStateFlow() + + fun fetchGrade(grade: Int) { + _state.value = _state.value.copy(grade = grade) + } + + fun fetchWorkingPeriod(workingPeriod: Int) { + _state.value = _state.value.copy(workingPeriod = workingPeriod) + } + + fun fetchStartYear(startYear: Int) { + _state.value = _state.value.copy(startYear = startYear) + } + + fun fetchStartMonth(startMonth: Int) { + _state.value = _state.value.copy(startMonth = startMonth) + } + + fun postFilteringWithServer(){ + + } + } \ No newline at end of file From 7e3eea61618963df0d171f990e01bac3e5e4734a Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 03:29:15 +0900 Subject: [PATCH 02/11] [FEAT/#94] navigate with data class args --- .../com/terning/feature/main/MainNavigator.kt | 3 ++- .../onboarding/filtering/FilteringOneScreen.kt | 6 ++++-- .../onboarding/filtering/FilteringViewModel.kt | 2 -- .../feature/onboarding/signup/SignUpRoute.kt | 12 ++++++------ .../startfiltering/StartFilteringScreen.kt | 3 ++- .../navigation/StartFilteringNavigation.kt | 18 ++++++++++++++---- 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index ecfb36b5c..3a0455db8 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -14,6 +14,7 @@ import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage import com.terning.feature.onboarding.filtering.navigation.FilteringOne import com.terning.feature.onboarding.signin.navigation.SignIn +import com.terning.feature.onboarding.signup.navigation.SignUp import com.terning.feature.search.search.navigation.navigateSearch class MainNavigator( @@ -23,7 +24,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = FilteringOne + val startDestination = SignUp val currentTab: MainTab? @Composable get() = MainTab.find { tab -> diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index 8178b7b78..0da594a89 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -54,7 +54,7 @@ fun FilteringOneScreen( Text( text = stringResource( id = R.string.filtering_status1_title, - viewModel.name + // viewModel.name ), style = TerningTheme.typography.title3, modifier = modifier.padding( @@ -63,7 +63,9 @@ fun FilteringOneScreen( ) ) Text( - text = stringResource(id = R.string.filtering_status1_sub, viewModel.name), + text = stringResource(id = R.string.filtering_status1_sub, + // viewModel.name + ), style = TerningTheme.typography.body5, modifier = modifier.padding( top = 3.dp, diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt index aefffd084..2335b16b3 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt @@ -13,8 +13,6 @@ class FilteringViewModel @Inject constructor( private val authRepository: AuthRepository, ) : ViewModel() { - val name = "남지우" - private val _state = MutableStateFlow(FilteringState()) val state: StateFlow get() = _state.asStateFlow() diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt index 87eaa2db0..b5ff5adfe 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt @@ -25,20 +25,20 @@ import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.addFocusCleaner import com.terning.core.extension.noRippleClickable import com.terning.feature.R -import com.terning.feature.onboarding.filtering.navigation.navigateFilteringOne import com.terning.feature.onboarding.signup.component.SignUpProfile +import com.terning.feature.onboarding.startfiltering.navigation.navigateStartFiltering @Composable fun SignUpRoute( - signUpViewModel: SignUpViewModel = hiltViewModel(), + viewModel: SignUpViewModel = hiltViewModel(), navController: NavController ) { - val signUpState by signUpViewModel.state.collectAsStateWithLifecycle() + val state by viewModel.state.collectAsStateWithLifecycle() SignUpScreen( - signUpViewModel = signUpViewModel, - signUpState = signUpState, - onButtonClick = { navController.navigateFilteringOne() } + signUpViewModel = viewModel, + signUpState = state, + onButtonClick = { navController.navigateStartFiltering(state.name) } ) } diff --git a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt index 6c083aa5f..5d2821b9e 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt @@ -31,7 +31,8 @@ import kotlinx.coroutines.delay @Composable fun StartFilteringScreen( modifier: Modifier = Modifier, - navController: NavController + navController: NavController, + name: String ) { var isVisible by remember { mutableStateOf(false) } diff --git a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt index 2bcf37a82..ff9a04702 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt @@ -5,13 +5,17 @@ import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable +import androidx.navigation.toRoute import com.terning.core.navigation.Route import com.terning.feature.onboarding.startfiltering.StartFilteringScreen import kotlinx.serialization.Serializable -fun NavController.navigateStartFiltering(navOptions: NavOptions? = null) { +fun NavController.navigateStartFiltering( + name: String, + navOptions: NavOptions? = null +) { navigate( - route = StartFiltering, + route = StartFiltering(name = name), navOptions = navOptions ) } @@ -20,9 +24,15 @@ fun NavGraphBuilder.startFilteringNavGraph( navHostController: NavHostController ) { composable { - StartFilteringScreen(navController = navHostController) + val args = it.toRoute() + StartFilteringScreen( + navController = navHostController, + name = args.name + ) } } @Serializable -data object StartFiltering : Route \ No newline at end of file +data class StartFiltering( + val name: String +) : Route \ No newline at end of file From fdc433cab2dd0cd69ea798665b44d8bbf0e7b339 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 03:33:26 +0900 Subject: [PATCH 03/11] [FEAT/#94] navigate with data class args --- .../onboarding/filtering/FilteringOneScreen.kt | 8 +++++--- .../filtering/navigation/FilteringOneNavigation.kt | 14 +++++++++++--- .../startfiltering/StartFilteringScreen.kt | 4 ++-- .../navigation/StartFilteringNavigation.kt | 2 +- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt index 0da594a89..e27ecc89c 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt @@ -24,6 +24,7 @@ import com.terning.feature.onboarding.filtering.navigation.navigateFilteringTwo @Composable fun FilteringOneScreen( + name: String, navController: NavController, modifier: Modifier = Modifier, viewModel: FilteringViewModel = hiltViewModel(), @@ -54,7 +55,7 @@ fun FilteringOneScreen( Text( text = stringResource( id = R.string.filtering_status1_title, - // viewModel.name + name ), style = TerningTheme.typography.title3, modifier = modifier.padding( @@ -63,8 +64,9 @@ fun FilteringOneScreen( ) ) Text( - text = stringResource(id = R.string.filtering_status1_sub, - // viewModel.name + text = stringResource( + id = R.string.filtering_status1_sub, + name ), style = TerningTheme.typography.body5, modifier = modifier.padding( diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt index 55be952bb..583124d29 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt @@ -5,13 +5,17 @@ import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable +import androidx.navigation.toRoute import com.terning.core.navigation.Route import com.terning.feature.onboarding.filtering.FilteringOneScreen import kotlinx.serialization.Serializable -fun NavController.navigateFilteringOne(navOptions: NavOptions? = null) { +fun NavController.navigateFilteringOne( + name: String, + navOptions: NavOptions? = null +) { navigate( - route = FilteringOne, + route = FilteringOne(name = name), navOptions = navOptions ) } @@ -20,11 +24,15 @@ fun NavGraphBuilder.filteringOneNavGraph( navHostController: NavHostController ) { composable { + val args = it.toRoute() FilteringOneScreen( + name = args.name, navController = navHostController ) } } @Serializable -data object FilteringOne : Route \ No newline at end of file +data class FilteringOne( + val name: String +) : Route \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt index 5d2821b9e..c76ed0b24 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt @@ -30,9 +30,9 @@ import kotlinx.coroutines.delay @Composable fun StartFilteringScreen( + name: String, modifier: Modifier = Modifier, navController: NavController, - name: String ) { var isVisible by remember { mutableStateOf(false) } @@ -74,7 +74,7 @@ fun StartFilteringScreen( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.start_filtering_button, - onButtonClick = { navController.navigateFilteringOne() }, + onButtonClick = { navController.navigateFilteringOne(name) }, ) } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt index ff9a04702..170f1655b 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt @@ -26,8 +26,8 @@ fun NavGraphBuilder.startFilteringNavGraph( composable { val args = it.toRoute() StartFilteringScreen( + name = args.name, navController = navHostController, - name = args.name ) } } From 3b86518f7e4f1e09b346912100f7504cf79d447f Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 03:48:57 +0900 Subject: [PATCH 04/11] [MOVE/#94] move and add Filtering file --- .../com/terning/domain/repository/AuthRepository.kt | 6 ++++++ .../filtering/FilteringOneScreen.kt | 6 +++--- .../filtering/FilteringSideEffect.kt | 2 +- .../filtering/FilteringState.kt | 2 +- .../filtering/FilteringThreeScreen.kt | 2 +- .../filtering/FilteringTwoScreen.kt | 6 +++--- .../filtering/FilteringViewModel.kt | 2 +- .../filtering/component/StatusOneRadioGroup.kt | 2 +- .../filtering/component/StatusTwoRadioGroup.kt | 2 +- .../filtering/navigation/FilteringOneNavigation.kt | 4 ++-- .../filtering/navigation/FilteringTwoNavigation.kt | 4 ++-- .../filtering/navigation/ThreeNavigation.kt | 4 ++-- .../startfiltering/StartFilteringScreen.kt | 4 ++-- .../navigation/StartFilteringNavigation.kt | 4 ++-- .../starthome/StartHomeScreen.kt | 2 +- .../starthome/navigation/StartHomeNavigation.kt | 4 ++-- .../java/com/terning/feature/main/MainNavigator.kt | 2 -- .../main/java/com/terning/feature/main/MainScreen.kt | 10 +++++----- .../terning/feature/onboarding/signup/SignUpRoute.kt | 2 +- 19 files changed, 37 insertions(+), 33 deletions(-) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/FilteringOneScreen.kt (94%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/FilteringSideEffect.kt (80%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/FilteringState.kt (74%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/FilteringThreeScreen.kt (98%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/FilteringTwoScreen.kt (94%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/FilteringViewModel.kt (95%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/component/StatusOneRadioGroup.kt (97%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/component/StatusTwoRadioGroup.kt (97%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/navigation/FilteringOneNavigation.kt (87%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/navigation/FilteringTwoNavigation.kt (84%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/filtering/navigation/ThreeNavigation.kt (84%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/startfiltering/StartFilteringScreen.kt (95%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/startfiltering/navigation/StartFilteringNavigation.kt (86%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/starthome/StartHomeScreen.kt (98%) rename feature/src/main/java/com/terning/feature/{onboarding => filtering}/starthome/navigation/StartHomeNavigation.kt (84%) diff --git a/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt b/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt index 7176db213..d8c361ad4 100644 --- a/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt @@ -4,8 +4,14 @@ import com.terning.domain.entity.request.SignInRequestModel import com.terning.domain.entity.response.SignInResponseModel interface AuthRepository { + suspend fun postSignIn( authorization: String, request: SignInRequestModel ): Result + + suspend fun postFiltering( + userId : Long, + + ) } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt similarity index 94% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt index e27ecc89c..b55a36ee4 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering +package com.terning.feature.filtering.filtering import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -19,8 +19,8 @@ import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R -import com.terning.feature.onboarding.filtering.component.StatusOneRadioGroup -import com.terning.feature.onboarding.filtering.navigation.navigateFilteringTwo +import com.terning.feature.filtering.filtering.component.StatusOneRadioGroup +import com.terning.feature.filtering.filtering.navigation.navigateFilteringTwo @Composable fun FilteringOneScreen( diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringSideEffect.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringSideEffect.kt similarity index 80% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringSideEffect.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/FilteringSideEffect.kt index e5b56ef95..6189ba6d6 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringSideEffect.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringSideEffect.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering +package com.terning.feature.filtering.filtering import androidx.annotation.StringRes diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringState.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringState.kt similarity index 74% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringState.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/FilteringState.kt index f06e666fb..b35e6fbd2 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringState.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringState.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering +package com.terning.feature.filtering.filtering data class FilteringState( val grade: Int = -1, diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt similarity index 98% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt index f370db0c6..23f53684b 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering +package com.terning.feature.filtering.filtering import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt similarity index 94% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt index b6de15c11..80988079a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringTwoScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering +package com.terning.feature.filtering.filtering import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -19,8 +19,8 @@ import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R -import com.terning.feature.onboarding.filtering.component.StatusTwoRadioGroup -import com.terning.feature.onboarding.filtering.navigation.navigateFilteringThree +import com.terning.feature.filtering.filtering.component.StatusTwoRadioGroup +import com.terning.feature.filtering.filtering.navigation.navigateFilteringThree @Composable fun FilteringTwoScreen( diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt similarity index 95% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt index 2335b16b3..0676192f3 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/FilteringViewModel.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering +package com.terning.feature.filtering.filtering import androidx.lifecycle.ViewModel import com.terning.domain.repository.AuthRepository diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/component/StatusOneRadioGroup.kt similarity index 97% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/component/StatusOneRadioGroup.kt index def61d2b4..9efc5cbf1 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusOneRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/component/StatusOneRadioGroup.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering.component +package com.terning.feature.filtering.filtering.component import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.fillMaxWidth diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/component/StatusTwoRadioGroup.kt similarity index 97% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/component/StatusTwoRadioGroup.kt index c7b273abc..c97d92321 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/component/StatusTwoRadioGroup.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/component/StatusTwoRadioGroup.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering.component +package com.terning.feature.filtering.filtering.component import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.fillMaxWidth diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringOneNavigation.kt similarity index 87% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringOneNavigation.kt index 583124d29..d0bff745a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringOneNavigation.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringOneNavigation.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering.navigation +package com.terning.feature.filtering.filtering.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -7,7 +7,7 @@ import androidx.navigation.NavOptions import androidx.navigation.compose.composable import androidx.navigation.toRoute import com.terning.core.navigation.Route -import com.terning.feature.onboarding.filtering.FilteringOneScreen +import com.terning.feature.filtering.filtering.FilteringOneScreen import kotlinx.serialization.Serializable fun NavController.navigateFilteringOne( diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringTwoNavigation.kt similarity index 84% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringTwoNavigation.kt index d7faf0d22..9f99c9ca4 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/FilteringTwoNavigation.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringTwoNavigation.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering.navigation +package com.terning.feature.filtering.filtering.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -6,7 +6,7 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.Route -import com.terning.feature.onboarding.filtering.FilteringTwoScreen +import com.terning.feature.filtering.filtering.FilteringTwoScreen import kotlinx.serialization.Serializable fun NavController.navigateFilteringTwo(navOptions: NavOptions? = null) { diff --git a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/ThreeNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/ThreeNavigation.kt similarity index 84% rename from feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/ThreeNavigation.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/navigation/ThreeNavigation.kt index 8c98afbae..101acbd4c 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/filtering/navigation/ThreeNavigation.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/ThreeNavigation.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.filtering.navigation +package com.terning.feature.filtering.filtering.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -6,7 +6,7 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.Route -import com.terning.feature.onboarding.filtering.FilteringThreeScreen +import com.terning.feature.filtering.filtering.FilteringThreeScreen import kotlinx.serialization.Serializable fun NavController.navigateFilteringThree(navOptions: NavOptions? = null) { diff --git a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt b/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt similarity index 95% rename from feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt rename to feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt index c76ed0b24..74f2f8576 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/StartFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.startfiltering +package com.terning.feature.filtering.startfiltering import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.fadeIn @@ -25,7 +25,7 @@ import androidx.navigation.NavController import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R -import com.terning.feature.onboarding.filtering.navigation.navigateFilteringOne +import com.terning.feature.filtering.filtering.navigation.navigateFilteringOne import kotlinx.coroutines.delay @Composable diff --git a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt similarity index 86% rename from feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt rename to feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt index 170f1655b..7cc79470b 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/startfiltering/navigation/StartFilteringNavigation.kt +++ b/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.startfiltering.navigation +package com.terning.feature.filtering.startfiltering.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -7,7 +7,7 @@ import androidx.navigation.NavOptions import androidx.navigation.compose.composable import androidx.navigation.toRoute import com.terning.core.navigation.Route -import com.terning.feature.onboarding.startfiltering.StartFilteringScreen +import com.terning.feature.filtering.startfiltering.StartFilteringScreen import kotlinx.serialization.Serializable fun NavController.navigateStartFiltering( diff --git a/feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt b/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt similarity index 98% rename from feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt rename to feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt index 86bd93a73..687bca841 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/starthome/StartHomeScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.starthome +package com.terning.feature.filtering.starthome import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.fadeIn diff --git a/feature/src/main/java/com/terning/feature/onboarding/starthome/navigation/StartHomeNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/starthome/navigation/StartHomeNavigation.kt similarity index 84% rename from feature/src/main/java/com/terning/feature/onboarding/starthome/navigation/StartHomeNavigation.kt rename to feature/src/main/java/com/terning/feature/filtering/starthome/navigation/StartHomeNavigation.kt index 7cd5a3d3a..424406917 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/starthome/navigation/StartHomeNavigation.kt +++ b/feature/src/main/java/com/terning/feature/filtering/starthome/navigation/StartHomeNavigation.kt @@ -1,4 +1,4 @@ -package com.terning.feature.onboarding.starthome.navigation +package com.terning.feature.filtering.starthome.navigation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -6,7 +6,7 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.Route -import com.terning.feature.onboarding.starthome.StartHomeScreen +import com.terning.feature.filtering.starthome.StartHomeScreen import kotlinx.serialization.Serializable fun NavController.navigateStartHome(navOptions: NavOptions? = null) { diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index 3a0455db8..1286b625b 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -12,8 +12,6 @@ import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage -import com.terning.feature.onboarding.filtering.navigation.FilteringOne -import com.terning.feature.onboarding.signin.navigation.SignIn import com.terning.feature.onboarding.signup.navigation.SignUp import com.terning.feature.search.search.navigation.navigateSearch diff --git a/feature/src/main/java/com/terning/feature/main/MainScreen.kt b/feature/src/main/java/com/terning/feature/main/MainScreen.kt index e97b15b58..80711c6d7 100644 --- a/feature/src/main/java/com/terning/feature/main/MainScreen.kt +++ b/feature/src/main/java/com/terning/feature/main/MainScreen.kt @@ -25,13 +25,13 @@ import com.terning.feature.home.changefilter.navigation.changeFilterNavGraph import com.terning.feature.home.home.navigation.homeNavGraph import com.terning.feature.intern.navigation.internNavGraph import com.terning.feature.mypage.navigation.myPageNavGraph -import com.terning.feature.onboarding.filtering.navigation.filteringOneNavGraph -import com.terning.feature.onboarding.filtering.navigation.filteringThreeNavGraph -import com.terning.feature.onboarding.filtering.navigation.filteringTwoNavGraph +import com.terning.feature.filtering.filtering.navigation.filteringOneNavGraph +import com.terning.feature.filtering.filtering.navigation.filteringThreeNavGraph +import com.terning.feature.filtering.filtering.navigation.filteringTwoNavGraph import com.terning.feature.onboarding.signin.navigation.signInNavGraph import com.terning.feature.onboarding.signup.navigation.signUpNavGraph -import com.terning.feature.onboarding.startfiltering.navigation.startFilteringNavGraph -import com.terning.feature.onboarding.starthome.navigation.startHomeNavGraph +import com.terning.feature.filtering.startfiltering.navigation.startFilteringNavGraph +import com.terning.feature.filtering.starthome.navigation.startHomeNavGraph import com.terning.feature.search.search.navigation.searchNavGraph import com.terning.feature.search.searchprocess.navigation.searchProcessNavGraph diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt index b5ff5adfe..37ea00960 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt @@ -26,7 +26,7 @@ import com.terning.core.extension.addFocusCleaner import com.terning.core.extension.noRippleClickable import com.terning.feature.R import com.terning.feature.onboarding.signup.component.SignUpProfile -import com.terning.feature.onboarding.startfiltering.navigation.navigateStartFiltering +import com.terning.feature.filtering.startfiltering.navigation.navigateStartFiltering @Composable fun SignUpRoute( From d626b1d43494e1de6a8e21fc2bf63a1cf69ce597 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 03:56:15 +0900 Subject: [PATCH 05/11] =?UTF-8?q?[CHORE/#94]=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/domain/repository/FilteringRepository.kt | 5 +++++ .../feature/filtering/filtering/FilteringViewModel.kt | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt diff --git a/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt b/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt new file mode 100644 index 000000000..0ee0a120a --- /dev/null +++ b/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt @@ -0,0 +1,5 @@ +package com.terning.domain.repository + +interface FilteringRepository { + suspend fun postFiltering() +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt index 0676192f3..fead046b9 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt @@ -1,7 +1,7 @@ package com.terning.feature.filtering.filtering import androidx.lifecycle.ViewModel -import com.terning.domain.repository.AuthRepository +import com.terning.domain.repository.FilteringRepository import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow @@ -10,7 +10,7 @@ import javax.inject.Inject @HiltViewModel class FilteringViewModel @Inject constructor( - private val authRepository: AuthRepository, + private val filteringRepository: FilteringRepository ) : ViewModel() { private val _state = MutableStateFlow(FilteringState()) @@ -32,7 +32,7 @@ class FilteringViewModel @Inject constructor( _state.value = _state.value.copy(startMonth = startMonth) } - fun postFilteringWithServer(){ + fun postFilteringWithServer() { } From b98b08347f353ac79f0c4e192fb367f6b012d9f6 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 16:47:57 +0900 Subject: [PATCH 06/11] =?UTF-8?q?[CHORE/#88]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?,=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/data/repositoryimpl/AuthRepositoryImpl.kt | 4 ++++ .../src/main/java/com/terning/feature/main/MainNavigator.kt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt index f5b5c1df7..4aa4efbd0 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt @@ -19,4 +19,8 @@ class AuthRepositoryImpl @Inject constructor( request.toSignInRequestDto() ).result.toSignInModel() } + + override suspend fun postFiltering(userId: Long) { + TODO("Not yet implemented") + } } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index 1286b625b..b538c3e58 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -12,7 +12,7 @@ import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage -import com.terning.feature.onboarding.signup.navigation.SignUp +import com.terning.feature.onboarding.signin.navigation.SignIn import com.terning.feature.search.search.navigation.navigateSearch class MainNavigator( @@ -22,7 +22,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = SignUp + val startDestination = SignIn val currentTab: MainTab? @Composable get() = MainTab.find { tab -> From 5fe1bc94d3cd87f7fd08e094a1534ded8ced56c1 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 19:57:48 +0900 Subject: [PATCH 07/11] =?UTF-8?q?[FEAT/#94]=20=ED=95=84=ED=84=B0=EB=A7=81?= =?UTF-8?q?=20=EC=84=9C=EB=B2=84=ED=86=B5=EC=8B=A0=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/point/di/AuthInterceptor.kt | 82 +++++++++---------- .../com/terning/point/di/DataSourceModule.kt | 6 ++ .../com/terning/point/di/DataStoreModule.kt | 1 + .../com/terning/point/di/RepositoryModule.kt | 6 ++ .../com/terning/point/di/ServiceModule.kt | 6 ++ .../data/datasource/FilteringDataSource.kt | 8 ++ .../datasourceimpl/FilteringDataSourceImpl.kt | 17 ++++ .../data/dto/request/FilteringRequestDto.kt | 25 ++++++ .../repositoryimpl/FilteringRepositoryImpl.kt | 22 +++++ .../repositoryimpl/TokenRepositoryImpl.kt | 2 + .../terning/data/service/FilteringService.kt | 15 ++++ .../entity/request/FilteringRequestModel.kt | 8 ++ .../domain/repository/FilteringRepository.kt | 7 +- .../domain/repository/TokenRepository.kt | 2 + .../filtering/FilteringSideEffect.kt | 2 +- .../filtering/filtering/FilteringViewModel.kt | 32 +++++++- .../com/terning/feature/main/MainNavigator.kt | 4 +- .../onboarding/signin/SignInViewModel.kt | 2 + 18 files changed, 201 insertions(+), 46 deletions(-) create mode 100644 data/src/main/java/com/terning/data/datasource/FilteringDataSource.kt create mode 100644 data/src/main/java/com/terning/data/datasourceimpl/FilteringDataSourceImpl.kt create mode 100644 data/src/main/java/com/terning/data/dto/request/FilteringRequestDto.kt create mode 100644 data/src/main/java/com/terning/data/repositoryimpl/FilteringRepositoryImpl.kt create mode 100644 data/src/main/java/com/terning/data/service/FilteringService.kt create mode 100644 domain/src/main/java/com/terning/domain/entity/request/FilteringRequestModel.kt diff --git a/app/src/main/java/com/terning/point/di/AuthInterceptor.kt b/app/src/main/java/com/terning/point/di/AuthInterceptor.kt index d54fffc06..a09d6154a 100644 --- a/app/src/main/java/com/terning/point/di/AuthInterceptor.kt +++ b/app/src/main/java/com/terning/point/di/AuthInterceptor.kt @@ -31,59 +31,59 @@ class AuthInterceptor @Inject constructor( val authRequest = if (terningDataStore.accessToken.isNotBlank()) { originalRequest.newBuilder().newAuthBuilder().build() } else { - originalRequest + originalRequest.newBuilder().newAuthBuilder().build() } val response = chain.proceed(authRequest) - when (response.code) { - CODE_TOKEN_EXPIRED -> { - try { - runBlocking { - tokenReissueRepository.postReissueToken( - terningDataStore.refreshToken - ) - }.onSuccess { data -> - terningDataStore.apply { - refreshToken = data.refreshToken - } - - response.close() - - val newRequest = - authRequest.newBuilder().removeHeader(AUTHORIZATION).newAuthBuilder() - .build() - - return chain.proceed(newRequest) - } - } catch (t: Throwable) { - Timber.d(t.message) - } - - terningDataStore.clearInfo() - - Handler(Looper.getMainLooper()).post { - context.stringToast(TOKEN_EXPIRED_ERROR) - Handler(Looper.getMainLooper()).post { - ProcessPhoenix.triggerRebirth( - context, - Intent(context, MainActivity::class.java) - ) - } - } - } - } +// when (response.code) { +// CODE_TOKEN_EXPIRED -> { +// try { +// runBlocking { +// tokenReissueRepository.postReissueToken( +// terningDataStore.refreshToken +// ) +// }.onSuccess { data -> +// terningDataStore.apply { +// refreshToken = data.refreshToken +// } +// +// response.close() +// +// val newRequest = +// authRequest.newBuilder().removeHeader(AUTHORIZATION).newAuthBuilder() +// .build() +// +// return chain.proceed(newRequest) +// } +// } catch (t: Throwable) { +// Timber.d(t.message) +// } +// +// terningDataStore.clearInfo() +// +//// Handler(Looper.getMainLooper()).post { +//// context.stringToast(TOKEN_EXPIRED_ERROR) +//// Handler(Looper.getMainLooper()).post { +//// ProcessPhoenix.triggerRebirth( +//// context, +//// Intent(context, MainActivity::class.java) +//// ) +//// } +//// } +// } +// } return response } private fun Request.Builder.newAuthBuilder() = - this.addHeader(AUTHORIZATION, "$BEARER ${terningDataStore.accessToken}") + this.addHeader(AUTHORIZATION, "$BEARER $TEMP_TOKEN") companion object { private const val CODE_TOKEN_EXPIRED = 401 - private const val TOKEN_EXPIRED_ERROR = "토큰이 만료되었어요\n다시 로그인 해주세요" + // private const val TOKEN_EXPIRED_ERROR = "토큰이 만료되었어요\n다시 로그인 해주세요" private const val BEARER = "Bearer" private const val AUTHORIZATION = "Authorization" + const val TEMP_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzM4NCJ9.eyJ1c2VySWQiOjM2MjA3NzQzMTcsImlhdCI6MTcyMTIwNjM2MywiZXhwIjoxNzIzNzk3MzYzfQ.GFHHNyr3dB3B-B2Ju0aPryIKhsSaDrwCT624H0FQcevKk6gQ5MRY9obWDbY7mB0l" } - } \ No newline at end of file diff --git a/app/src/main/java/com/terning/point/di/DataSourceModule.kt b/app/src/main/java/com/terning/point/di/DataSourceModule.kt index 7e00cbb4c..b1b00479a 100644 --- a/app/src/main/java/com/terning/point/di/DataSourceModule.kt +++ b/app/src/main/java/com/terning/point/di/DataSourceModule.kt @@ -1,9 +1,11 @@ package com.terning.point.di import com.terning.data.datasource.AuthDataSource +import com.terning.data.datasource.FilteringDataSource import com.terning.data.datasource.SearchDataSource import com.terning.data.datasource.TokenReissueDataSource import com.terning.data.datasourceimpl.AuthDataSourceImpl +import com.terning.data.datasourceimpl.FilteringDataSourceImpl import com.terning.data.datasourceimpl.SearchDataSourceImpl import com.terning.data.datasourceimpl.TokenReissueDataSourceImpl import dagger.Binds @@ -28,4 +30,8 @@ abstract class DataSourceModule { @Binds @Singleton abstract fun bindTokenReissueDataSource(tokenReissueDataSourceImpl: TokenReissueDataSourceImpl): TokenReissueDataSource + + @Binds + @Singleton + abstract fun bindFilteringDataSource(filteringDataSourceImpl: FilteringDataSourceImpl): FilteringDataSource } \ No newline at end of file diff --git a/app/src/main/java/com/terning/point/di/DataStoreModule.kt b/app/src/main/java/com/terning/point/di/DataStoreModule.kt index ca4b09d65..bfc402ad1 100644 --- a/app/src/main/java/com/terning/point/di/DataStoreModule.kt +++ b/app/src/main/java/com/terning/point/di/DataStoreModule.kt @@ -24,4 +24,5 @@ object DataStoreModule { @Singleton fun provideTerningDataStore(dataStoreImpl: TerningDataStoreImpl): TerningDataStore = dataStoreImpl + } \ No newline at end of file diff --git a/app/src/main/java/com/terning/point/di/RepositoryModule.kt b/app/src/main/java/com/terning/point/di/RepositoryModule.kt index 2377e8ef7..37ee9be50 100644 --- a/app/src/main/java/com/terning/point/di/RepositoryModule.kt +++ b/app/src/main/java/com/terning/point/di/RepositoryModule.kt @@ -1,10 +1,12 @@ package com.terning.point.di import com.terning.data.repositoryimpl.AuthRepositoryImpl +import com.terning.data.repositoryimpl.FilteringRepositoryImpl import com.terning.data.repositoryimpl.SearchViewsRepositoryImpl import com.terning.data.repositoryimpl.TokenReissueRepositoryImpl import com.terning.data.repositoryimpl.TokenRepositoryImpl import com.terning.domain.repository.AuthRepository +import com.terning.domain.repository.FilteringRepository import com.terning.domain.repository.SearchRepository import com.terning.domain.repository.TokenReissueRepository import com.terning.domain.repository.TokenRepository @@ -33,4 +35,8 @@ abstract class RepositoryModule { @Binds @Singleton abstract fun bindTokenReissueRepository(tokenReissueRepositoryImpl: TokenReissueRepositoryImpl): TokenReissueRepository + + @Binds + @Singleton + abstract fun bindFilteringRepository(filteringRepositoryImpl: FilteringRepositoryImpl): FilteringRepository } \ No newline at end of file diff --git a/app/src/main/java/com/terning/point/di/ServiceModule.kt b/app/src/main/java/com/terning/point/di/ServiceModule.kt index 92c4765db..53eb49bdf 100644 --- a/app/src/main/java/com/terning/point/di/ServiceModule.kt +++ b/app/src/main/java/com/terning/point/di/ServiceModule.kt @@ -1,6 +1,7 @@ package com.terning.point.di import com.terning.data.service.AuthService +import com.terning.data.service.FilteringService import com.terning.data.service.SearchService import com.terning.data.service.TokenReissueService import com.terning.point.di.qualifier.JWT @@ -30,4 +31,9 @@ object ServiceModule { @Singleton fun provideTokenReissueService(@REISSUE retrofit: Retrofit): TokenReissueService = retrofit.create(TokenReissueService::class.java) + + @Provides + @Singleton + fun provideFilteringService(@JWT retrofit: Retrofit): FilteringService = + retrofit.create(FilteringService::class.java) } \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/datasource/FilteringDataSource.kt b/data/src/main/java/com/terning/data/datasource/FilteringDataSource.kt new file mode 100644 index 000000000..fa9778fb2 --- /dev/null +++ b/data/src/main/java/com/terning/data/datasource/FilteringDataSource.kt @@ -0,0 +1,8 @@ +package com.terning.data.datasource + +import com.terning.data.dto.NonDataBaseResponse +import com.terning.data.dto.request.FilteringRequestDto + +interface FilteringDataSource { + suspend fun postFiltering(userId: Long, request: FilteringRequestDto): NonDataBaseResponse +} \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/datasourceimpl/FilteringDataSourceImpl.kt b/data/src/main/java/com/terning/data/datasourceimpl/FilteringDataSourceImpl.kt new file mode 100644 index 000000000..19443a235 --- /dev/null +++ b/data/src/main/java/com/terning/data/datasourceimpl/FilteringDataSourceImpl.kt @@ -0,0 +1,17 @@ +package com.terning.data.datasourceimpl + +import com.terning.data.datasource.FilteringDataSource +import com.terning.data.dto.NonDataBaseResponse +import com.terning.data.dto.request.FilteringRequestDto +import com.terning.data.service.FilteringService +import javax.inject.Inject + +class FilteringDataSourceImpl @Inject constructor( + private val filteringService: FilteringService +) : FilteringDataSource { + override suspend fun postFiltering( + userId: Long, + request: FilteringRequestDto + ): NonDataBaseResponse = + filteringService.postFilteringService(userId, request) +} \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/dto/request/FilteringRequestDto.kt b/data/src/main/java/com/terning/data/dto/request/FilteringRequestDto.kt new file mode 100644 index 000000000..61606ef98 --- /dev/null +++ b/data/src/main/java/com/terning/data/dto/request/FilteringRequestDto.kt @@ -0,0 +1,25 @@ +package com.terning.data.dto.request + +import com.terning.domain.entity.request.FilteringRequestModel +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class FilteringRequestDto( + @SerialName("grade") + val grade: Int, + @SerialName("workingPeriod") + val workingPeriod: Int, + @SerialName("startYear") + val startYear: Int, + @SerialName("startMonth") + val startMonth: Int +) + +fun FilteringRequestModel.toFilteringRequestDto(): FilteringRequestDto = + FilteringRequestDto( + grade = grade, + workingPeriod = workingPeriod, + startYear = startYear, + startMonth = startMonth + ) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/repositoryimpl/FilteringRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/FilteringRepositoryImpl.kt new file mode 100644 index 000000000..e98de70e3 --- /dev/null +++ b/data/src/main/java/com/terning/data/repositoryimpl/FilteringRepositoryImpl.kt @@ -0,0 +1,22 @@ +package com.terning.data.repositoryimpl + +import com.terning.data.datasource.FilteringDataSource +import com.terning.data.dto.request.toFilteringRequestDto +import com.terning.domain.entity.request.FilteringRequestModel +import com.terning.domain.repository.FilteringRepository +import javax.inject.Inject + +class FilteringRepositoryImpl @Inject constructor( + private val filteringDataSource: FilteringDataSource +) : FilteringRepository { + override suspend fun postFiltering( + userId: Long, + request: FilteringRequestModel + ): Result = + runCatching { + filteringDataSource.postFiltering( + userId, + request.toFilteringRequestDto() + ) + } +} \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/repositoryimpl/TokenRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/TokenRepositoryImpl.kt index 13b1a3031..ffa95fbc3 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/TokenRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/TokenRepositoryImpl.kt @@ -20,6 +20,8 @@ class TokenRepositoryImpl @Inject constructor( terningDataStore.userId = userId } + override fun getUserId(): Long = terningDataStore.userId + override fun clearInfo() { terningDataStore.clearInfo() } diff --git a/data/src/main/java/com/terning/data/service/FilteringService.kt b/data/src/main/java/com/terning/data/service/FilteringService.kt new file mode 100644 index 000000000..309041034 --- /dev/null +++ b/data/src/main/java/com/terning/data/service/FilteringService.kt @@ -0,0 +1,15 @@ +package com.terning.data.service + +import com.terning.data.dto.NonDataBaseResponse +import com.terning.data.dto.request.FilteringRequestDto +import retrofit2.http.Body +import retrofit2.http.Header +import retrofit2.http.POST + +interface FilteringService { + @POST("/api/v1/auth/sign-up/filter") + suspend fun postFilteringService( + @Header("userId") userId: Long, + @Body request: FilteringRequestDto + ): NonDataBaseResponse +} \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/entity/request/FilteringRequestModel.kt b/domain/src/main/java/com/terning/domain/entity/request/FilteringRequestModel.kt new file mode 100644 index 000000000..fd6205dbc --- /dev/null +++ b/domain/src/main/java/com/terning/domain/entity/request/FilteringRequestModel.kt @@ -0,0 +1,8 @@ +package com.terning.domain.entity.request + +data class FilteringRequestModel( + val grade: Int, + val workingPeriod: Int, + val startYear: Int, + val startMonth: Int +) \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt b/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt index 0ee0a120a..5828acf3c 100644 --- a/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt @@ -1,5 +1,10 @@ package com.terning.domain.repository +import com.terning.domain.entity.request.FilteringRequestModel + interface FilteringRepository { - suspend fun postFiltering() + suspend fun postFiltering( + userId: Long, + request: FilteringRequestModel + ): Result } \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/repository/TokenRepository.kt b/domain/src/main/java/com/terning/domain/repository/TokenRepository.kt index d55d469ef..f9aad28a3 100644 --- a/domain/src/main/java/com/terning/domain/repository/TokenRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/TokenRepository.kt @@ -9,5 +9,7 @@ interface TokenRepository { fun setUserId(userId: Long) + fun getUserId() : Long + fun clearInfo() } diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringSideEffect.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringSideEffect.kt index 6189ba6d6..52c9b3a68 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringSideEffect.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringSideEffect.kt @@ -3,6 +3,6 @@ package com.terning.feature.filtering.filtering import androidx.annotation.StringRes sealed class FilteringSideEffect { - data object NavigateToHome : FilteringSideEffect() + data object NavigateToStartHome : FilteringSideEffect() data class ShowToast(@StringRes val message: Int) : FilteringSideEffect() } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt index f165fb581..ebea0abe6 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt @@ -1,21 +1,33 @@ package com.terning.feature.filtering.filtering import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.terning.domain.entity.request.FilteringRequestModel import com.terning.domain.repository.FilteringRepository +import com.terning.domain.repository.TokenRepository +import com.terning.feature.R import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.launch import javax.inject.Inject @HiltViewModel class FilteringViewModel @Inject constructor( - // private val filteringRepository: FilteringRepository + private val filteringRepository: FilteringRepository, + private val tokenRepository: TokenRepository ) : ViewModel() { private val _state = MutableStateFlow(FilteringState()) val state: StateFlow get() = _state.asStateFlow() + private val _sideEffects = MutableSharedFlow() + val sideEffects: SharedFlow get() = _sideEffects.asSharedFlow() + fun fetchGrade(grade: Int) { _state.value = _state.value.copy(grade = grade) } @@ -33,7 +45,23 @@ class FilteringViewModel @Inject constructor( } fun postFilteringWithServer() { - + viewModelScope.launch { + filteringRepository.postFiltering( + tokenRepository.getUserId(), + state.value.run { + FilteringRequestModel( + grade = grade, + workingPeriod = workingPeriod, + startYear = startYear, + startMonth = startMonth + ) + } + ).onSuccess { + _sideEffects.emit(FilteringSideEffect.NavigateToStartHome) + }.onFailure { + _sideEffects.emit(FilteringSideEffect.ShowToast(R.string.server_failure)) + } + } } } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index b538c3e58..896e28c3c 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -10,9 +10,11 @@ import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar +import com.terning.feature.filtering.filtering.navigation.FilteringOne import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage import com.terning.feature.onboarding.signin.navigation.SignIn +import com.terning.feature.onboarding.signup.navigation.SignUp import com.terning.feature.search.search.navigation.navigateSearch class MainNavigator( @@ -22,7 +24,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = SignIn + val startDestination = FilteringOne val currentTab: MainTab? @Composable get() = MainTab.find { tab -> diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt index b9002a4de..7ea78750d 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt @@ -1,6 +1,7 @@ package com.terning.feature.onboarding.signin import android.content.Context +import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.kakao.sdk.auth.model.OAuthToken @@ -78,6 +79,7 @@ class SignInViewModel @Inject constructor( accessToken: String, authType: String = KAKAO ) { + Log.d("LYB", accessToken) authRepository.postSignIn( accessToken, SignInRequestModel(authType) From 1381a7478d5a95338d8efc7d9c7e52c2a1c1d411 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 20:23:07 +0900 Subject: [PATCH 08/11] =?UTF-8?q?[FEAT/#94]=20=EB=84=A4=EB=B9=84=EA=B2=8C?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filtering/filtering/FilteringOneScreen.kt | 9 +++++++-- .../filtering/filtering/FilteringThreeScreen.kt | 7 +++++++ .../filtering/filtering/FilteringTwoScreen.kt | 10 ++++++++-- .../navigation/FilteringTwoNavigation.kt | 14 +++++++++++--- .../filtering/navigation/ThreeNavigation.kt | 16 +++++++++++++--- .../feature/onboarding/signup/SignUpRoute.kt | 5 +++-- .../onboarding/signup/SignUpSideEffect.kt | 2 +- .../feature/onboarding/signup/SignUpViewModel.kt | 5 +++-- 8 files changed, 53 insertions(+), 15 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt index b55a36ee4..820f67c76 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt @@ -7,8 +7,11 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp @@ -32,6 +35,8 @@ fun FilteringOneScreen( ) { val isButtonValid = remember { mutableStateOf(false) } + var grade by remember { mutableIntStateOf(-1) } + Scaffold( modifier = modifier, topBar = { @@ -79,7 +84,7 @@ fun FilteringOneScreen( onButtonClick = { index -> onButtonClick(index) isButtonValid.value = true - viewModel.fetchGrade(index) + grade = index } ) Text( @@ -95,7 +100,7 @@ fun FilteringOneScreen( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.filtering_button, - onButtonClick = { navController.navigateFilteringTwo() }, + onButtonClick = { navController.navigateFilteringTwo(grade) }, modifier = modifier.padding(bottom = 12.dp), isEnabled = isButtonValid.value ) diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt index 23f53684b..2be6fc885 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt @@ -27,6 +27,8 @@ import java.util.Calendar @Composable fun FilteringThreeScreen( + grade: Int, + workingPeriod: Int, navController: NavController, modifier: Modifier = Modifier, viewModel: FilteringViewModel = hiltViewModel(), @@ -37,6 +39,11 @@ fun FilteringThreeScreen( var chosenYear by remember { mutableIntStateOf(currentYear) } var chosenMonth by remember { mutableIntStateOf(currentMonth) } + LaunchedEffect(key1 = true) { + viewModel.fetchGrade(grade = grade) + viewModel.fetchWorkingPeriod(workingPeriod = workingPeriod) + } + LaunchedEffect(key1 = chosenYear, key2 = chosenMonth) { viewModel.fetchStartYear(chosenYear) viewModel.fetchStartMonth(chosenMonth) diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt index 80988079a..fd56e08cd 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt @@ -7,8 +7,11 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp @@ -24,6 +27,7 @@ import com.terning.feature.filtering.filtering.navigation.navigateFilteringThree @Composable fun FilteringTwoScreen( + grade : Int, navController: NavController, modifier: Modifier = Modifier, viewModel: FilteringViewModel = hiltViewModel(), @@ -32,6 +36,8 @@ fun FilteringTwoScreen( val isButtonValid = remember { mutableStateOf(false) } + var workingPeriod by remember{ mutableIntStateOf(-1) } + Scaffold( modifier = modifier, topBar = { @@ -73,7 +79,7 @@ fun FilteringTwoScreen( onButtonClick = {index -> onButtonClick(index) isButtonValid.value = true - viewModel.fetchWorkingPeriod(index) + workingPeriod = index } ) Text( @@ -89,7 +95,7 @@ fun FilteringTwoScreen( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.filtering_button, - onButtonClick = { navController.navigateFilteringThree() }, + onButtonClick = { navController.navigateFilteringThree(grade, workingPeriod) }, modifier = modifier.padding(bottom = 12.dp), isEnabled = isButtonValid.value ) diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringTwoNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringTwoNavigation.kt index 9f99c9ca4..93f4d36d7 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringTwoNavigation.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringTwoNavigation.kt @@ -5,13 +5,17 @@ import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable +import androidx.navigation.toRoute import com.terning.core.navigation.Route import com.terning.feature.filtering.filtering.FilteringTwoScreen import kotlinx.serialization.Serializable -fun NavController.navigateFilteringTwo(navOptions: NavOptions? = null) { +fun NavController.navigateFilteringTwo( + grade: Int, + navOptions: NavOptions? = null +) { navigate( - route = FilteringTwo, + route = FilteringTwo(grade = grade), navOptions = navOptions ) } @@ -20,11 +24,15 @@ fun NavGraphBuilder.filteringTwoNavGraph( navHostController: NavHostController ) { composable { + val args = it.toRoute() FilteringTwoScreen( + grade = args.grade, navController = navHostController ) } } @Serializable -data object FilteringTwo : Route \ No newline at end of file +data class FilteringTwo( + val grade: Int +) : Route \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/ThreeNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/ThreeNavigation.kt index 101acbd4c..9aeae7c9a 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/ThreeNavigation.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/ThreeNavigation.kt @@ -5,13 +5,17 @@ import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable +import androidx.navigation.toRoute import com.terning.core.navigation.Route import com.terning.feature.filtering.filtering.FilteringThreeScreen import kotlinx.serialization.Serializable -fun NavController.navigateFilteringThree(navOptions: NavOptions? = null) { +fun NavController.navigateFilteringThree( + grade : Int, + workingPeriod : Int, + navOptions: NavOptions? = null) { navigate( - route = FilteringThree, + route = FilteringThree(grade = grade, workingPeriod = workingPeriod), navOptions = navOptions ) } @@ -20,11 +24,17 @@ fun NavGraphBuilder.filteringThreeNavGraph( navHostController: NavHostController ) { composable { + val args = it.toRoute() FilteringThreeScreen( + grade = args.grade, + workingPeriod = args.workingPeriod, navController = navHostController ) } } @Serializable -data object FilteringThree : Route \ No newline at end of file +data class FilteringThree( + val grade : Int, + val workingPeriod: Int +) : Route \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt index 50fb5283b..f98115bc3 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt @@ -31,6 +31,7 @@ import com.terning.core.extension.noRippleClickable import com.terning.core.extension.toast import com.terning.feature.R import com.terning.feature.filtering.filtering.navigation.navigateFilteringOne +import com.terning.feature.filtering.startfiltering.navigation.navigateStartFiltering import com.terning.feature.onboarding.signup.component.SignUpProfile @Composable @@ -48,8 +49,8 @@ fun SignUpRoute( .collect { sideEffect -> when (sideEffect) { is SignUpSideEffect.ShowToast -> context.toast(sideEffect.message) - is SignUpSideEffect.NavigateToFiltering -> { - navController.navigateFilteringOne("name") + is SignUpSideEffect.NavigateToStartFiltering -> { + navController.navigateStartFiltering(signUpState.name) } } } diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpSideEffect.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpSideEffect.kt index c618f52c2..3120e6032 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpSideEffect.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpSideEffect.kt @@ -3,6 +3,6 @@ package com.terning.feature.onboarding.signup import androidx.annotation.StringRes sealed class SignUpSideEffect { - data object NavigateToFiltering : SignUpSideEffect() + data object NavigateToStartFiltering : SignUpSideEffect() data class ShowToast(@StringRes val message: Int) : SignUpSideEffect() } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt index 1ea721ad1..c9362062b 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt @@ -77,7 +77,8 @@ class SignUpViewModel @Inject constructor( fun postSignUpWithServer() { viewModelScope.launch { authRepository.postSignUp( - state.value.authId, + "3620774317", + // state.value.authId, state.value.run { SignUpRequestModel( name = name, @@ -89,7 +90,7 @@ class SignUpViewModel @Inject constructor( tokenRepository.setTokens(response.accessToken, response.refreshToken) tokenRepository.setUserId(response.userId) - _sideEffects.emit(SignUpSideEffect.NavigateToFiltering) + _sideEffects.emit(SignUpSideEffect.NavigateToStartFiltering) }.onFailure { _sideEffects.emit(SignUpSideEffect.ShowToast(R.string.server_failure)) } From cc32f7ee3ddf5bdd0b11a18d83c50ca39b2f0c65 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 20:39:58 +0900 Subject: [PATCH 09/11] =?UTF-8?q?[FEAT/#94]=20=EC=A0=84=EC=B2=B4=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/point/di/AuthInterceptor.kt | 84 ++++++++++--------- .../terning/data/service/FilteringService.kt | 2 +- .../filtering/FilteringThreeScreen.kt | 21 +++++ .../com/terning/feature/main/MainNavigator.kt | 4 +- 4 files changed, 66 insertions(+), 45 deletions(-) diff --git a/app/src/main/java/com/terning/point/di/AuthInterceptor.kt b/app/src/main/java/com/terning/point/di/AuthInterceptor.kt index a09d6154a..c1009468d 100644 --- a/app/src/main/java/com/terning/point/di/AuthInterceptor.kt +++ b/app/src/main/java/com/terning/point/di/AuthInterceptor.kt @@ -31,59 +31,61 @@ class AuthInterceptor @Inject constructor( val authRequest = if (terningDataStore.accessToken.isNotBlank()) { originalRequest.newBuilder().newAuthBuilder().build() } else { - originalRequest.newBuilder().newAuthBuilder().build() + originalRequest } val response = chain.proceed(authRequest) -// when (response.code) { -// CODE_TOKEN_EXPIRED -> { -// try { -// runBlocking { -// tokenReissueRepository.postReissueToken( -// terningDataStore.refreshToken -// ) -// }.onSuccess { data -> -// terningDataStore.apply { -// refreshToken = data.refreshToken -// } -// -// response.close() -// -// val newRequest = -// authRequest.newBuilder().removeHeader(AUTHORIZATION).newAuthBuilder() -// .build() -// -// return chain.proceed(newRequest) -// } -// } catch (t: Throwable) { -// Timber.d(t.message) -// } -// -// terningDataStore.clearInfo() -// -//// Handler(Looper.getMainLooper()).post { -//// context.stringToast(TOKEN_EXPIRED_ERROR) -//// Handler(Looper.getMainLooper()).post { -//// ProcessPhoenix.triggerRebirth( -//// context, -//// Intent(context, MainActivity::class.java) -//// ) -//// } -//// } -// } -// } + when (response.code) { + CODE_TOKEN_EXPIRED -> { + try { + runBlocking { + tokenReissueRepository.postReissueToken( + terningDataStore.refreshToken + ) + }.onSuccess { data -> + terningDataStore.apply { + refreshToken = data.refreshToken + } + + response.close() + + val newRequest = + authRequest.newBuilder().removeHeader(AUTHORIZATION).newAuthBuilder() + .build() + + return chain.proceed(newRequest) + } + } catch (t: Throwable) { + Timber.d(t.message) + } + + terningDataStore.clearInfo() + + Handler(Looper.getMainLooper()).post { + context.stringToast(TOKEN_EXPIRED_ERROR) + Handler(Looper.getMainLooper()).post { + ProcessPhoenix.triggerRebirth( + context, + Intent(context, MainActivity::class.java) + ) + } + } + } + } return response } private fun Request.Builder.newAuthBuilder() = - this.addHeader(AUTHORIZATION, "$BEARER $TEMP_TOKEN") + this.addHeader( + AUTHORIZATION, "$BEARER " + //+ "$TEMP_TOKEN" + ) companion object { private const val CODE_TOKEN_EXPIRED = 401 - // private const val TOKEN_EXPIRED_ERROR = "토큰이 만료되었어요\n다시 로그인 해주세요" + private const val TOKEN_EXPIRED_ERROR = "토큰이 만료되었어요\n다시 로그인 해주세요" private const val BEARER = "Bearer" private const val AUTHORIZATION = "Authorization" - const val TEMP_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzM4NCJ9.eyJ1c2VySWQiOjM2MjA3NzQzMTcsImlhdCI6MTcyMTIwNjM2MywiZXhwIjoxNzIzNzk3MzYzfQ.GFHHNyr3dB3B-B2Ju0aPryIKhsSaDrwCT624H0FQcevKk6gQ5MRY9obWDbY7mB0l" } } \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/service/FilteringService.kt b/data/src/main/java/com/terning/data/service/FilteringService.kt index 309041034..9dcb125e9 100644 --- a/data/src/main/java/com/terning/data/service/FilteringService.kt +++ b/data/src/main/java/com/terning/data/service/FilteringService.kt @@ -9,7 +9,7 @@ import retrofit2.http.POST interface FilteringService { @POST("/api/v1/auth/sign-up/filter") suspend fun postFilteringService( - @Header("userId") userId: Long, + @Header("User-Id") userId: Long, @Body request: FilteringRequestDto ): NonDataBaseResponse } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt index 2be6fc885..51c1a204e 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt @@ -13,16 +13,22 @@ import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import androidx.lifecycle.compose.LocalLifecycleOwner +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavController import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.component.datepicker.DatePickerUI import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.TerningTheme +import com.terning.core.extension.toast import com.terning.feature.R +import com.terning.feature.filtering.starthome.navigation.navigateStartHome import java.util.Calendar @Composable @@ -33,6 +39,11 @@ fun FilteringThreeScreen( modifier: Modifier = Modifier, viewModel: FilteringViewModel = hiltViewModel(), ) { + val state by viewModel.state.collectAsStateWithLifecycle() + + val context = LocalContext.current + val lifecycleOwner = LocalLifecycleOwner.current + val currentYear = Calendar.getInstance().get(Calendar.YEAR) val currentMonth = Calendar.getInstance().get(Calendar.MONTH) @@ -49,6 +60,16 @@ fun FilteringThreeScreen( viewModel.fetchStartMonth(chosenMonth) } + LaunchedEffect(viewModel.sideEffects, lifecycleOwner) { + viewModel.sideEffects.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle) + .collect { sideEffect -> + when (sideEffect) { + is FilteringSideEffect.NavigateToStartHome -> navController.navigateStartHome() + is FilteringSideEffect.ShowToast -> context.toast(sideEffect.message) + } + } + } + Scaffold( modifier = modifier, topBar = { diff --git a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt index 896e28c3c..1286b625b 100644 --- a/feature/src/main/java/com/terning/feature/main/MainNavigator.kt +++ b/feature/src/main/java/com/terning/feature/main/MainNavigator.kt @@ -10,10 +10,8 @@ import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController import androidx.navigation.navOptions import com.terning.feature.calendar.navigation.navigateCalendar -import com.terning.feature.filtering.filtering.navigation.FilteringOne import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.mypage.navigation.navigateMyPage -import com.terning.feature.onboarding.signin.navigation.SignIn import com.terning.feature.onboarding.signup.navigation.SignUp import com.terning.feature.search.search.navigation.navigateSearch @@ -24,7 +22,7 @@ class MainNavigator( @Composable get() = navController .currentBackStackEntryAsState().value?.destination - val startDestination = FilteringOne + val startDestination = SignUp val currentTab: MainTab? @Composable get() = MainTab.find { tab -> From 16f70036339c40a4c1ec680cf6d3ddbcebff4cc8 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 20:49:32 +0900 Subject: [PATCH 10/11] =?UTF-8?q?[FEAT/#94]=20=ED=95=84=EC=9A=94=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/onboarding/signup/SignUpViewModel.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt index c9362062b..360cb5bf5 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt @@ -77,8 +77,7 @@ class SignUpViewModel @Inject constructor( fun postSignUpWithServer() { viewModelScope.launch { authRepository.postSignUp( - "3620774317", - // state.value.authId, + state.value.authId, state.value.run { SignUpRequestModel( name = name, From 81257c46329f03f978808da59852c9dfc6a97227 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Wed, 17 Jul 2024 21:04:50 +0900 Subject: [PATCH 11/11] [DEL/#94] delete Log --- .../com/terning/feature/onboarding/signin/SignInViewModel.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt index 7ea78750d..b9002a4de 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt @@ -1,7 +1,6 @@ package com.terning.feature.onboarding.signin import android.content.Context -import android.util.Log import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.kakao.sdk.auth.model.OAuthToken @@ -79,7 +78,6 @@ class SignInViewModel @Inject constructor( accessToken: String, authType: String = KAKAO ) { - Log.d("LYB", accessToken) authRepository.postSignIn( accessToken, SignInRequestModel(authType)