-
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
HotelRoomDetailUseCase 추가 및 리팩토링 #28
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.
잘하셨습니다.
이번주에 올린 PR 들을 멘토링 때 같이 한번 짧게 이야기해 볼까요
val roomInternet: String, | ||
val roomRefrigerator: String, | ||
val roomHairdryer: String, | ||
val roomImages: List<String> = emptyList(), |
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.
방 정보에서 이미지가 없는 경우를 대비해서 roomImages
만 빈 리스트로 디폴트값을 만들어 준 걸까요? :)
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에서 List를 Filter하는 과정에서 Match되는 값이 없으면 Null 반환인 줄 알고 빈 리스트를 디폴트로 넣어놨는데,
filterNot 함수를 살펴보니 Match되는 값이 없으면 빈 List를 반환하는 것 같네요. emptyList()
는 지워도 될 것 같습니다.
) | ||
|
||
fun DetailInfoDTO.toHotelRoomDetail(): HotelRoomDetail { | ||
val images = listOf(roomImg1, roomImg2, roomImg3, roomImg4, roomImg5).filterNot { |
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.
나쁘지 않습니다만 왠지 이걸 메서드로 하나 뺄 수도 있을 거 같긴 합니다.
parameter 로는 varargs 를 넣어 주면 여러개를 받을 수 있지 않을까요?
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.
조언해주신대로 함수로 빼봤습니다.
변경사항