mirror of https://github.com/abpframework/abp.git
21 changed files with 145 additions and 80 deletions
@ -1,6 +1,6 @@ |
|||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace Volo.CmsKit.Admin |
namespace Volo.CmsKit |
||||
{ |
{ |
||||
[DependsOn( |
[DependsOn( |
||||
typeof(CmsKitCommonApplicationContractsModule) |
typeof(CmsKitCommonApplicationContractsModule) |
||||
@ -0,0 +1,7 @@ |
|||||
|
namespace Volo.CmsKit |
||||
|
{ |
||||
|
public class CmsKitAdminRemoteServiceConsts |
||||
|
{ |
||||
|
public const string RemoteServiceName = "CmsKitAdmin"; |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
using Volo.Abp.Reflection; |
using Volo.Abp.Reflection; |
||||
|
|
||||
namespace Volo.CmsKit.Admin.Permissions |
namespace Volo.CmsKit.Permissions |
||||
{ |
{ |
||||
public class CmsKitAdminPermissions |
public class CmsKitAdminPermissions |
||||
{ |
{ |
||||
@ -1,19 +0,0 @@ |
|||||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|
||||
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers; |
|
||||
|
|
||||
namespace Volo.CmsKit.Web.Icons |
|
||||
{ |
|
||||
[HtmlTargetElement("cms-icon",TagStructure = TagStructure.WithoutEndTag)] |
|
||||
public class CmsIconTagHelper : AbpTagHelper<CmsIconTagHelper, CmsIconTagHelperService> |
|
||||
{ |
|
||||
public string Name { get; set; } |
|
||||
|
|
||||
public bool Highlight { get; set; } |
|
||||
|
|
||||
public CmsIconTagHelper(CmsIconTagHelperService service) |
|
||||
: base(service) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,35 +0,0 @@ |
|||||
using System.Text.Encodings.Web; |
|
||||
using System.Threading.Tasks; |
|
||||
using Microsoft.AspNetCore.Mvc.TagHelpers; |
|
||||
using Microsoft.AspNetCore.Razor.TagHelpers; |
|
||||
using Volo.Abp; |
|
||||
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers; |
|
||||
|
|
||||
namespace Volo.CmsKit.Web.Icons |
|
||||
{ |
|
||||
public class CmsIconTagHelperService : AbpTagHelperService<CmsIconTagHelper> |
|
||||
{ |
|
||||
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) |
|
||||
{ |
|
||||
if (TagHelper.Name.Contains(".")) |
|
||||
{ |
|
||||
output.TagName = "img"; |
|
||||
output.Attributes.Add("src", TagHelper.Name); |
|
||||
output.Attributes.Add("width", "20"); |
|
||||
output.Attributes.Add("height", "20"); |
|
||||
} |
|
||||
else |
|
||||
{ |
|
||||
//TODO: Allow to font, svg icons.. etc.
|
|
||||
throw new AbpException("Only file icons are allowed!"); |
|
||||
} |
|
||||
|
|
||||
if (TagHelper.Highlight) |
|
||||
{ |
|
||||
output.AddClass("cms-icon-highlighted", HtmlEncoder.Default); |
|
||||
} |
|
||||
|
|
||||
return Task.CompletedTask; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,7 @@ |
|||||
|
namespace Volo.CmsKit |
||||
|
{ |
||||
|
public class CmsKitPublicRemoteServiceConsts |
||||
|
{ |
||||
|
public const string RemoteServiceName = "CmsKitPublic"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
namespace Volo.CmsKit.Reactions |
||||
|
{ |
||||
|
public class CreateReactionDto |
||||
|
{ |
||||
|
public string EntityType { get; set; } |
||||
|
|
||||
|
public string EntityId { get; set; } |
||||
|
|
||||
|
public string ReactionName { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
namespace Volo.CmsKit.Reactions |
||||
|
{ |
||||
|
public class DeleteReactionDto |
||||
|
{ |
||||
|
public string EntityType { get; set; } |
||||
|
|
||||
|
public string EntityId { get; set; } |
||||
|
|
||||
|
public string ReactionName { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Volo.CmsKit.Reactions |
namespace Volo.CmsKit.Reactions |
||||
{ |
{ |
||||
public class GetForSelectionInput |
public class GetForSelectionDto |
||||
{ |
{ |
||||
public string EntityType { get; set; } |
public string EntityType { get; set; } |
||||
|
|
||||
@ -0,0 +1,60 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace Volo.CmsKit.Reactions |
||||
|
{ |
||||
|
[RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] |
||||
|
[Area("cms-kit")] |
||||
|
[Route("api/cms-kit-public/reactions")] |
||||
|
public class ReactionPublicController : CmsKitPublicController, IReactionPublicAppService |
||||
|
{ |
||||
|
protected IReactionPublicAppService ReactionPublicAppService { get; } |
||||
|
|
||||
|
public ReactionPublicController(IReactionPublicAppService reactionPublicAppService) |
||||
|
{ |
||||
|
ReactionPublicAppService = reactionPublicAppService; |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("available")] |
||||
|
public virtual Task<ListResultDto<ReactionDto>> GetAvailableReactions(GetAvailableReactionsDto input) |
||||
|
{ |
||||
|
return ReactionPublicAppService.GetAvailableReactions(input); |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("summaries")] |
||||
|
public virtual Task<ListResultDto<ReactionSummaryDto>> GetReactionSummariesAsync(GetReactionSummariesDto input) |
||||
|
{ |
||||
|
return ReactionPublicAppService.GetReactionSummariesAsync(input); |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("my")] |
||||
|
public virtual Task<ListResultDto<ReactionDto>> GetMyReactions(GetMyReactionsDto input) |
||||
|
{ |
||||
|
return ReactionPublicAppService.GetMyReactions(input); |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("selection")] //TODO: Consider to rename!
|
||||
|
public virtual Task<ListResultDto<ReactionWithSelectionDto>> GetForSelectionAsync(GetForSelectionDto input) |
||||
|
{ |
||||
|
return ReactionPublicAppService.GetForSelectionAsync(input); |
||||
|
} |
||||
|
|
||||
|
[HttpPut] |
||||
|
public virtual Task CreateAsync(CreateReactionDto input) |
||||
|
{ |
||||
|
return ReactionPublicAppService.CreateAsync(input); |
||||
|
} |
||||
|
|
||||
|
[HttpDelete] |
||||
|
public virtual Task DeleteAsync(DeleteReactionDto input) |
||||
|
{ |
||||
|
return ReactionPublicAppService.DeleteAsync(input); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue