Skip to content

Commit

Permalink
添加Rider徽章和评论审核功能
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyunchong committed May 28, 2024
1 parent 3386704 commit c305019
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ public class CommentSearchDto : PageDto
public Guid? SubjectId { get; set; }

public String Text { get; set; }

public bool? IsAudit { get; set; }
}
5 changes: 3 additions & 2 deletions src/LinCms.Application/Blog/Comments/CommentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public async Task<PagedResultDto<CommentDto>> GetListAsync([FromQuery] CommentSe
List<CommentDto> 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)
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
});
Expand Down

0 comments on commit c305019

Please sign in to comment.