Skip to content

Commit

Permalink
Merge pull request #101 from wafflestudio/save-playlist-id
Browse files Browse the repository at this point in the history
Save playlist
  • Loading branch information
yeonsumia authored Aug 19, 2022
2 parents 7c69777 + e07a0ca commit 6832611
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ import com.wafflestudio.msns.domain.playlist.model.Playlist
import com.wafflestudio.msns.domain.track.dto.TrackResponse

class PlaylistResponse {
data class PostDetailResponse(
data class DetailResponse(
val id: Long,
val thumbnail: String,
val tracks: List<TrackResponse.PostDetailResponse>
val title: String,
val tracks: List<TrackResponse.DetailResponse>
) {
constructor(playlist: Playlist) : this(
id = playlist.id,
thumbnail = playlist.thumbnail,
tracks = playlist.tracks.map { TrackResponse.PostDetailResponse(it) }
title = playlist.title,
tracks = playlist.tracks.map { TrackResponse.DetailResponse(it) }
)
}

data class APIResponse(
val message: String,
val playlist: DetailResponse
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class PostResponse {
val title: String,
val content: String,
val createdAt: LocalDateTime?,
val playlist: PlaylistResponse.PostDetailResponse
val playlist: PlaylistResponse.DetailResponse
) {
constructor(post: Post) : this(
id = post.id,
title = post.title,
content = post.content,
createdAt = post.createdAt,
playlist = PlaylistResponse.PostDetailResponse(post.playlist)
playlist = PlaylistResponse.DetailResponse(post.playlist)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.wafflestudio.msns.domain.album.dto.AlbumResponse
import com.wafflestudio.msns.domain.playlist.model.PlaylistTrack

class TrackResponse {
data class PostDetailResponse(
data class DetailResponse(
val id: Long,
val title: String,
val album: AlbumResponse.SimpleResponse
Expand Down

0 comments on commit 6832611

Please sign in to comment.