-
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
[Refactor] Week6 과제 #11
base: develop
Are you sure you want to change the base?
Conversation
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.
클린 아키텍처 적용도 고생 많으셨습니다 ~
MVI도 화이팅 !!
fun UserLoginModel.toData() : UserLoginRequestDto = UserLoginRequestDto( | ||
username = this.username, | ||
password = this.password | ||
) |
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.
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 | ||
} |
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.
저와는 다르게 data 폴더와 di 폴더를 아예 구분하셨군요 ! 굿굿 좋아요 ~
@Qualifier | ||
@Retention(AnnotationRetention.BINARY) | ||
annotation class Wavve |
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.
이 부분은 혹시 어디서 쓰일까요 ?!
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.
동일한 타입의 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> | ||
} |
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.
의존성 분리 잘하셨네요 ~~ 절대 domain에서는 dto가 아닌, model을 생성해서 사용해야 한다 ! 구웃 ~
enum class HomeTabType( | ||
val text: String, | ||
) { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idle은 혹시 어떤 state를 나타내는 걸까요 ?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fold 함수를 사용하신 이유가 궁금합니다 ~!
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.
onSuccess와 onFailure에서 각 스크린에서 정의한 같은 형태의 state를 반환해주기 위해 사용했습니당
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.
전반적으로 계층분리와 Hilt적용까지 잘 해주신 것 같습니다~! MVI도 화이팅입니당!
|
||
fun UserTokenResponseDto.toDomain(): Token = Token( | ||
token = this.token | ||
) |
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.
제가 Mapper를 사용하지 않아서 데이터 변환에 많은 고생을 했는데 Mapper를 꼭 써야겠다는 생각이 드네요
@@ -0,0 +1,7 @@ | |||
package org.sopt.and.domain.model.request |
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.
파일명에 Request 용으로 사용할건지 Data Class 용도로 사용할건지 좀 더 직관적으로 적어주시면 좋을 것 같아요!
app/src/main/java/org/sopt/and/domain/model/response/UserNumber.kt
Outdated
Show resolved
Hide resolved
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.
고생하셨습니다 ~
hilt { | ||
enableAggregatingTask = false | ||
} |
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.
이거 관련해서 합세 리뷰에 적어두었으니 확인해주시면 좋을 것 같네요 ~
@@ -0,0 +1,24 @@ | |||
package org.sopt.and.domain.type | |||
|
|||
enum class HomeTabType( |
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.
domain에 위치시키신 이유가 궁금해요!
Related issue 🛠
Work Description ✏️
필수 과제
심화 과제
도전 과제
Screenshot 📸
Screen_recording_20241204_175459.mp4
Uncompleted Tasks 😅
To Reviewers 📢
합세에서 배운걸 바탕으로 과제 진행해봤습니닷