attach bug

This commit is contained in:
lealife
2015-10-10 14:42:49 +08:00
parent 7e01cb8227
commit 0479f1a433

View File

@ -21,9 +21,20 @@ func (this *NoteService) GetNote(noteId, userId string) (note info.Note) {
// 不能是已经删除了的, life bug, 客户端删除后, 竟然还能在web上打开
func (this *NoteService) GetNoteById(noteId string) (note info.Note) {
note = info.Note{}
if noteId == "" {
return
}
db.GetByQ(db.Notes, bson.M{"_id": bson.ObjectIdHex(noteId), "IsDeleted": false}, &note)
return
}
func (this *NoteService) GetNoteByIdAndUserId(noteId, userId string) (note info.Note) {
note = info.Note{}
if noteId == "" || userId == "" {
return
}
db.GetByQ(db.Notes, bson.M{"_id": bson.ObjectIdHex(noteId), "UserId": bson.ObjectIdHex(userId), "IsDeleted": false}, &note)
return
}
// 得到blog, blogService用
// 不要传userId, 因为是公开的
func (this *NoteService) GetBlogNote(noteId string) (note info.Note) {