コード例 #1
0
        /// <summary>
        /// 贴吧详细显示页面
        /// </summary>
        /// <param name="sectionId"></param>
        /// <returns></returns>
        public string SectionDetail(long sectionId, SortBy_BarThread?sortBy = null, bool?isEssential = null, long?categoryId = null)
        {
            string spaceKey = TopicIdToTopicKeyDictionary.GetTopicKey(sectionId);

            if (string.IsNullOrEmpty(spaceKey))
            {
                return(string.Empty);
            }
            return(SiteUrls.Instance().TopicSectionDetail(spaceKey, categoryId, isEssential, sortBy));
        }
コード例 #2
0
        /// <summary>
        /// 编辑页面
        /// </summary>
        /// <param name="sectionId"></param>
        /// <param name="threadId"></param>
        /// <returns></returns>
        public string Edit(long sectionId, long?threadId = null)
        {
            string spaceKey = TopicIdToTopicKeyDictionary.GetTopicKey(sectionId);

            if (string.IsNullOrEmpty(spaceKey))
            {
                return(string.Empty);
            }
            return(SiteUrls.Instance().TopicThreadEdit(spaceKey, threadId));
        }
コード例 #3
0
        /// <summary>
        /// 管理分类
        /// </summary>
        /// <param name="sectionId">贴吧id</param>
        /// <returns>管理分类</returns>
        public string ManageCategories(long sectionId)
        {
            string spaceKey = TopicIdToTopicKeyDictionary.GetTopicKey(sectionId);

            if (string.IsNullOrEmpty(spaceKey))
            {
                return(string.Empty);
            }
            return(SiteUrls.Instance().TopicManageThreadCategories(spaceKey));
        }
コード例 #4
0
        /// <summary>
        /// 用户回帖页面
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <param name="sectionId">贴吧id</param>
        /// <returns>用户回帖页面</returns>
        public string UserPosts(long userId, long?sectionId = null)
        {
            if (sectionId == null)
            {
                return(string.Empty);
            }
            string spaceKey = TopicIdToTopicKeyDictionary.GetTopicKey(sectionId.Value);

            if (string.IsNullOrEmpty(spaceKey))
            {
                return(string.Empty);
            }
            return(SiteUrls.Instance().TopicUserThreads(spaceKey, true));
        }
コード例 #5
0
        public string ThreadDetail(long threadId, bool onlyLandlord = false, SortBy_BarPost sortBy = SortBy_BarPost.DateCreated, int pageIndex = 1, long?anchorPostId = null, bool isAnchorPostList = false, long?childPostIndex = null)
        {
            BarThread thread = new BarThreadService().Get(threadId);

            if (thread == null)
            {
                return(string.Empty);
            }
            string spaceKey = TopicIdToTopicKeyDictionary.GetTopicKey(thread.SectionId);

            if (string.IsNullOrEmpty(spaceKey))
            {
                return(string.Empty);
            }
            return(SiteUrls.Instance().TopicThreadDetail(spaceKey, threadId, onlyLandlord, sortBy, pageIndex, anchorPostId, isAnchorPostList, childPostIndex));
        }
コード例 #6
0
        /// <summary>
        /// 标签下的帖子
        /// </summary>
        /// <param name="tagName">标签名</param>
        /// <param name="sectionId">帖子id</param>
        /// <returns>标签下的帖子</returns>
        public string ListByTag(string tagName, long?sectionId = null, SortBy_BarThread?sortBy = null, bool?isEssential = null)
        {
            if (sectionId == null)
            {
                return(string.Empty);
            }

            string spaceKey = TopicIdToTopicKeyDictionary.GetTopicKey(sectionId.Value);

            if (string.IsNullOrEmpty(spaceKey))
            {
                return(string.Empty);
            }

            return(SiteUrls.Instance().TopicThreadListByTag(spaceKey, tagName, sortBy, isEssential));
        }
コード例 #7
0
        /// <summary>
        /// 编辑回帖页面
        /// </summary>
        /// <param name="threadId">帖子id</param>
        /// <param name="postId">回帖id</param>
        /// <returns>编辑回帖页面</returns>
        public string EditPost(long threadId, long?postId = null)
        {
            BarThread thread = new BarThreadService().Get(threadId);

            if (thread == null)
            {
                return(string.Empty);
            }
            string spaceKey = TopicIdToTopicKeyDictionary.GetTopicKey(thread.SectionId);

            if (string.IsNullOrEmpty(spaceKey))
            {
                return(string.Empty);
            }
            return(SiteUrls.Instance().TopicEditPost(spaceKey, threadId, postId));
        }