attachment feature

This commit is contained in:
life
2014-09-21 22:05:04 +08:00
parent ab242b10f2
commit c556ab59b5
26 changed files with 1197 additions and 135 deletions

@ -53,7 +53,15 @@ func (this *TrashService) recoverNote(noteId, notebookId, userId string) bool {
// 删除trash
func (this *TrashService) DeleteTrash(noteId, userId string) bool {
return db.DeleteByIdAndUserId(db.Notes, noteId, userId)
// delete note's attachs
ok := attachService.DeleteAllAttachs(noteId, userId)
// delete note
ok = db.DeleteByIdAndUserId(db.Notes, noteId, userId)
// delete content
ok = db.DeleteByIdAndUserId(db.NoteContents, noteId, userId)
return ok
}
// 列出note, 排序规则, 还有分页