コード例 #1
0
 @PUT
 @Path("/{noteid}")
 public void updateNote(@PathParam("noteid") int noteID, NoteEntity newNote) {
   UserEntity user = new UserEntity();
   user.setEmail(email);
   newNote.setUser(user);
   notesService.verifyAndUpdateNote(email, noteID, newNote);
 }
コード例 #2
0
 @GET
 public List<Note> getAllNotesByUser() {
   List<NoteEntity> noteEntityList = notesService.getAllNotesByUser(email);
   List<Note> noteList = new ArrayList<Note>();
   for (NoteEntity notes : noteEntityList) {
     Note note = new Note(notes);
     note.getLinks().add(new LinkReference("self", "/users/" + email + "/" + note.getNoteId()));
     note.getLinks().add(new LinkReference("owner", "/users/" + email));
     noteList.add(note);
   }
   return noteList;
 }
コード例 #3
0
 @DELETE
 @Path("/{noteid}")
 public void deleteNote(@PathParam("noteid") int noteID) {
   notesService.verifyAndRemoveNote(email, noteID);
 }
コード例 #4
0
 @DELETE
 public void removeAllNotes() {
   notesService.removeAllNotes(email);
 }
コード例 #5
0
 @POST
 public void addNote(NoteEntity notes) {
   notesService.addNoteForUser(email, notes);
 }