Browse Source
Merge pull request #7085 from abpframework/cms-kit/refactoring
CmsKit - Remove huge content value from list items
pull/7355/head
İlkay İlknur
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
20 additions and
2 deletions
-
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentGetListDto.cs
-
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/IContentAdminAppService.cs
-
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs
-
modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs
-
modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs
-
modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentAdminAppService_Tests.cs
|
|
|
@ -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] |
|
|
|
|