Skip to content

Commit

Permalink
rename: song resonse auditing
Browse files Browse the repository at this point in the history
  • Loading branch information
jbj338033 committed Aug 2, 2024
1 parent 936a7aa commit 29fe971
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.open3r.openmusic.domain.song.domain.entity.SongEntity
import com.open3r.openmusic.domain.song.domain.enums.SongGenre
import com.open3r.openmusic.domain.user.domain.entity.UserEntity
import com.open3r.openmusic.domain.user.dto.response.UserResponse
import java.time.LocalDateTime

data class SongResponse(
val id: Long,
Expand All @@ -18,7 +19,9 @@ data class SongResponse(
val scope: AlbumScope,
val artist: UserResponse,
val lyrics: List<SongLyricsResponse>,
val album: SongAlbumResponse
val album: SongAlbumResponse,
val createdAt: LocalDateTime,
val updatedAt: LocalDateTime
) {
companion object {
fun of(song: SongEntity, user: UserEntity? = null) = SongResponse(
Expand All @@ -33,7 +36,9 @@ data class SongResponse(
thumbnailUrl = song.album.coverUrl,
artist = UserResponse.of(song.artist),
lyrics = song.lyrics.map { SongLyricsResponse.of(it) },
album = SongAlbumResponse.of(song.album)
album = SongAlbumResponse.of(song.album),
createdAt = song.createdAt!!,
updatedAt = song.updatedAt!!
)
}
}

0 comments on commit 29fe971

Please sign in to comment.