Example #1
0
        /// <summary>
        /// 获得笔记和内容
        /// </summary>
        /// <param name="noteId"></param>
        /// <param name="userId"></param>
        /// <param name="isTrach">是否垃圾</param>
        /// <param name="isDelete">是否删除</param>
        /// <param name="IsHistory">是否历史记录</param>
        /// <returns></returns>
        public static NoteAndContent GetNoteAndContent(long noteId, long userId, bool isTrach, bool isDelete, bool IsHistory)
        {
            Note        note        = GetNote(noteId, userId, isTrach, isDelete);
            NoteContent noteContent = NoteContentService.GetNoteContent(noteId, userId, IsHistory);

            return(new NoteAndContent()
            {
                note = note,
                noteContent = noteContent
            });
        }
Example #2
0
        public BlogItem GetBlogItem(Note note)
        {
            if (note == null || !note.IsBlog)
            {
                return(new BlogItem());
            }

            //内容
            var noteContent = NoteContentService.GetNoteContent(note.NoteId, note.UserId);
            // 组装成blogItem
            User user = UserService.GetUserByUserId(note.UserId);
            var  blog = new BlogItem()
            {
                Note     = note,
                Abstract = noteContent.Abstract,
                Content  = noteContent.Content,
                HasMore  = false,
                User     = user
            };

            return(blog);
        }