diff --git a/README.md b/README.md index 37d5c235..136684f2 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ ## 项目简介 ![Publish](https://github.com/luoyunchong/lin-cms-dotnetcore/workflows/Publish/badge.svg) +[![.NET IDE Rider](https://img.shields.io/static/v1?style=float&logo=rider&label=Rider&message=jetbrains&color=red)](https://www.jetbrains.com/rider/) ![](https://img.shields.io/badge/.net8.0.0-3963bc.svg) ![](https://img.shields.io/badge/license-MIT-3963bc.svg) ![](https://img.shields.io/badge/developer-IGeekFan-3963bc.svg) diff --git a/src/LinCms.Application.Contracts/Blog/Comments/CommentSearchDto.cs b/src/LinCms.Application.Contracts/Blog/Comments/CommentSearchDto.cs index f4787997..772af08b 100644 --- a/src/LinCms.Application.Contracts/Blog/Comments/CommentSearchDto.cs +++ b/src/LinCms.Application.Contracts/Blog/Comments/CommentSearchDto.cs @@ -9,4 +9,6 @@ public class CommentSearchDto : PageDto public Guid? SubjectId { get; set; } public String Text { get; set; } + + public bool? IsAudit { get; set; } } \ No newline at end of file diff --git a/src/LinCms.Application/Blog/Comments/CommentService.cs b/src/LinCms.Application/Blog/Comments/CommentService.cs index 477fbce0..27c9f1f1 100644 --- a/src/LinCms.Application/Blog/Comments/CommentService.cs +++ b/src/LinCms.Application/Blog/Comments/CommentService.cs @@ -100,6 +100,7 @@ public async Task> GetListAsync([FromQuery] CommentSe List comments = (await commentRepository .Select .Include(r => r.UserInfo) + .WhereIf(commentSearchDto.IsAudit != null, r => r.IsAudit == commentSearchDto.IsAudit) .WhereIf(commentSearchDto.SubjectId.HasValue, r => r.SubjectId == commentSearchDto.SubjectId) .WhereIf(commentSearchDto.Text.IsNotNullOrEmpty(), r => r.Text.Contains(commentSearchDto.Text)) .OrderByDescending(r => r.CreateTime) @@ -187,7 +188,7 @@ await commentRepository.UpdateDiy.Set(r => r.ChildsCount - 1).Where(r => r.Id == .ExecuteAffrowsAsync(); } - affrows += await commentRepository.DeleteAsync(new Comment {Id = comment.Id}); + affrows += await commentRepository.DeleteAsync(new Comment { Id = comment.Id }); switch (comment.SubjectType) { @@ -224,7 +225,7 @@ public async Task DeleteMyComment(Guid id) { NotificationType = NotificationType.UserCommentOnArticle, ArticleId = comment.SubjectId, - UserInfoId = (long) CurrentUser.FindUserId(), + UserInfoId = (long)CurrentUser.FindUserId(), CommentId = comment.Id, IsCancel = true });