Browse Source

refactoring

pull/7757/head
Ahmet 6 years ago
parent
commit
ea2227fbb1
  1. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs
  2. 4
      modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs
  3. 2
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs
  4. 8
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs
  5. 4
      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

@ -5,8 +5,6 @@ namespace Volo.CmsKit.Admin.Comments
{
public class CommentGetListInput : PagedAndSortedResultRequestDto
{
public string Filter { get; set; }
public string EntityType { get; set; }
public string EntityId { get; set; }

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

@ -25,7 +25,7 @@ namespace Volo.CmsKit.Admin.Comments
public virtual async Task<PagedResultDto<CommentDto>> GetListAsync(CommentGetListInput input)
{
var totalCount = await CommentRepository.GetCountAsync(
input.Filter,
input.Text,
input.EntityType,
input.EntityId,
input.RepliedCommentId,
@ -34,7 +34,7 @@ namespace Volo.CmsKit.Admin.Comments
input.CreationEndDate);
var comments = await CommentRepository.GetListAsync(
input.Filter,
input.Text,
input.EntityType,
input.EntityId,
input.RepliedCommentId,

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

@ -26,7 +26,7 @@ namespace Volo.CmsKit.Comments
);
Task<long> GetCountAsync(
string filter = null,
string text = null,
string entityType = null,
string entityId = null,
Guid? repliedCommentId = null,

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

@ -72,7 +72,7 @@ namespace Volo.CmsKit.Comments
}
public async Task<long> GetCountAsync(
string filter = null,
string text = null,
string entityType = null,
string entityId = null,
Guid? repliedCommentId = null,
@ -83,7 +83,7 @@ namespace Volo.CmsKit.Comments
)
{
var query = await GetListQueryAsync(
filter,
text,
entityType,
entityId,
repliedCommentId,
@ -146,8 +146,8 @@ namespace Volo.CmsKit.Comments
{
return (await GetDbSetAsync())
.WhereIf(!filter.IsNullOrWhiteSpace(), c => c.Text.Contains(filter))
.WhereIf(!entityType.IsNullOrWhiteSpace(), c => c.EntityType == entityType)
.WhereIf(!entityId.IsNullOrWhiteSpace(), c => c.EntityId == entityId)
.WhereIf(!entityType.IsNullOrWhiteSpace(), c => c.EntityType.Contains(entityType))
.WhereIf(!entityId.IsNullOrWhiteSpace(), c => c.EntityId.Contains(entityId))
.WhereIf(repliedCommentId.HasValue, c => c.RepliedCommentId == repliedCommentId)
.WhereIf(creatorId.HasValue, c => c.CreatorId == creatorId)
.WhereIf(creationStartDate.HasValue, c => c.CreationTime >= creationStartDate)

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

@ -72,7 +72,7 @@ namespace Volo.CmsKit.MongoDB.Comments
}
public async Task<long> GetCountAsync(
string filter = null,
string text = null,
string entityType = null,
string entityId = null,
Guid? repliedCommentId = null,
@ -83,7 +83,7 @@ namespace Volo.CmsKit.MongoDB.Comments
)
{
var query = await GetListQueryAsync(
filter,
text,
entityType,
entityId,
repliedCommentId,

Loading…
Cancel
Save