@@ -7,8 +7,8 @@ import com.bff.wespot.data.remote.model.auth.response.SignUpTokenDto
7
7
import com.bff.wespot.data.remote.source.auth.AuthDataSource
8
8
import com.bff.wespot.domain.repository.auth.AuthRepository
9
9
import com.bff.wespot.domain.util.DataStoreKey
10
- import com.bff.wespot.model.auth.request.KakaoAuthToken
11
10
import com.bff.wespot.model.auth.request.RevokeReasonListDto
11
+ import com.bff.wespot.model.auth.request.SignIn
12
12
import com.bff.wespot.model.auth.request.SignUp
13
13
import kotlinx.coroutines.flow.first
14
14
import javax.inject.Inject
@@ -17,9 +17,11 @@ class AuthRepositoryImpl @Inject constructor(
17
17
private val authDataSource : AuthDataSource ,
18
18
private val dataStore : WeSpotDataStore
19
19
) : AuthRepository {
20
- override suspend fun sendKakaoToken (token : KakaoAuthToken ): Result <Any > =
21
- authDataSource
22
- .sendKakaoToken(token.toDto(dataStore.getString(DataStoreKey .PUSH_TOKEN ).first()))
20
+ override suspend fun signIn (signIn : SignIn ): Result <Any > {
21
+ val fcmToken = dataStore.getString(DataStoreKey .PUSH_TOKEN ).first()
22
+ val signInDto = signIn.toDto(fcmToken)
23
+ return authDataSource
24
+ .signIn(signInDto)
23
25
.mapCatching {
24
26
when (it) {
25
27
is AuthTokenDto -> {
@@ -33,6 +35,7 @@ class AuthRepositoryImpl @Inject constructor(
33
35
else -> throw IllegalArgumentException (" Unknown token type" )
34
36
}
35
37
}
38
+ }
36
39
37
40
override suspend fun signUp (signUp : SignUp ): Boolean {
38
41
val response = authDataSource
0 commit comments