Merge pull request #7085 from abpframework/cms-kit/refactoring

CmsKit - Remove huge content value from list items
pull/7355/head
İlkay İlknur 5 years ago committed by GitHub
commit badad8d59f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,12 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Volo.CmsKit.Admin.Contents
{
public class ContentGetListDto : EntityDto<Guid>
{
public string EntityType { get; set; }
public string EntityId { get; set; }
}
}

@ -7,6 +7,7 @@ namespace Volo.CmsKit.Admin.Contents
public interface IContentAdminAppService
: ICrudAppService<
ContentDto,
ContentGetListDto,
Guid,
ContentGetListInput,
ContentCreateDto,

@ -13,6 +13,7 @@ namespace Volo.CmsKit.Admin
CreateMap<Page, PageDto>();
CreateMap<Content, ContentDto>(MemberList.Destination);
CreateMap<Content, ContentGetListDto>(MemberList.Destination);
CreateMap<ContentCreateDto, Content>(MemberList.Source);
CreateMap<ContentUpdateDto, Content>(MemberList.Source);
}

@ -14,6 +14,7 @@ namespace Volo.CmsKit.Admin.Contents
CrudAppService<
Content,
ContentDto,
ContentGetListDto,
Guid,
ContentGetListInput,
ContentCreateDto,
@ -51,7 +52,7 @@ namespace Volo.CmsKit.Admin.Contents
await ContentManager.InsertAsync(entity);
return MapToGetListOutputDto(entity);
return MapToGetOutputDto(entity);
}
}
}

@ -48,7 +48,7 @@ namespace Volo.CmsKit.Admin.Contents
[HttpGet]
[Authorize(CmsKitAdminPermissions.Contents.Default)]
public Task<PagedResultDto<ContentDto>> GetListAsync(ContentGetListInput input)
public Task<PagedResultDto<ContentGetListDto>> GetListAsync(ContentGetListInput input)
{
return ContentAdminAppService.GetListAsync(input);
}

@ -38,6 +38,7 @@ namespace Volo.CmsKit.Contents
result.ShouldNotBeNull();
result.Items.ShouldNotBeEmpty();
result.Items.Count.ShouldBe(4);
result.Items.All(x => x.ShouldBeOfType<ContentGetListDto>() != null);
}
[Fact]
@ -46,6 +47,8 @@ namespace Volo.CmsKit.Contents
var result = await _service.GetAsync(_data.Content_1_Id);
result.ShouldNotBeNull();
result.ShouldBeOfType<Admin.Contents.ContentDto>();
result.ShouldNotBeNull(result.Value);
}
[Fact]

Loading…
Cancel
Save