This API manages playlists and songs within the Passon project. It provides endpoints for handling CRUD operations on both songs and playlists, with relationships between songs and playlists managed through a many-to-many relationship using a junction table PlaylistXSong.
-
ListPlaylists
GET /api/playlists/ListPlaylists
Retrieves a list of all playlists with their details. -
FindPlaylist
GET /api/playlists/FindPlaylist/{id}
Retrieves a specific playlist by its ID. -
AddPlaylist
POST /api/playlists/AddPlaylist
Creates a new playlist. -
UpdatePlaylist
PUT /api/playlists/UpdatePlaylist/{id}
Updates an existing playlist by its ID. -
DeletePlaylist
DELETE /api/playlists/DeletePlaylist/{id}
Deletes a playlist by its ID. -
ListSongsForPlaylist
GET /api/playlists/ListSongsForPlaylist/{playlistId}
Retrieves a list of songs for a specific playlist, including song details like title, artist, release date, and added date to the playlist.
-
ListSongs
GET /api/songs/listSongs
Retrieves a list of all songs with their associated playlists and the date added to each playlist. -
FindSong
GET /api/songs/FindSong/{id}
Retrieves a specific song by its ID, along with its associated playlists and added dates. -
AddSong
POST /api/songs/AddSong
Creates a new song. -
UpdateSong
PUT /api/songs/UpdateSong/{id}
Updates an existing song by its ID. -
DeleteSong
DELETE /api/songs/DeleteSong/{id}
Deletes a song by its ID.
-
Playlists
Playlists are collections of songs. Each playlist has a name, description, and creation date. -
Songs
Each song has a title, artist, genre, and release date. -
PlaylistXSong
This is the junction table that connects playlists and songs, representing the many-to-many relationship between them. It also stores the date when the song was added to the playlist.
-
PlaylistDTO
Represents a playlist, including its ID, name, description, and creation date. -
SongDTO
Represents a song, including its ID, title, artist, genre, release date, and playlist details (name and added date). -
PlaylistSongDetailDTO
Represents the details of a song in a playlist, including the playlist name and the date the song was added.
- Bad Request (400): If the request data is invalid, such as missing fields or mismatched IDs.
- Not Found (404): If the requested resource (playlist or song) doesn't exist.
- No Content (204): When a resource is successfully deleted or updated without returning any content.
- Backend: ASP.NET Core Web API
- Database: Entity Framework Core (EF Core) with a SQL Server or other relational database
- Language: C#
- Clone the repository.
- Set up the database connection in the
appsettings.jsonfile. - Run database migrations to ensure the necessary tables are created.
- Start the application using
dotnet run.
Feel free to fork the project, submit pull requests, or open issues if you encounter any problems or have suggestions for improvements.