-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/mz 150 kakao login #19
Merged
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
d7cf053
chore: Timber Tree ์ฌ๊ธฐ
yangsooplus 9e628a0
feat: kakao user sdk ์ค์
yangsooplus c7fabab
feat: SplashContract ์ ์ ํ SplashViewModel ๊ตฌํ
yangsooplus 136f96f
feat: kakao login ๊ตฌํ
yangsooplus 2570023
feat: ์์ auth api ์ธ์ฆ
yangsooplus 7001066
refactor: domain์ KakaoLoginProvider ์ธํฐํ์ด์ค ์ถ๊ฐ
yangsooplus 10497e5
fix: ์์ auth ๊ด๋ จ ๋๋ฝ ํ์ผ ์ถ๊ฐ
yangsooplus 2f08e65
fix: ์๋ชป ์
๋ ฅํ api ๋ช
์ธ ์์
yangsooplus 1af5735
fix: api ๋ณ๊ฒฝ์ ๋ฐ๋ฅธ user ํ๋กํผํฐ ๋ณ๊ฒฝ
yangsooplus 5c04416
feat: SplashViewModel ์์ ํ ํฐ ๋ก์ง ์ถ๊ฐ
yangsooplus f7cdfbd
refactor: TokenRepository ์ ์ฅ ์ ํ๋ผ๋ฏธํฐ๋ก Token ์ฌ์ฉ
yangsooplus a08f9d7
chore: AuthRepository.kt -> AuthRepositoryImpl.kt rename
yangsooplus 323935e
chore: KakaoLoginProvider.kt -> KakaoLoginProviderImpl.kt rename
yangsooplus 732dba5
feat: LoginContract, LoginViewModel ์ถ๊ฐ
yangsooplus e6ae3c3
feat: Kakao di Module ์ถ๊ฐ
yangsooplus 0a42e76
chore: feature plugin์ hilt.navigation.compose ์์กด์ฑ ์ถ๊ฐ
yangsooplus 230df72
fix: Repository di ๋ถ๊ฐ ์ค๋ฅ ํด๊ฒฐ
yangsooplus 2b9d07e
feat: ์นด์นด์ค accessToken ์ ๊ทผ ์ฝ๋ ์ถ๊ฐ
yangsooplus 2972865
refactor: Splash์ Login์ Login์ ํตํฉ
yangsooplus 765bc7f
fix: Authenticator๋ฅผ token ์ฌ๋ฐํ์ authRepository๋ก ์ด๋ํจ์ ๋ฐ๋ผ ์์
yangsooplus 9e17f10
feat: ๊ธฐ๋ฅ ํ
์คํธ UI ์ถ๊ฐ
yangsooplus 5f72d06
fix: hilt ์ํ ์ฐธ์กฐ ์ ๊ฑฐ
yangsooplus 6960045
chore: ์นด์นด์ค ๋ก๊ทธ์ธ ํ
์คํธ์ฉ ๋ก๊ทธ ์ถ๊ฐ
yangsooplus 7a2867e
fix: api ๋ช
์ธ ํ์ ํ๋ฆฐ ๋ถ๋ถ ์์
yangsooplus 5bcd5dd
fix: ActivityContext๊ฐ ํ์ํ ๋ก๊ทธ์ธ ๋์์ ๋ถ๋ฆฌ
yangsooplus cebb823
fix: token ์ ์ฅ์ ์๋ฃํ ๋๊น์ง ๋๊ธฐ
yangsooplus 7f09a87
refactor: encrpted-datastore๋ก ๊ต์ฒด
yangsooplus 2cc691a
fix: kakao token ๋ง๋ฃ ์ฒดํฌ ํ ์์ ๋ก๊ทธ์ธ ์๋ํ๋๋ก ์์
yangsooplus 5d533b9
feat: ApiService์ ์์ ํ์ ํํด ์ถ๊ฐ
yangsooplus ca2e3f5
feat: login, signup nested navigation ์ง์
yangsooplus 286ac14
fix: ์์ ํ ํฐ ํค๋ ํ์ ์์
yangsooplus 2c8aad0
feat: ๊ธฐ๋ฅ ํ
์คํธ๋ฅผ ์ํ ์์ UI ์ฝ๋
yangsooplus 04d9e01
chore: hilt-navigation-compose ์์กด์ฑ ์์น ๋ณ๊ฒฝ
yangsooplus 1a7748d
chore: kakao sdk ๊ด๋ จ ํ์ผ social ํจํค์ง๋ก ์ด๋
yangsooplus 08dde4e
chore: ๊ธฐ์กด ์ํธํ DataStore ์ฝ๋ ์ญ์
yangsooplus 076999a
chore: detekt ํ์ ๋ง์ถค
yangsooplus 98c82af
chore: gitignore์ report, google-service.json ์ถ๊ฐ
yangsooplus 3d4db6c
chore: ktlint trailing comma check
yangsooplus 66a84c9
chore: ktlint Import order check
yangsooplus 3a3a014
chore: local.properties๋ก ์นด์นด์ค ์ฑ ํค ์ด๋
yangsooplus 74f23eb
fix: mergeํ๋ฉฐ ๋๋ฝ๋ plugin ๋ณต๊ตฌ
yangsooplus 1dc7860
feat: LoggingInterceptor level ์ค์ ๋ฐ di
yangsooplus 84df3e7
refactor: kakao sdk ์ฑ๊ธํค ๊ต์ฒด ๋ฐ di ์ฝ๋ ์ญ์
yangsooplus 2e18684
refactor: NetworkModule์์ service ๋ถ๋ฆฌ
yangsooplus af6d54f
refactor: Service ๋ค์ด๋ฐ ์์
yangsooplus 5d585ab
chore: Contract ํ์
class -> sealed interface
yangsooplus 6128d67
chore: sns -> oauth ๋ค์ด๋ฐ ๋ณ๊ฒฝ
yangsooplus 9f16e97
chore: gitignore์ idea ํด๋ ์ถ๊ฐ
yangsooplus 67a4348
refactor: TokenEntity -> TokenResponse ๋ค์ด๋ฐ ๋ณ๊ฒฝ๊ณผ ์ ํจ๊ธฐ๊ฐ ํ๋กํผํฐ ์ ๊ฑฐ
yangsooplus 449c04c
refactor: UserEntity -> UserRequest
yangsooplus 4ad776b
refactor: AuthRepository๋ฅผ Login๊ณผ SignUp์ผ๋ก ๋ถ๋ฆฌ
yangsooplus 722b085
refactor: ๋ก๊ทธ์ธ/ํ์๊ฐ์
๋์ ๊ด๋ จ Usecase ์ถ๊ฐ
yangsooplus 60675d5
feat: SplashScreen Api ์ ์ฉ
yangsooplus 5f5b40e
feat: ์ฑ ์คํ ๋ฐ์ดํฐ ์์
์ค์ SplashScreen์ ๊ณ์ ๋ณด์ด๋๋ก ์ค์
yangsooplus e21b8a0
feat: Splash๋ฅผ ๋ณด์ฌ์ฃผ๊ณ ๋ ๋ค, ์ ์ ๋ฐ์ดํฐ์ ๋ฐ๋ผ ํ๋ฉด ์ด๋
yangsooplus 8928f59
refactor: TestScreen์ ๋์์ MyPage๋ก ์ฎ๊น
yangsooplus 846ade5
feat: ์นด์นด์ค ๋ก๊ทธ์ธ ํ ํ์๊ฐ์
์ดํ ์ ์ ๋ ํ์๊ฐ์
ํ๋ฉด์ผ๋ก ์ด๋
yangsooplus d4e1d00
chore: detekt๊ฐ apiKey๋ฅผ ๋ถ๋ฌ์ฌ ๋ null check ๋ฌด์
yangsooplus d0c87bb
fix: ์นด์นด์ค๊ณ์ ๋ก๊ทธ์ธ ํ ์งํ ์๋๋ ๋ฌธ์ ์์
yangsooplus d6f69ac
chore: detekt ์์ ์ฌํญ ๋ฐ์
yangsooplus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
16 changes: 16 additions & 0 deletions
16
domain/src/main/java/com/susu/domain/usecase/LogoutUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.susu.domain.usecase | ||
|
||
import com.susu.core.common.runCatchingIgnoreCancelled | ||
import com.susu.domain.repository.LoginRepository | ||
import com.susu.domain.repository.TokenRepository | ||
import javax.inject.Inject | ||
|
||
class LogoutUseCase @Inject constructor( | ||
private val loginRepository: LoginRepository, | ||
private val tokenRepository: TokenRepository, | ||
) { | ||
suspend operator fun invoke() = runCatchingIgnoreCancelled { | ||
loginRepository.logout() | ||
tokenRepository.deleteTokens() | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
domain/src/main/java/com/susu/domain/usecase/WithdrawUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.susu.domain.usecase | ||
|
||
import com.susu.core.common.runCatchingIgnoreCancelled | ||
import com.susu.domain.repository.LoginRepository | ||
import com.susu.domain.repository.TokenRepository | ||
import javax.inject.Inject | ||
|
||
class WithdrawUseCase @Inject constructor( | ||
private val loginRepository: LoginRepository, | ||
private val tokenRepository: TokenRepository, | ||
) { | ||
suspend operator fun invoke() = runCatchingIgnoreCancelled { | ||
loginRepository.withdraw() | ||
tokenRepository.deleteTokens() | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
feature/loginsignup/src/main/java/com/susu/feature/loginsignup/VoteScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.susu.feature.loginsignup | ||
|
||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
fun VoteScreen( | ||
navigateToLogin: () -> Unit | ||
) { | ||
Button(onClick = navigateToLogin) { | ||
Text("๋์ถฉ ํ์๊ฐ์ ํฌํ") | ||
} | ||
} |
This file contains 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 bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
feature/loginsignup/src/main/java/com/susu/feature/loginsignup/test/TestContract.kt
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
feature/loginsignup/src/main/java/com/susu/feature/loginsignup/test/TestScreen.kt
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
feature/loginsignup/src/main/java/com/susu/feature/loginsignup/test/TestViewModel.kt
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
feature/mypage/src/main/java/com/susu/feature/mypage/MyPageContract.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.susu.feature.mypage | ||
|
||
import com.susu.core.ui.base.SideEffect | ||
import com.susu.core.ui.base.UiState | ||
|
||
interface MyPageContract { | ||
sealed class MyPageEffect : SideEffect { | ||
data object NavigateToLogin : MyPageEffect() | ||
data class ShowToast(val msg: String) : MyPageEffect() | ||
} | ||
|
||
object MyPageState : UiState | ||
} |
34 changes: 29 additions & 5 deletions
34
feature/mypage/src/main/java/com/susu/feature/mypage/MyPageScreen.kt
This file contains 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,52 @@ | ||
package com.susu.feature.mypage | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import androidx.hilt.navigation.compose.hiltViewModel | ||
import com.susu.core.designsystem.theme.SusuTheme | ||
|
||
@Composable | ||
fun MyPageScreen( | ||
padding: PaddingValues, | ||
viewModel: MyPageViewModel = hiltViewModel(), | ||
navigateToLogin: () -> Unit, | ||
) { | ||
Text( | ||
modifier = Modifier.padding(padding), | ||
text = "๋ง์ด ํ์ด์ง", | ||
) | ||
LaunchedEffect(key1 = viewModel.sideEffect) { | ||
viewModel.sideEffect.collect { sideEffect -> | ||
when (sideEffect) { | ||
MyPageContract.MyPageEffect.NavigateToLogin -> navigateToLogin() | ||
is MyPageContract.MyPageEffect.ShowToast -> { | ||
//TODO: UI ์์ ์ ์๋ฌ ๋ฉ์ธ์ง ํ์ | ||
navigateToLogin() | ||
} | ||
} | ||
} | ||
} | ||
|
||
Column { | ||
Button(onClick = viewModel::logout) { | ||
Text(text = "๋ก๊ทธ์์") | ||
} | ||
Button( | ||
onClick = viewModel::withdraw, | ||
) { | ||
Text(text = "ํํด") | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun MyPageScreenPreview() { | ||
SusuTheme { | ||
MyPageScreen(padding = PaddingValues(0.dp)) | ||
MyPageScreen(padding = PaddingValues(0.dp)) {} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
feature/mypage/src/main/java/com/susu/feature/mypage/MyPageViewModel.kt
This file contains 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,45 @@ | ||
package com.susu.feature.mypage | ||
|
||
import androidx.lifecycle.viewModelScope | ||
import com.kakao.sdk.user.UserApiClient | ||
import com.susu.core.ui.base.BaseViewModel | ||
import com.susu.domain.usecase.LogoutUseCase | ||
import com.susu.domain.usecase.WithdrawUseCase | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.launch | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class MyPageViewModel @Inject constructor( | ||
private val logoutUseCase: LogoutUseCase, | ||
private val withdrawUseCase: WithdrawUseCase, | ||
) : BaseViewModel<MyPageContract.MyPageState, MyPageContract.MyPageEffect>(MyPageContract.MyPageState) { | ||
|
||
fun logout() { | ||
UserApiClient.instance.logout { error -> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ์ ๋ค์ ๋ณด๋ UserApiClient ๊ด๋ จ ์ฝ๋๋ง Screen ์ชฝ์์ ์คํํ๋ค๋ฉด ์์กด์ฑ ์ ๊ฑฐ ๊ฐ๋ฅํ ๊ฑฐ๊ฐ์์ |
||
if (error != null) { | ||
postSideEffect(MyPageContract.MyPageEffect.ShowToast(error.message ?: "์๋ฌ ๋ฐ์ํ์ง๋ง ํ ํฐ์ ์ญ์ ๋จ")) | ||
} else { | ||
viewModelScope.launch { | ||
logoutUseCase().onSuccess { | ||
postSideEffect(MyPageContract.MyPageEffect.NavigateToLogin) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
fun withdraw() { | ||
UserApiClient.instance.unlink { error -> | ||
if (error != null) { | ||
postSideEffect(MyPageContract.MyPageEffect.ShowToast(error.message ?: "์๋ฌ ๋ฐ์ํ์ง๋ง ํ ํฐ์ ์ญ์ ๋จ")) | ||
} else { | ||
viewModelScope.launch { | ||
withdrawUseCase().onSuccess { | ||
postSideEffect(MyPageContract.MyPageEffect.NavigateToLogin) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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 bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์กฐ๊ธ ๋ณต์กํ์ง๋ง callback ํ์์ผ๋ก ๋ง๋ค๋ฉด kakao sdk ์์กด์ฑ ์ ๊ฑฐ ๊ฐ๋ฅํ์ง ์์๋ ค๋์?
์นด์นด์ค sdk ์์กด์ฑ์ด viewmodel์ ์์ผ๋ฉด ๋์ค์ ํ ์คํธ ์ฝ๋ ์ง๊ธฐ๊ฐ ์ด๋ ค์ธ ๊ฒ ๊ฐ์์. ๋ฌผ๋ก ์ด ํ๋ก์ ํธ์์ ํ ์คํธ์ฝ๋๋ฅผ ์ง์ง ์์ํ ์ง๋ง ํ ์คํธ ์ฝ๋ ์์ฑ์ด ์ ๋ฆฌํ๊ฒ ViewModel์ ๋ง๋๋ ์ฐ์ต์ ํด๋ณด๋ฉด ์ด๋จ๊น ํ๋ ์๊ฐ์ ๋๋ค!