Skip to content
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

Merged
merged 3 commits into from
Nov 18, 2024
Merged

HotelRoomDetailUseCase 추가 및 리팩토링 #28

merged 3 commits into from
Nov 18, 2024

Conversation

ksw4015
Copy link
Collaborator

@ksw4015 ksw4015 commented Nov 15, 2024

변경사항

  • GetHotelRoomDetailUseCase가 추가되었습니다.
  • Domain Layer에 HotelDetail, HotelRoomDetail Model Class가 추가되었습니다.
  • GetDetailInfo가 GetHotelDetail로 이름이 변경되었습니다. (반복정보 API는 숙박 카테고리에서만 사용하기 때문입니다.)
  • Hotel Type 상수가 추가되었습니다.

@ksw4015 ksw4015 added the detail hotel develop detail screen for hotel category label Nov 15, 2024
@ksw4015 ksw4015 requested a review from f-lab-Toru November 15, 2024 01:59
@ksw4015 ksw4015 self-assigned this Nov 15, 2024
Copy link

@f-lab-Toru f-lab-Toru left a 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(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

방 정보에서 이미지가 없는 경우를 대비해서 roomImages 만 빈 리스트로 디폴트값을 만들어 준 걸까요? :)

Copy link
Collaborator Author

@ksw4015 ksw4015 Nov 17, 2024

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 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

나쁘지 않습니다만 왠지 이걸 메서드로 하나 뺄 수도 있을 거 같긴 합니다.
parameter 로는 varargs 를 넣어 주면 여러개를 받을 수 있지 않을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

조언해주신대로 함수로 빼봤습니다.

@ksw4015 ksw4015 merged commit bcc80e0 into main Nov 18, 2024
1 check failed
@ksw4015 ksw4015 deleted the feature/27 branch November 25, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detail hotel develop detail screen for hotel category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants