예제 #1
0
 public Note saveNote(Note note) {
   Notebook notebook = notebookDao.findById(1L);
   note.setNotebook(notebook);
   AbstractGenerator generator = new AbstractGenerator(note.getContext());
   note.setSummary(generator.generate(100));
   note.setContext(this.saveNoteContextToStoragge(note.getContext()));
   noteDao.save(note);
   return note;
 }
예제 #2
0
 public Note getNote(Long noteId) {
   Note note = noteDao.findById(noteId);
   if (StringUtils.isNotEmpty(note.getContext())) {
     note.setContext(getNoteContextFromStoragge(note.getContext()));
     note.getNotebook();
   }
   note.getNotebook();
   return note;
 }
예제 #3
0
 public void deleteNote(Long noteId) {
   noteDao.delete(noteId);
 }
예제 #4
0
 public Long getNotesNumber(Long bookId) {
   return noteDao.findNotesNumber(bookId);
 }
예제 #5
0
 public List<Note> getNotes(Long bookId, Long startId, Integer number) {
   List<Note> notes = noteDao.findNotesByBookId(bookId, startId, number);
   return notes;
 }