-
Notifications
You must be signed in to change notification settings - Fork 1
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
내가 업로드한 노래 3개 가져오기 #214
내가 업로드한 노래 3개 가져오기 #214
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.
고생하셨습니다~
@@ -20,4 +20,6 @@ interface MusicApi { | |||
@GET("musics/recent-uploads") | |||
suspend fun getRecentUploads(): List<MusicResponse> | |||
|
|||
@GET("musics/my-uploads") | |||
suspend fun getMyUploads(): List<MusicResponse> |
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.
getMyUploads 는 함수명 치고, 너무 추상적인 거 같은데 getMyUploadedMusics 가 어떠신가요?
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.
getRecentUploads 도 마찬가지 맥락입니다~
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.
데이터 레이어에 대한 추상화는 repository에서 이루어져서, 여기서는 서버를 그대로 반영하려고 했어!
it.copy( | ||
myMusics = response.take(3) | ||
) |
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.
마이너 한데,
it.copy( myMusics = response.take(3) )
로 idenet 줄일 수 있으면 좋을 거 같아요 (가능하다면)
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.
코멘트 이외에는 의견 없습니당! 고생하셨어용~~ 굳굳 👏🏻
return Music( | ||
id = musicId, | ||
title = title, | ||
artist = user.nickname, | ||
imageUrl = cover | ||
) | ||
} | ||
} |
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 model 에서 data model로 변환할 때는 domain 이 data를 몰라서 클래스안에 멤버 함수로 둘 수가 없게 돼!! 그래서 두가지 방식을 일관성 있게 처리할라면 이 멤버 함수도 internal 확장함수로 두어야할 것 같아용
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.
나는 그래도 멤버함수파이긴 한데, 이거는 일단 머지해 놓고 다시 고민해볼게
|
||
private fun fetchMyMusics() { | ||
musicRepository.getMyMusics() | ||
.onEach { response -> |
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.
response 보다는 musics 로 하는게 어떨까??? response 는 데이터 레이어와 관련된 것 같은 느낌이 들어서!!!
Issue
Overview
Screenshot