attach bug
This commit is contained in:
@ -21,9 +21,20 @@ func (this *NoteService) GetNote(noteId, userId string) (note info.Note) {
|
|||||||
// 不能是已经删除了的, life bug, 客户端删除后, 竟然还能在web上打开
|
// 不能是已经删除了的, 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{}
|
||||||
|
if noteId == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
db.GetByQ(db.Notes, bson.M{"_id": bson.ObjectIdHex(noteId), "IsDeleted": false}, ¬e)
|
db.GetByQ(db.Notes, bson.M{"_id": bson.ObjectIdHex(noteId), "IsDeleted": false}, ¬e)
|
||||||
return
|
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}, ¬e)
|
||||||
|
return
|
||||||
|
}
|
||||||
// 得到blog, blogService用
|
// 得到blog, blogService用
|
||||||
// 不要传userId, 因为是公开的
|
// 不要传userId, 因为是公开的
|
||||||
func (this *NoteService) GetBlogNote(noteId string) (note info.Note) {
|
func (this *NoteService) GetBlogNote(noteId string) (note info.Note) {
|
||||||
|
Reference in New Issue
Block a user