CmsKit - Refactor ContentAdminController

pull/7404/head
enisn 5 years ago
parent f3ee251880
commit 3e8f0fdf5d

@ -14,6 +14,6 @@ namespace Volo.CmsKit.Admin.Contents
ContentCreateDto,
ContentUpdateDto>
{
Task<ContentDto> GetByEntityAsync(string entityType, string entityId);
Task<ContentDto> GetAsync(string entityType, string entityId);
}
}

@ -57,7 +57,7 @@ namespace Volo.CmsKit.Admin.Contents
return MapToGetOutputDto(entity);
}
public async Task<ContentDto> GetByEntityAsync(
public async Task<ContentDto> GetAsync(
[NotNull] string entityType,
[NotNull] string entityId)
{

@ -63,9 +63,9 @@ namespace Volo.CmsKit.Admin.Contents
[HttpGet]
[Route("{entityType}/{entityId}")]
[Authorize(CmsKitAdminPermissions.Contents.Default)]
public Task<ContentDto> GetByEntityAsync(string entityType, string entityId)
public Task<ContentDto> GetAsync(string entityType, string entityId)
{
return ContentAdminAppService.GetByEntityAsync(entityType, entityId);
return ContentAdminAppService.GetAsync(entityType, entityId);
}
}
}

@ -132,7 +132,7 @@ namespace Volo.CmsKit.Contents
[Fact]
public async Task ShouldGetByEntityAsync()
{
var entity = await _service.GetByEntityAsync(_data.Content_1_EntityType, _data.Content_1_EntityId);
var entity = await _service.GetAsync(_data.Content_1_EntityType, _data.Content_1_EntityId);
entity.ShouldNotBeNull();
entity.EntityId.ShouldBe(_data.Content_1_EntityId);

Loading…
Cancel
Save