Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 52 additions & 52 deletions src/app/api/endpoints/handlers/dtos/response/song_response.go
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
package response
import (
"time"
"github.com/google/uuid"
)
type SongDTO struct {
ID string `json:"id"`
Name string `json:"name"`
Artists []ArtistDTO `json:"artists"`
AlbumID *uuid.UUID `json:"album_id,omitempty"`
ReleaseDate time.Time `json:"release_date,omitempty"`
Duration int `json:"duration"`
}
func NewSongDTO(ID, Name string, Artists []ArtistDTO, AlbumID *uuid.UUID, ReleaseDate time.Time, Duration int) *SongDTO {
return &SongDTO{
ID: ID,
Name: Name,
Artists: Artists,
AlbumID: AlbumID,
ReleaseDate: ReleaseDate,
Duration: Duration,
}
}
type SongHighDTO struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
AlbumID *uuid.UUID `json:"album_id,omitempty"`
ReleaseDate time.Time `json:"release_date"`
Duration string `json:"duration"`
Lyrics *string `json:"lyrics"`
TrackNumber *int `json:"track_number"`
SpotifyURL *string `json:"spotify_url"`
}
func NewSongHighDTO(ID uuid.UUID, Name string, AlbumID *uuid.UUID,
ReleaseDate time.Time, Duration string, Lyrics, SpotifyURL *string, TrackNumber *int) *SongHighDTO {
return &SongHighDTO{
ID: ID,
Name: Name,
AlbumID: AlbumID,
ReleaseDate: ReleaseDate,
Duration: Duration,
Lyrics: Lyrics,
TrackNumber: TrackNumber,
SpotifyURL: SpotifyURL,
}
}
package response

import (
"time"

"github.com/google/uuid"
)

type SongDTO struct {
ID string `json:"id"`
Name string `json:"name"`
Artists []ArtistDTO `json:"artists"`
AlbumID string `json:"album_id,omitempty"`
ReleaseDate time.Time `json:"release_date,omitempty"`
Duration int `json:"duration"`
}

func NewSongDTO(ID, Name string, Artists []ArtistDTO, AlbumID string, ReleaseDate time.Time, Duration int) *SongDTO {
return &SongDTO{
ID: ID,
Name: Name,
Artists: Artists,
AlbumID: AlbumID,
ReleaseDate: ReleaseDate,
Duration: Duration,
}
}

type SongHighDTO struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
AlbumID *uuid.UUID `json:"album_id,omitempty"`
ReleaseDate time.Time `json:"release_date"`
Duration string `json:"duration"`
Lyrics *string `json:"lyrics"`
TrackNumber *int `json:"track_number"`
SpotifyURL *string `json:"spotify_url"`
}

func NewSongHighDTO(ID uuid.UUID, Name string, AlbumID *uuid.UUID,
ReleaseDate time.Time, Duration string, Lyrics, SpotifyURL *string, TrackNumber *int) *SongHighDTO {
return &SongHighDTO{
ID: ID,
Name: Name,
AlbumID: AlbumID,
ReleaseDate: ReleaseDate,
Duration: Duration,
Lyrics: Lyrics,
TrackNumber: TrackNumber,
SpotifyURL: SpotifyURL,
}
}
Loading