Skip to content

Commit ec90171

Browse files
authored
Merge pull request #234 from YAPP-Github/BOOK-474-feature/#232
feat: 구글 로그인 구현
2 parents 4f07099 + 56ca841 commit ec90171

20 files changed

Lines changed: 224 additions & 36 deletions

File tree

app/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ android {
3232
getByName("debug") {
3333
isDebuggable = true
3434
applicationIdSuffix = ".dev"
35-
buildConfigField("String", "GOOGLE_WEB_CLIENT_ID", getLocalProperty("DEBUG_GOOGLE_WEB_CLIENT_ID"))
3635
manifestPlaceholders += mapOf(
3736
"appName" to "@string/app_name_dev",
3837
)
@@ -43,7 +42,6 @@ android {
4342
isMinifyEnabled = true
4443
isShrinkResources = true
4544
signingConfig = signingConfigs.getByName("release")
46-
buildConfigField("String", "GOOGLE_WEB_CLIENT_ID", getLocalProperty("RELEASE_GOOGLE_WEB_CLIENT_ID"))
4745
manifestPlaceholders += mapOf(
4846
"appName" to "@string/app_name",
4947
)
@@ -55,6 +53,7 @@ android {
5553
}
5654

5755
defaultConfig {
56+
buildConfigField("String", "GOOGLE_WEB_CLIENT_ID", getLocalProperty("GOOGLE_WEB_CLIENT_ID"))
5857
buildConfigField("String", "KAKAO_NATIVE_APP_KEY", getLocalProperty("KAKAO_NATIVE_APP_KEY"))
5958
manifestPlaceholders["KAKAO_NATIVE_APP_KEY"] = getLocalProperty("KAKAO_NATIVE_APP_KEY").trim('"')
6059
}

core/common/src/main/kotlin/com/ninecraft/booket/core/common/constants/BookStatus.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ enum class BookStatus(val value: String) {
1616
}
1717
}
1818

19-
companion object Companion {
19+
companion object {
2020
fun fromValue(value: String): BookStatus? {
2121
return entries.find { it.value == value }
2222
}

core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import com.ninecraft.booket.core.model.UserState
55
import kotlinx.coroutines.flow.Flow
66

77
interface AuthRepository {
8-
suspend fun login(accessToken: String): Result<Unit>
8+
suspend fun login(
9+
providerType: String,
10+
token: String,
11+
): Result<Unit>
912

1013
suspend fun logout(): Result<Unit>
1114

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@ import com.ninecraft.booket.core.di.DataScope
1212
import dev.zacsweers.metro.SingleIn
1313
import kotlinx.coroutines.flow.map
1414

15-
private const val KAKAO_PROVIDER_TYPE = "KAKAO"
16-
1715
@SingleIn(DataScope::class)
1816
@Inject
1917
class DefaultAuthRepository(
2018
private val service: ReedService,
2119
private val tokenDataSource: TokenDataSource,
2220
) : AuthRepository {
23-
override suspend fun login(accessToken: String) = runSuspendCatching {
21+
override suspend fun login(
22+
providerType: String,
23+
token: String,
24+
) = runSuspendCatching {
2425
val response = service.login(
2526
LoginRequest(
26-
providerType = KAKAO_PROVIDER_TYPE,
27-
oauthToken = accessToken,
27+
providerType = providerType,
28+
oauthToken = token,
2829
),
2930
)
3031
saveTokens(response.accessToken, response.refreshToken)

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultNotificationDataSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DefaultNotificationDataSource(
4848
}
4949
}
5050

51-
companion object Companion {
51+
companion object {
5252
private val USER_NOTIFICATION_ENABLED = booleanPreferencesKey("USER_NOTIFICATION_ENABLED")
5353
private val LAST_SYNCED_NOTIFICATION_ENABLED = booleanPreferencesKey("LAST_SYNCED_NOTIFICATION_ENABLED")
5454
}

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultTokenDataSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class DefaultTokenDataSource(
6464
}.orEmpty()
6565
}
6666

67-
companion object Companion {
67+
companion object {
6868
private val ACCESS_TOKEN = stringPreferencesKey("ACCESS_TOKEN")
6969
private val REFRESH_TOKEN = stringPreferencesKey("REFRESH_TOKEN")
7070
}

core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/button/ButtonColorStyle.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ import com.ninecraft.booket.core.designsystem.theme.Kakao
88
import com.ninecraft.booket.core.designsystem.theme.ReedTheme
99

1010
enum class ReedButtonColorStyle {
11-
PRIMARY, SECONDARY, TERTIARY, STROKE, TEXT, KAKAO;
11+
PRIMARY, SECONDARY, TERTIARY, STROKE, TEXT, KAKAO, GOOGLE;
1212

1313
@Composable
1414
fun containerColor(isPressed: Boolean) = when (this) {
1515
PRIMARY -> if (isPressed) ReedTheme.colors.bgPrimaryPressed else ReedTheme.colors.bgPrimary
1616
SECONDARY -> if (isPressed) ReedTheme.colors.bgSecondaryPressed else ReedTheme.colors.bgSecondary
1717
TERTIARY -> if (isPressed) ReedTheme.colors.bgTertiaryPressed else ReedTheme.colors.bgTertiary
18-
STROKE -> if (isPressed) ReedTheme.colors.basePrimary else ReedTheme.colors.basePrimary
18+
STROKE -> ReedTheme.colors.basePrimary
1919
TEXT -> Color.Transparent
2020
KAKAO -> Kakao
21+
GOOGLE -> ReedTheme.colors.basePrimary
2122
}
2223

2324
@Composable
@@ -26,8 +27,9 @@ enum class ReedButtonColorStyle {
2627
SECONDARY -> ReedTheme.colors.contentPrimary
2728
TERTIARY -> ReedTheme.colors.contentBrand
2829
STROKE -> ReedTheme.colors.contentBrand
29-
TEXT -> ReedTheme.colors.borderBrand
30+
TEXT -> ReedTheme.colors.contentTertiary
3031
KAKAO -> ReedTheme.colors.contentPrimary
32+
GOOGLE -> ReedTheme.colors.contentPrimary
3133
}
3234

3335
@Composable
@@ -42,6 +44,7 @@ enum class ReedButtonColorStyle {
4244
@Composable
4345
fun borderStroke() = when (this) {
4446
STROKE -> BorderStroke(1.dp, ReedTheme.colors.borderBrand)
47+
GOOGLE -> BorderStroke(1.dp, ReedTheme.colors.borderPrimary)
4548
else -> null
4649
}
4750
}

core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Color.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ val Violet700 = Color(0xFF652EA0)
8585
val Violet800 = Color(0xFF4C1E7E)
8686
val Violet900 = Color(0xFF36125C)
8787

88-
val Kakao = Color(0xFFFBD300)
88+
val Kakao = Color(0xFFFFEB00)
8989
val Blank = Color(0xFFD6D6D6)
9090
val HomeBg = Color(0xFFF0F9E8)
9191

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ enum class RecordSort(val value: String) {
100100
}
101101
}
102102

103-
companion object Companion {
103+
companion object {
104104
fun fromValue(value: String): RecordSort? {
105105
return entries.find { it.value == value }
106106
}

feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUiState.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ enum class LibraryFilterOption(val value: String) {
8585
}
8686
}
8787

88-
companion object Companion {
88+
companion object {
8989
fun fromValue(value: String): LibraryFilterOption? {
9090
return entries.find { it.value == value }
9191
}

0 commit comments

Comments
 (0)