File tree Expand file tree Collapse file tree 4 files changed +21
-5
lines changed
data/src/main/java/com/whyranoid/data/model
domain/src/main/java/com/whyranoid/domain/model
src/main/java/com/whyranoid Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ import com.whyranoid.domain.model.User
6
6
7
7
data class UserResponse (
8
8
val uid : String = " " ,
9
- val name : String = " " ,
10
- val profileUrl : String = " " ,
9
+ val name : String? = " " ,
10
+ val profileUrl : String? = " " ,
11
11
val joinedGroupList : List <String > = emptyList()
12
12
)
13
13
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ package com.whyranoid.domain.model
2
2
3
3
data class User (
4
4
val uid : String ,
5
- val name : String ,
6
- val profileUrl : String
5
+ val name : String? ,
6
+ val profileUrl : String?
7
7
)
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ android {
43
43
dependencies {
44
44
45
45
implementation project(" :presentation" )
46
+ implementation project(" :data" )
46
47
47
48
implementation " androidx.core:core-ktx:$coreKtxVersion "
48
49
implementation " androidx.appcompat:appcompat:$appcompatVersion "
@@ -59,6 +60,7 @@ dependencies {
59
60
implementation platform(" com.google.firebase:firebase-bom:$firebaseVersion " )
60
61
implementation " com.google.firebase:firebase-auth-ktx"
61
62
implementation " com.google.android.gms:play-services-auth:$playServicesAuthVersion "
63
+ implementation " com.google.firebase:firebase-firestore-ktx"
62
64
63
65
// splash
64
66
implementation " androidx.core:core-splashscreen:$splashVersion "
Original file line number Diff line number Diff line change @@ -4,10 +4,13 @@ import androidx.datastore.core.DataStore
4
4
import androidx.datastore.preferences.core.Preferences
5
5
import androidx.datastore.preferences.core.edit
6
6
import androidx.datastore.preferences.core.stringPreferencesKey
7
+ import com.google.firebase.firestore.FirebaseFirestore
8
+ import com.whyranoid.data.model.UserResponse
7
9
import javax.inject.Inject
8
10
9
11
class SignInDataSourceImpl @Inject constructor(
10
- private val dataStoreDb : DataStore <Preferences >
12
+ private val dataStoreDb : DataStore <Preferences >,
13
+ private val fireBaseDb : FirebaseFirestore
11
14
) : SignInDataSource {
12
15
13
16
private object PreferenceKeys {
@@ -24,6 +27,17 @@ class SignInDataSourceImpl @Inject constructor(
24
27
preferences[PreferenceKeys .nickName] = userInfo.nickName ? : EMPTY_STRING
25
28
preferences[PreferenceKeys .profileImgUri] = userInfo.profileImgUri ? : EMPTY_STRING
26
29
}
30
+
31
+ fireBaseDb.collection(" Users" )
32
+ .document(userInfo.uid).set(
33
+ UserResponse (
34
+ userInfo.uid,
35
+ userInfo.nickName,
36
+ userInfo.profileImgUri,
37
+ emptyList()
38
+ )
39
+ )
40
+
27
41
return true
28
42
}
29
43
You can’t perform that action at this time.
0 commit comments