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