-
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.
#75 firestore 쿼리 추가 및 login flow 수정 등등
- Loading branch information
Showing
32 changed files
with
569 additions
and
183 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
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
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
64 changes: 64 additions & 0 deletions
64
app/src/main/java/com/nexters/checkareer/data/source/user/remote/dto/FbProfileDto.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,64 @@ | ||
package com.nexters.checkareer.data.source.user.remote.dto | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import com.nexters.checkareer.domain.skill.Skill | ||
import com.nexters.checkareer.domain.user.User | ||
import com.nexters.checkareer.domain.vo.LogInInfo | ||
import com.nexters.checkareer.domain.vo.Profile | ||
import com.nexters.checkareer.domain.vo.SkillTree | ||
|
||
data class FbProfileDto ( | ||
@SerializedName("user") val user: FbUserDto? = null, | ||
@SerializedName("skills") var skills: List<SkillTreeDto> = emptyList() | ||
) { | ||
fun toDomain(): Profile { | ||
return Profile( | ||
User( | ||
user!!.id, | ||
user.name, | ||
true, | ||
LogInInfo( | ||
user.email, | ||
user.photoUrl | ||
) | ||
), | ||
skills.map { | ||
SkillTree( | ||
Skill( | ||
it.skill!!.id, | ||
it.skill.name, | ||
it.skill.parentId, | ||
it.skill.layer | ||
), | ||
it.childSkills.map { child -> | ||
Skill( | ||
child.id, | ||
child.name, | ||
child.parentId, | ||
child.layer | ||
) | ||
} | ||
) | ||
} | ||
) | ||
} | ||
} | ||
|
||
data class FbUserDto( | ||
@SerializedName("id") val id: String = "", | ||
@SerializedName("name") var name: String = "", | ||
@SerializedName("email") val email: String? = null, | ||
@SerializedName("photoUrl") val photoUrl: String? = null | ||
) | ||
|
||
data class SkillTreeDto( | ||
@SerializedName("skill") val skill: SkillDto? = null, | ||
@SerializedName("childSkills") val childSkills: List<SkillDto> = emptyList() | ||
) | ||
|
||
data class SkillDto( | ||
@SerializedName("id") val id: String = "", | ||
@SerializedName("name") val name: String = "", | ||
@SerializedName("parentId") val parentId: Int? = null, | ||
@SerializedName("layer") val layer: Int = 3 | ||
) |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/nexters/checkareer/data/source/user/remote/dto/FbSnapShot.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,5 @@ | ||
package com.nexters.checkareer.data.source.user.remote.dto | ||
|
||
data class FbSnapShot<T>( | ||
val value: T | ||
) |
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
...ckareer/domain/error/ExistingUserError.kt → ...ckareer/domain/error/UserNotFoundError.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,3 +1,3 @@ | ||
package com.nexters.checkareer.domain.error | ||
|
||
class ExistingUserError() : Exception() | ||
class UserNotFoundError: Exception() |
9 changes: 5 additions & 4 deletions
9
app/src/main/java/com/nexters/checkareer/domain/skill/Skill.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
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
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.