Example #1
0
        /// <summary>
        /// 审核友链
        /// </summary>
        /// <param name="linkId"></param>
        /// <param name="toExamine"></param>
        /// <returns></returns>
        public async Task FriendshipLinkToExamineAsync(int linkId, ToExamine toExamine)
        {
            var link = await _blogFriendshipLinkRepository.FirstOrDefaultAsync(linkId);

            if (toExamine == ToExamine.Unaudited || link.ToExamine == toExamine)
            {
                throw new UserFriendlyException(500, "审核状态有问题");
            }
            link.ToExamine = toExamine;
            await _blogFriendshipLinkRepository.UpdateAsync(link);
        }
Example #2
0
        public async Task ArticleCommentToExamineAsync(long commentId, ToExamine toExamine)
        {
            var comment = await _articleCommentRepository.FirstOrDefaultAsync(commentId);

            if (toExamine == ToExamine.Unaudited || comment.ToExamine == toExamine)
            {
                throw new UserFriendlyException(500, "审核状态有问题");
            }
            comment.ToExamine = toExamine;
            await _articleCommentRepository.UpdateAsync(comment);
        }