Conversation
yskim6772
left a comment
There was a problem hiding this comment.
클린 아키텍처 적용도 고생 많으셨습니다 ~
MVI도 화이팅 !!
| fun UserLoginModel.toData() : UserLoginRequestDto = UserLoginRequestDto( | ||
| username = this.username, | ||
| password = this.password | ||
| ) No newline at end of file |
There was a problem hiding this comment.
mapper 함수 네이밍이 조금 더 자세하면 좋을 것 같아요 ~ 저는 주로 toRequestLoginDto 같은 형태를 사용한답니다
그치만 정답은 없어요 !
app/src/main/java/org/sopt/and/data/mapper/todomain/UserSignUpResponseDtoMapper.kt
Outdated
Show resolved
Hide resolved
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| abstract class DataSourceModule { | ||
| @Binds | ||
| @Singleton | ||
| abstract fun bindUserDataRemoteSource( | ||
| userDataRemoteSourceImpl: UserDataRemoteSourceImpl | ||
| ): UserDataRemoteSource | ||
| } No newline at end of file |
There was a problem hiding this comment.
저와는 다르게 data 폴더와 di 폴더를 아예 구분하셨군요 ! 굿굿 좋아요 ~
| @Qualifier | ||
| @Retention(AnnotationRetention.BINARY) | ||
| annotation class Wavve |
There was a problem hiding this comment.
동일한 타입의 retrofit 객체가 여러개여서 이를 구분하려는 용도로 사용했어요! 그런데 지금 생각해보니 과제에서는 불필요한 것 같네용
| import org.sopt.and.domain.model.request.UserLoginModel | ||
| import org.sopt.and.domain.model.request.UserSignUpModel | ||
| import org.sopt.and.domain.model.response.Hobby | ||
| import org.sopt.and.domain.model.response.Token | ||
| import org.sopt.and.domain.model.response.UserNumber | ||
|
|
||
| interface UserRepository { | ||
| suspend fun postUserSignUp(userSignUpModel: UserSignUpModel): Result<UserNumber> | ||
| suspend fun postUserLogin(userLoginModel: UserLoginModel): Result<Token> | ||
| suspend fun getUserHobby(token: String): Result<Hobby> | ||
| } No newline at end of file |
There was a problem hiding this comment.
의존성 분리 잘하셨네요 ~~ 절대 domain에서는 dto가 아닌, model을 생성해서 사용해야 한다 ! 구웃 ~
| enum class HomeTabType( | ||
| val text: String, | ||
| ) { |
There was a problem hiding this comment.
enum 좋네요 ~~ 나중에 entity가 많아진다면, domain 폴더 안에 entity 폴더를 생성해서, 그 안에 type 폴더를 만들어서 넣어놔도 좋을 것 같아요 ~
app/src/main/java/org/sopt/and/presentation/home/HomeViewModel.kt
Outdated
Show resolved
Hide resolved
| import org.sopt.and.domain.model.response.Token | ||
|
|
||
| sealed class LoginState { | ||
| data object Idle: LoginState() |
There was a problem hiding this comment.
Idle은 아직 아무런 동작도 수행되지 않은 state를 나타냅니다!
app/src/main/java/org/sopt/and/presentation/login/LoginViewModel.kt
Outdated
Show resolved
Hide resolved
| _myState.value = MyState.Loading | ||
| viewModelScope.launch { | ||
| val result = userRepository.getUserHobby(token = token) | ||
| _myState.value = result.fold( |
There was a problem hiding this comment.
onSuccess와 onFailure에서 각 스크린에서 정의한 같은 형태의 state를 반환해주기 위해 사용했습니당
yihwanggeun
left a comment
There was a problem hiding this comment.
전반적으로 계층분리와 Hilt적용까지 잘 해주신 것 같습니다~! MVI도 화이팅입니당!
|
|
||
| fun UserTokenResponseDto.toDomain(): Token = Token( | ||
| token = this.token | ||
| ) No newline at end of file |
There was a problem hiding this comment.
제가 Mapper를 사용하지 않아서 데이터 변환에 많은 고생을 했는데 Mapper를 꼭 써야겠다는 생각이 드네요
| @@ -0,0 +1,7 @@ | |||
| package org.sopt.and.domain.model.request | |||
There was a problem hiding this comment.
파일명에 Request 용으로 사용할건지 Data Class 용도로 사용할건지 좀 더 직관적으로 적어주시면 좋을 것 같아요!
app/src/main/java/org/sopt/and/domain/model/response/UserNumber.kt
Outdated
Show resolved
Hide resolved
| hilt { | ||
| enableAggregatingTask = false | ||
| } |
There was a problem hiding this comment.
이거 관련해서 합세 리뷰에 적어두었으니 확인해주시면 좋을 것 같네요 ~
| @@ -0,0 +1,24 @@ | |||
| package org.sopt.and.domain.type | |||
|
|
|||
| enum class HomeTabType( | |||
Related issue 🛠
Work Description ✏️
필수 과제
심화 과제
도전 과제
Screenshot 📸
Screen_recording_20241204_175459.mp4
Uncompleted Tasks 😅
To Reviewers 📢
합세에서 배운걸 바탕으로 과제 진행해봤습니닷