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