Browse Source

CmsKit - Remove EntityId from Filtering Comments

pull/8586/head
enisn 5 years ago
parent
commit
6d19b20d18
  1. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs
  2. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs
  3. 5
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml
  4. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml.cs
  5. 2
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs
  6. 6
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs
  7. 16
      modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs

2
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs

@ -8,8 +8,6 @@ namespace Volo.CmsKit.Admin.Comments
{
public string EntityType { get; set; }
public string EntityId { get; set; }
public string Text { get; set; }
public Guid? RepliedCommentId { get; set; }

2
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs

@ -27,7 +27,6 @@ namespace Volo.CmsKit.Admin.Comments
var totalCount = await CommentRepository.GetCountAsync(
input.Text,
input.EntityType,
input.EntityId,
input.RepliedCommentId,
input.Author,
input.CreationStartDate,
@ -36,7 +35,6 @@ namespace Volo.CmsKit.Admin.Comments
var comments = await CommentRepository.GetListAsync(
input.Text,
input.EntityType,
input.EntityId,
input.RepliedCommentId,
input.Author,
input.CreationStartDate,

5
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml

@ -46,13 +46,10 @@
<abp-input asp-for="@Model.CreationEndDate" label="@L["EndDate"].Value" type="text" />
</abp-column>
</abp-column>
<abp-column size-lg="_2" size-md="_6">
<abp-column size-lg="_4" size-md="_6">
<abp-input asp-for="@Model.EntityType" label="@L["EntityType"].Value" type="text" />
</abp-column>
<abp-column size-lg="_2" size-md="_6">
<abp-input asp-for="@Model.EntityId" label="@L["EntityId"].Value" type="text" />
</abp-column>
<abp-column size-lg="_2" size-md="_12">
<abp-input asp-for="@Model.Author" label="@L["Username"].Value" type="text" />
</abp-column>
<abp-column size-lg="_2" size-md="_12">

2
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml.cs

@ -6,8 +6,6 @@ namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Comments
{
public string EntityType { get; set; }
public string EntityId { get; set; }
public string Author { get; set; }
public DateTime? CreationStartDate { get; set; }

2
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs

@ -14,7 +14,6 @@ namespace Volo.CmsKit.Comments
Task<List<CommentWithAuthorQueryResultItem>> GetListAsync(
string filter = null,
string entityType = null,
string entityId = null,
Guid? repliedCommentId = null,
string authorUsername = null,
DateTime? creationStartDate = null,
@ -28,7 +27,6 @@ namespace Volo.CmsKit.Comments
Task<long> GetCountAsync(
string text = null,
string entityType = null,
string entityId = null,
Guid? repliedCommentId = null,
string authorUsername = null,
DateTime? creationStartDate = null,

6
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs

@ -47,7 +47,6 @@ namespace Volo.CmsKit.Comments
public async Task<List<CommentWithAuthorQueryResultItem>> GetListAsync(
string filter = null,
string entityType = null,
string entityId = null,
Guid? repliedCommentId = null,
string authorUsername = null,
DateTime? creationStartDate = null,
@ -62,7 +61,6 @@ namespace Volo.CmsKit.Comments
var query = await GetListQueryAsync(
filter,
entityType,
entityId,
repliedCommentId,
authorUsername,
creationStartDate,
@ -83,7 +81,6 @@ namespace Volo.CmsKit.Comments
public async Task<long> GetCountAsync(
string text = null,
string entityType = null,
string entityId = null,
Guid? repliedCommentId = null,
string authorUsername = null,
DateTime? creationStartDate = null,
@ -95,7 +92,6 @@ namespace Volo.CmsKit.Comments
var query = await GetListQueryAsync(
text,
entityType,
entityId,
repliedCommentId,
authorUsername,
creationStartDate,
@ -148,7 +144,6 @@ namespace Volo.CmsKit.Comments
protected virtual async Task<IQueryable<CommentWithAuthorQueryResultItem>> GetListQueryAsync(
string filter = null,
string entityType = null,
string entityId = null,
Guid? repliedCommentId = null,
string authorUsername = null,
DateTime? creationStartDate = null,
@ -170,7 +165,6 @@ namespace Volo.CmsKit.Comments
return query.WhereIf(!filter.IsNullOrWhiteSpace(), c => c.Comment.Text.Contains(filter))
.WhereIf(!entityType.IsNullOrWhiteSpace(), c => c.Comment.EntityType.Contains(entityType))
.WhereIf(!entityId.IsNullOrWhiteSpace(), c => c.Comment.EntityId.Contains(entityId))
.WhereIf(repliedCommentId.HasValue, c => c.Comment.RepliedCommentId == repliedCommentId)
.WhereIf(!authorUsername.IsNullOrWhiteSpace(),c=>c.Author.UserName.Contains(authorUsername))
.WhereIf(creationStartDate.HasValue, c => c.Comment.CreationTime >= creationStartDate)

16
modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs

@ -44,8 +44,7 @@ namespace Volo.CmsKit.MongoDB.Comments
public async Task<List<CommentWithAuthorQueryResultItem>> GetListAsync(
string filter = null,
string entityType = null,
string entityId = null,
string entityType = null,
Guid? repliedCommentId = null,
string authorUsername = null,
DateTime? creationStartDate = null,
@ -59,8 +58,7 @@ namespace Volo.CmsKit.MongoDB.Comments
var token = GetCancellationToken(cancellationToken);
var query = await GetListQueryAsync(
filter,
entityType,
entityId,
entityType,
repliedCommentId,
authorUsername,
creationStartDate,
@ -94,8 +92,7 @@ namespace Volo.CmsKit.MongoDB.Comments
public async Task<long> GetCountAsync(
string text = null,
string entityType = null,
string entityId = null,
string entityType = null,
Guid? repliedCommentId = null,
string authorUsername = null,
DateTime? creationStartDate = null,
@ -105,8 +102,7 @@ namespace Volo.CmsKit.MongoDB.Comments
{
var query = await GetListQueryAsync(
text,
entityType,
entityId,
entityType,
repliedCommentId,
authorUsername,
creationStartDate,
@ -172,8 +168,7 @@ namespace Volo.CmsKit.MongoDB.Comments
protected virtual async Task<IQueryable<Comment>> GetListQueryAsync(
string filter = null,
string entityType = null,
string entityId = null,
string entityType = null,
Guid? repliedCommentId = null,
string authorUsername = null,
DateTime? creationStartDate = null,
@ -196,7 +191,6 @@ namespace Volo.CmsKit.MongoDB.Comments
return queryable.WhereIf(!filter.IsNullOrWhiteSpace(), c => c.Text.Contains(filter))
.WhereIf(!entityType.IsNullOrWhiteSpace(), c => c.EntityType == entityType)
.WhereIf(!entityId.IsNullOrWhiteSpace(), c => c.EntityId == entityId)
.WhereIf(repliedCommentId.HasValue, c => c.RepliedCommentId == repliedCommentId)
.WhereIf(creationStartDate.HasValue, c => c.CreationTime >= creationStartDate)
.WhereIf(creationEndDate.HasValue, c => c.CreationTime <= creationEndDate);

Loading…
Cancel
Save