This commit is contained in:
@ -18,9 +18,10 @@ func (this *NoteService) GetNote(noteId, userId string) (note info.Note) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// fileService调用
|
// fileService调用
|
||||||
|
// 不能是已经删除了的, life bug, 客户端删除后, 竟然还能在web上打开
|
||||||
func (this *NoteService) GetNoteById(noteId string) (note info.Note) {
|
func (this *NoteService) GetNoteById(noteId string) (note info.Note) {
|
||||||
note = info.Note{}
|
note = info.Note{}
|
||||||
db.Get(db.Notes, noteId, ¬e)
|
db.GetByQ(db.Notes, bson.M{"_id": bson.ObjectIdHex(noteId), "IsDeleted": false}, ¬e)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 得到blog, blogService用
|
// 得到blog, blogService用
|
||||||
@ -238,7 +239,6 @@ func (this *NoteService) AddNote(note info.Note, fromApi bool) info.Note {
|
|||||||
|
|
||||||
// api会传IsBlog, web不会传
|
// api会传IsBlog, web不会传
|
||||||
if !fromApi {
|
if !fromApi {
|
||||||
note.PublicTime = note.UpdatedTime
|
|
||||||
// 设为blog
|
// 设为blog
|
||||||
note.IsBlog = notebookService.IsBlog(notebookId)
|
note.IsBlog = notebookService.IsBlog(notebookId)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user