mirror of https://github.com/abpframework/abp.git
7 changed files with 97 additions and 1 deletions
@ -0,0 +1,21 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp.Validation; |
||||
|
using Volo.CmsKit.Contents; |
||||
|
|
||||
|
namespace Volo.CmsKit.Admin.Contents |
||||
|
{ |
||||
|
public class ContentCreateDto |
||||
|
{ |
||||
|
[Required] |
||||
|
[DynamicMaxLength(typeof(ContentConsts), nameof(ContentConsts.MaxEntityTypeLength))] |
||||
|
public string EntityType { get; set; } |
||||
|
|
||||
|
[Required] |
||||
|
[DynamicMaxLength(typeof(ContentConsts), nameof(ContentConsts.MaxEntityIdLength))] |
||||
|
public string EntityId { get; set; } |
||||
|
|
||||
|
[Required] |
||||
|
[DynamicMaxLength(typeof(ContentConsts), nameof(ContentConsts.MaxValueLength))] |
||||
|
public string Value { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace Volo.CmsKit.Admin.Contents |
||||
|
{ |
||||
|
public class ContentGetListInput : PagedAndSortedResultRequestDto |
||||
|
{ |
||||
|
public string Filter { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp.Validation; |
||||
|
using Volo.CmsKit.Contents; |
||||
|
|
||||
|
namespace Volo.CmsKit.Admin.Contents |
||||
|
{ |
||||
|
public class ContentUpdateDto |
||||
|
{ |
||||
|
[Required] |
||||
|
[DynamicMaxLength(typeof(ContentConsts), nameof(ContentConsts.MaxValueLength))] |
||||
|
public string Value { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
using Volo.CmsKit.Admin.Contents; |
||||
|
|
||||
|
namespace Volo.CmsKit.Admin.Contents |
||||
|
{ |
||||
|
public interface IContentAdminAppService |
||||
|
: ICrudAppService< |
||||
|
ContentDto, |
||||
|
Guid, |
||||
|
ContentGetListInput, |
||||
|
ContentCreateDto, |
||||
|
ContentUpdateDto> |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using System; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.CmsKit.Contents; |
||||
|
using Volo.CmsKit.Permissions; |
||||
|
|
||||
|
namespace Volo.CmsKit.Admin.Contents |
||||
|
{ |
||||
|
[Authorize(CmsKitAdminPermissions.Contents.Default)] |
||||
|
public class ContentAdminAppService : |
||||
|
CrudAppService< |
||||
|
Content, |
||||
|
ContentDto, |
||||
|
Guid, |
||||
|
ContentGetListInput, |
||||
|
ContentCreateDto, |
||||
|
ContentUpdateDto |
||||
|
>, IContentAdminAppService |
||||
|
{ |
||||
|
public ContentAdminAppService( |
||||
|
IRepository<Content, Guid> repository, |
||||
|
IContentRepository contentRepository) : base(repository) |
||||
|
{ |
||||
|
ContentRepository = contentRepository; |
||||
|
|
||||
|
GetListPolicyName = CmsKitAdminPermissions.Contents.Default; |
||||
|
GetPolicyName = CmsKitAdminPermissions.Contents.Default; |
||||
|
CreatePolicyName = CmsKitAdminPermissions.Contents.Create; |
||||
|
UpdatePolicyName = CmsKitAdminPermissions.Contents.Update; |
||||
|
DeletePolicyName = CmsKitAdminPermissions.Contents.Delete; |
||||
|
} |
||||
|
|
||||
|
protected IContentRepository ContentRepository { get; } |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue