Ejemplo n.º 1
0
        /// <summary>
        /// 获取被评论对象
        /// </summary>
        /// <returns></returns>
        public CommentedObject GetCommentedObject()
        {
            ICommentUrlGetter urlGetter = CommentUrlGetterFactory.Get(this.TenantTypeId);

            if (urlGetter != null)
            {
                return(urlGetter.GetCommentedObject(this.CommentedObjectId));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取被评论对象的Url
        /// </summary>
        /// <returns></returns>
        public string GetCommentedObjectUrl()
        {
            ICommentUrlGetter urlGetter = CommentUrlGetterFactory.Get(this.TenantTypeId);

            if (urlGetter != null)
            {
                return(urlGetter.GetCommentedObject(this.CommentedObjectId).DetailUrl);
            }
            else
            {
                return(string.Empty);
            }
        }
Ejemplo n.º 3
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);
        }