@DELETE @Path("/list/{id}") public void deletePlaylist(@PathParam("id") final int id) { playlistDAO.delete(id); }
@PUT @Path("/name/{id}/{name}") public void changePlaylistName( @PathParam("id") final int id, @PathParam("name") final String name) { playlistDAO.update(id, name); }
@POST @Consumes(MediaType.APPLICATION_JSON) public void addPlaylist(Playlist playlist) { playlistDAO.insert(playlist.getOwner(), playlist.getName()); }
@GET @Path("/id/{id}") @Produces(MediaType.APPLICATION_JSON) public Playlist getPlaylistById(@PathParam("id") final int id) { return playlistDAO.findPlaylistById(id); }
@GET @Path("/owner/{owner}") @Produces(MediaType.APPLICATION_JSON) public List<Playlist> getPlaylistByOwner(@PathParam("owner") final String owner) { return playlistDAO.findPlaylistByOwner(owner); }
@GET @Produces(MediaType.APPLICATION_JSON) public List<Playlist> getAllPlaylists() { return playlistDAO.findAllPlaylists(); }