public ActionResult _ChildComment(long?parentId) { if (!parentId.HasValue) { return(HttpNotFound()); } CommentService commentService = new CommentService(); Comment comment = commentService.Get(parentId.Value); if (comment == null) { return(HttpNotFound()); } MicroblogEntity entity = microblogService.Get(comment.CommentedObjectId); if (entity == null) { return(HttpNotFound()); } MicroblogCommentEditModel editModel = comment.AsMicroblogCommentEditModel(); editModel.OriginalAuthor = entity.Author; return(View(editModel)); }
public ActionResult _Microblog_Activity(long activityId) { Activity activity = activityService.Get(activityId); if (activity == null) { return(new EmptyResult()); } MicroblogEntity entity = microBlogService.Get(activity.SourceId); ViewData["ActivityId"] = activityId; return(View("_Microblog", entity)); }
public AssociatedInfo GetAssociatedInfo(long associateId, string tenantTypeId = "") { MicroblogService microblogService = new MicroblogService(); MicroblogEntity microblog = microblogService.Get(associateId); if (microblog != null) { IMicroblogUrlGetter urlGetter = MicroblogUrlGetterFactory.Get(microblog.TenantTypeId); return new AssociatedInfo() { DetailUrl = urlGetter.MicroblogDetail(microblog.MicroblogId), Subject = HtmlUtility.TrimHtml(microblog.GetResolvedBody(), 16) }; } return null; }
public AssociatedInfo GetAssociatedInfo(long associateId, string tenantTypeId = "") { MicroblogService microblogService = new MicroblogService(); MicroblogEntity microblog = microblogService.Get(associateId); if (microblog != null) { IMicroblogUrlGetter urlGetter = MicroblogUrlGetterFactory.Get(microblog.TenantTypeId); return(new AssociatedInfo() { DetailUrl = urlGetter.MicroblogDetail(microblog.MicroblogId), Subject = HtmlUtility.TrimHtml(microblog.GetResolvedBody(), 16) }); } return(null); }
public ActionResult Detail(string spaceKey, long microblogId) { GroupEntity group = groupService.Get(spaceKey); if (group == null) { return(HttpNotFound()); } MicroblogEntity entity = microblogService.Get(microblogId); if (entity == null) { return(HttpNotFound()); } pageResourceManager.InsertTitlePart("群组微博详细页"); ViewData["group"] = group; return(View(entity)); }
/// <summary> /// 微博详细显示页 /// </summary> /// <param name="spaceKey"></param> /// <param name="microblogId"></param> /// <param name="commentId"></param> /// <returns></returns> public string MicroblogDetail(long microblogId, long?commentId = null) { string spaceKey = string.Empty; MicroblogService microblogService = new MicroblogService(); MicroblogEntity microblog = microblogService.Get(microblogId); if (microblog == null) { return(string.Empty); } else { if (microblog.OriginalMicroblog != null) { microblog = microblog.OriginalMicroblog; if (microblog == null) { return(string.Empty); } } spaceKey = GroupIdToGroupKeyDictionary.GetGroupKey(microblog.OwnerId); } return(SiteUrls.Instance().GroupMicroblogDetail(spaceKey, microblogId, commentId)); }
/// <summary> /// 微博详细显示页 /// </summary> /// <param name="spaceKey"></param> /// <param name="microblogId"></param> /// <param name="commentId"></param> /// <returns></returns> public string MicroblogDetail(long microblogId, long? commentId = null) { string spaceKey = string.Empty; MicroblogService microblogService = new MicroblogService(); MicroblogEntity microblog = microblogService.Get(microblogId); if (microblog == null) { return string.Empty; } else { if (microblog.OriginalMicroblog != null) { microblog = microblog.OriginalMicroblog; if (microblog == null) return string.Empty; } spaceKey = GroupIdToGroupKeyDictionary.GetGroupKey(microblog.OwnerId); } return SiteUrls.Instance().GroupMicroblogDetail(spaceKey, microblogId, commentId); }
/// <summary> /// 转发微博控件 /// </summary> public ActionResult _ForwardMicroblog(string spaceKey, long microblogId) { MicroblogEntity microblogEntity = microblogService.Get(microblogId); return(View(microblogEntity)); }