-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TNT-176] 트레이너, 트레이니 메인 네비게이션 기초 세팅 #64
Merged
Merged
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
fd10026
[TNT-176] remove: 불필요한 코드 제거
hoyahozz 7dd11b1
[TNT-176] refactor: 회원가입 네비게이션 로직 개선
hoyahozz ffb5898
[TNT-176] chore: feature:trainer:home 모듈 최초 생성
hoyahozz d133796
[TNT-176] chore: feature:trainee:home 모듈 최초 생성
hoyahozz ce19dc9
[TNT-176] chore: feature:trainer:main 모듈 최초 생성
hoyahozz d065755
[TNT-176] feat: 트레이너 메인 Navigation 기초 구현
hoyahozz 18e2b5e
[TNT-176] chore: feature:trainer:feedback 모듈 최초 생성
hoyahozz a015414
[TNT-176] chore: feature:trainer:members 모듈 최초 생성
hoyahozz 75c5a86
[TNT-176] chore: feature:trainer:mypage 모듈 최초 생성
hoyahozz 8804a14
[TNT-176] feat: 트레이너 임시 MainTab 구현
hoyahozz 85cf8a2
[TNT-176] chore: feature:trainee:main 모듈 최초 생성
hoyahozz b4168e0
[TNT-176] feat: 트레이니 메인 Navigation 기초 구현
hoyahozz f9fb1ef
[TNT-176] refactor: Signup NavGraph 제거
hoyahozz e00f461
[TNT-176] remove: feature:home 모듈 제거
hoyahozz 96a6d92
[TNT-176] fix: MainScreen 내 scaffold inner padding 제거
hoyahozz 55b2e66
[TNT-176] fix: apply detekt
hoyahozz 153b238
[TNT-176] fix: MainScreen 내부에서 NavController 를 생성하도록 수정
hoyahozz 6abbc60
[TNT-176] fix: clearBackStack 로직 수정
hoyahozz 2714349
[TNT-176] Merge branch 'develop' into feature/TNT-176
hoyahozz fc1e747
[TNT-176] refactor: 알람 화면 Navigation 로직 이관 처리
hoyahozz 6d47a33
[TNT-176] refactor: UserType enum 생성 및 User 클래스 분리
hoyahozz c0fc779
[TNT-176] feat: 자동 로그인 후 직군에 따라 이동 화면 지정 처리
hoyahozz 5389e6f
[TNT-176] feat: 로그인 후 직군에 따라 이동 화면 지정 처리
hoyahozz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 9 additions & 0 deletions
9
data/network/src/main/java/co/kr/data/network/model/CheckSessionResponse.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 co.kr.data.network.model | ||
|
||
import co.kr.data.network.model.enum.MemberType | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class CheckSessionResponse( | ||
val memberType: MemberType, | ||
) |
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,5 +1,7 @@ | ||
package co.kr.data.network.model | ||
|
||
import co.kr.data.network.model.enum.MemberType | ||
import co.kr.data.network.model.enum.toDomain | ||
import co.kr.tnt.domain.model.AuthType | ||
import co.kr.tnt.domain.model.LoginResult | ||
import kotlinx.serialization.Serializable | ||
|
@@ -14,6 +16,7 @@ data class LoginResponse( | |
val socialEmail: String, | ||
val socialType: AuthType, | ||
val isSignUp: Boolean, | ||
val memberType: MemberType, | ||
) | ||
|
||
fun LoginResponse.toDomain(): LoginResult = | ||
|
@@ -22,4 +25,5 @@ fun LoginResponse.toDomain(): LoginResult = | |
email = socialEmail, | ||
authType = socialType, | ||
isSignUp = isSignUp, | ||
userType = runCatching(memberType::toDomain).getOrNull(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😯👍 |
||
) |
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
18 changes: 18 additions & 0 deletions
18
data/network/src/main/java/co/kr/data/network/model/enum/MemberType.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,18 @@ | ||
package co.kr.data.network.model.enum | ||
|
||
import co.kr.tnt.domain.model.UserType | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
enum class MemberType { | ||
TRAINER, | ||
TRAINEE, | ||
UNREGISTERED, | ||
} | ||
|
||
fun MemberType.toDomain(): UserType = | ||
when (this) { | ||
MemberType.TRAINER -> UserType.TRAINER | ||
MemberType.TRAINEE -> UserType.TRAINEE | ||
MemberType.UNREGISTERED -> error("등록되지 않은 유저입니다.") | ||
} |
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
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,49 @@ | ||
package co.kr.tnt.domain.model | ||
|
||
import java.time.LocalDate | ||
|
||
sealed class User { | ||
abstract val id: String | ||
abstract val name: String | ||
abstract val image: String? | ||
|
||
data class Trainer( | ||
override val id: String, | ||
override val name: String, | ||
override val image: String?, | ||
) : User() { | ||
companion object { | ||
val EMPTY = Trainer( | ||
id = "", | ||
name = "", | ||
image = null, | ||
) | ||
} | ||
} | ||
Comment on lines
+15
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아 이런 방법이 있었군요..! |
||
|
||
data class Trainee( | ||
override val id: String, | ||
override val name: String, | ||
override val image: String?, | ||
val birthday: LocalDate?, | ||
val age: Int?, | ||
val weight: Double, | ||
val height: Int, | ||
val ptPurpose: List<String>, | ||
val caution: String?, | ||
) : User() { | ||
companion object { | ||
val EMPTY = Trainee( | ||
id = "", | ||
name = "", | ||
image = null, | ||
birthday = null, | ||
age = 0, | ||
weight = 0.0, | ||
height = 0, | ||
ptPurpose = emptyList(), | ||
caution = null, | ||
) | ||
} | ||
} | ||
} |
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,27 +1,6 @@ | ||
package co.kr.tnt.domain.model | ||
|
||
import java.time.LocalDate | ||
|
||
sealed class UserType { | ||
abstract val id: String | ||
abstract val name: String | ||
abstract val image: String? | ||
|
||
data class Trainer( | ||
override val id: String, | ||
override val name: String, | ||
override val image: String?, | ||
) : UserType() | ||
|
||
data class Trainee( | ||
override val id: String, | ||
override val name: String, | ||
override val image: String?, | ||
val birthday: LocalDate?, | ||
val age: Int?, | ||
val weight: Double, | ||
val height: Int, | ||
val ptPurpose: List<String>, | ||
val caution: String?, | ||
) : UserType() | ||
enum class UserType { | ||
TRAINER, | ||
TRAINEE, | ||
} |
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
4 changes: 2 additions & 2 deletions
4
domain/src/main/java/co/kr/tnt/domain/repository/SignUpRepository.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,9 +49,11 @@ internal class LoginViewModel @Inject constructor( | |
accessToken = accessToken, | ||
) | ||
}.onSuccess { loginResult -> | ||
if (loginResult.isSignUp) { | ||
sendEffect(LoginSideEffect.NavigateToHome) | ||
return@onSuccess | ||
loginResult.userType?.let { userType -> | ||
if (loginResult.isSignUp) { | ||
sendEffect(LoginSideEffect.NavigateToHome(userType)) | ||
return@onSuccess | ||
} | ||
} | ||
|
||
[email protected] = loginResult | ||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굿굿굿 감사합니다👍