-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT]#30: KakaoLogin idtoken을 서버에 보내요
- Loading branch information
1 parent
68ffea7
commit 12147ff
Showing
14 changed files
with
106 additions
and
10 deletions.
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
6 changes: 6 additions & 0 deletions
6
core/model/src/main/kotlin/com/bff/wespot/model/auth/response/AuthToken.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,6 @@ | ||
package com.bff.wespot.model.auth.response | ||
|
||
data class AuthToken( | ||
val accessToken: String, | ||
val refreshToken: String, | ||
) |
9 changes: 9 additions & 0 deletions
9
core/network/src/main/kotlin/com/bff/wespot/network/model/auth/request/KakaoAuthTokenDto.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,9 @@ | ||
package com.bff.wespot.network.model.auth.request | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class KakaoAuthTokenDto( | ||
val socialType: String, | ||
val identityToken: String, | ||
) |
15 changes: 15 additions & 0 deletions
15
core/network/src/main/kotlin/com/bff/wespot/network/model/auth/response/AuthTokenDto.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,15 @@ | ||
package com.bff.wespot.network.model.auth.response | ||
|
||
import com.bff.wespot.model.auth.response.AuthToken | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class AuthTokenDto( | ||
val accessToken: String, | ||
val refreshToken: String, | ||
) { | ||
fun toAuthToken() = AuthToken( | ||
accessToken = accessToken, | ||
refreshToken = refreshToken, | ||
) | ||
} |
4 changes: 2 additions & 2 deletions
4
...ff/wespot/network/model/auth/SchoolDto.kt → .../network/model/auth/response/SchoolDto.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
2 changes: 1 addition & 1 deletion
2
...espot/network/model/auth/SchoolListDto.kt → ...work/model/auth/response/SchoolListDto.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
5 changes: 4 additions & 1 deletion
5
core/network/src/main/kotlin/com/bff/wespot/network/source/auth/AuthDataSource.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,7 +1,10 @@ | ||
package com.bff.wespot.network.source.auth | ||
|
||
import com.bff.wespot.network.model.auth.SchoolListDto | ||
import com.bff.wespot.network.model.auth.request.KakaoAuthTokenDto | ||
import com.bff.wespot.network.model.auth.response.AuthTokenDto | ||
import com.bff.wespot.network.model.auth.response.SchoolListDto | ||
|
||
interface AuthDataSource { | ||
suspend fun getSchoolList(search: String): Result<SchoolListDto> | ||
suspend fun sendKakaoToken(token: KakaoAuthTokenDto): Result<AuthTokenDto> | ||
} |
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
10 changes: 10 additions & 0 deletions
10
data/src/main/kotlin/com/bff/wespot/data/mapper/auth/AuthMapper.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,10 @@ | ||
package com.bff.wespot.data.mapper.auth | ||
|
||
import com.bff.wespot.model.auth.request.KakaoAuthToken | ||
import com.bff.wespot.network.model.auth.request.KakaoAuthTokenDto | ||
|
||
internal fun KakaoAuthToken.toDto() = | ||
KakaoAuthTokenDto( | ||
socialType = socialType, | ||
identityToken = idToken ?: "", | ||
) |
22 changes: 22 additions & 0 deletions
22
data/src/main/kotlin/com/bff/wespot/data/repository/DataStoreRepositoryImpl.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,22 @@ | ||
package com.bff.wespot.data.repository | ||
|
||
import com.bff.wespot.data.local.WeSpotDataStore | ||
import com.bff.wespot.domain.repository.DataStoreRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class DataStoreRepositoryImpl @Inject constructor( | ||
private val dataStore: WeSpotDataStore | ||
) : DataStoreRepository { | ||
override suspend fun saveString(key: String, value: String) = | ||
dataStore.saveString(key, value) | ||
|
||
override fun getString(key: String): Flow<String> = | ||
dataStore.getString(key) | ||
|
||
override suspend fun saveBoolean(key: String, value: Boolean) = | ||
dataStore.saveBoolean(key, value) | ||
|
||
override fun getBoolean(key: String): Flow<Boolean> = | ||
dataStore.getBoolean(key) | ||
} |
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
5 changes: 4 additions & 1 deletion
5
domain/src/main/kotlin/com/bff/wespot/domain/repository/auth/AuthRepository.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,7 +1,10 @@ | ||
package com.bff.wespot.domain.repository.auth | ||
|
||
import com.bff.wespot.model.auth.School | ||
import com.bff.wespot.model.auth.request.KakaoAuthToken | ||
import com.bff.wespot.model.auth.response.AuthToken | ||
import com.bff.wespot.model.auth.response.School | ||
|
||
interface AuthRepository { | ||
suspend fun getSchoolList(search: String): Result<List<School>> | ||
suspend fun sendKakaoToken(token: KakaoAuthToken): Result<AuthToken> | ||
} |
2 changes: 1 addition & 1 deletion
2
domain/src/main/kotlin/com/bff/wespot/domain/repository/auth/KakaoLoginManager.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