Ejemplo n.º 1
0
        /// <summary>
        /// 获取评论的详细显示Url
        /// </summary>
        /// <returns></returns>
        public string GetCommentDetailUrl()
        {
            ICommentUrlGetter urlGetter = CommentUrlGetterFactory.Get(this.TenantTypeId);

            if (urlGetter != null)
            {
                return(urlGetter.GetCommentDetailUrl(this.CommentedObjectId, this.Id, OwnerId));
            }
            else
            {
                return(string.Empty);
            }
        }
Ejemplo n.º 2
0
        public AssociatedInfo GetAssociatedInfo(long associateId, string tenantTypeId = "")
        {
            Comment comment = new CommentService().Get(associateId);

            if (comment != null && comment.User() != null)
            {
                ICommentUrlGetter commentUrlGetter = CommentUrlGetterFactory.Get(comment.TenantTypeId);
                CommentedObject   commentObject    = commentUrlGetter.GetCommentedObject(comment.CommentedObjectId);
                return(new AssociatedInfo()
                {
                    DetailUrl = commentUrlGetter.GetCommentDetailUrl(comment.CommentedObjectId, comment.Id, commentObject.UserId),
                    Subject = Tunynet.Utilities.HtmlUtility.TrimHtml(comment.Body, 12)
                });
            }

            return(null);
        }