mirror of https://github.com/abpframework/abp.git
23 changed files with 74 additions and 168 deletions
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using Volo.Abp.ObjectExtending; |
|||
|
|||
namespace Volo.CmsKit.Contents; |
|||
|
|||
[Serializable] |
|||
public class ContentFragment : ExtensibleObject |
|||
{ |
|||
public string Type { get; set; } |
|||
} |
|||
@ -1,4 +1,4 @@ |
|||
namespace Volo.CmsKit.Polls; |
|||
namespace Volo.CmsKit.Contents; |
|||
|
|||
public class MarkdownContentFragment : ContentFragment |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.CmsKit.Polls; |
|||
namespace Volo.CmsKit.Contents; |
|||
public class WidgetContentFragment : ContentFragment |
|||
{ |
|||
public string Name { get; } |
|||
@ -1,5 +0,0 @@ |
|||
namespace Volo.CmsKit.Polls; |
|||
public abstract class ContentFragment |
|||
{ |
|||
|
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.CmsKit.Polls; |
|||
|
|||
public interface IContentParser |
|||
{ |
|||
Task<List<ContentFragment>> ParseAsync(string content); |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Volo.CmsKit.Polls; |
|||
public class PollViewComponentManager : DomainService |
|||
{ |
|||
protected IContentParser ContentParser { get; set; } |
|||
public PollViewComponentManager(IContentParser contentParser) |
|||
{ |
|||
ContentParser = contentParser; |
|||
} |
|||
|
|||
public virtual async Task<List<ContentFragment>> ParseAsync(string content) |
|||
{ |
|||
return await ContentParser.ParseAsync(content); |
|||
} |
|||
|
|||
} |
|||
@ -1,11 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.CmsKit.Polls; |
|||
|
|||
namespace Volo.CmsKit.Public.Polls; |
|||
|
|||
public interface IPollViewComponentAppService : IApplicationService |
|||
{ |
|||
Task<List<ContentFragment>> ParseAsync(string content); |
|||
} |
|||
@ -1,20 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.CmsKit.Polls; |
|||
|
|||
namespace Volo.CmsKit.Public.Polls; |
|||
|
|||
public class PollViewComponentAppService : CmsKitPublicAppServiceBase, IPollViewComponentAppService |
|||
{ |
|||
protected PollViewComponentManager PollViewComponentManager { get; set; } |
|||
|
|||
public PollViewComponentAppService(PollViewComponentManager pollViewComponentManager) |
|||
{ |
|||
PollViewComponentManager = pollViewComponentManager; |
|||
} |
|||
|
|||
public virtual async Task<List<ContentFragment>> ParseAsync(string content) |
|||
{ |
|||
return await PollViewComponentManager.ParseAsync(content); |
|||
} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
|
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Modeling; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client.ClientProxying; |
|||
using Volo.CmsKit.Public.Polls; |
|||
using System.Collections.Generic; |
|||
using Volo.CmsKit.Polls; |
|||
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace Volo.CmsKit.Public.Polls.ClientProxies; |
|||
|
|||
[Dependency(ReplaceServices = true)] |
|||
[ExposeServices(typeof(IPollViewComponentAppService), typeof(PollViewComponentClientProxy))] |
|||
public partial class PollViewComponentClientProxy : ClientProxyBase<IPollViewComponentAppService>, IPollViewComponentAppService |
|||
{ |
|||
public virtual async Task<List<ContentFragment>> ParseAsync(string content) |
|||
{ |
|||
return await RequestAsync<List<ContentFragment>>(nameof(ParseAsync), new ClientProxyRequestTypeValue |
|||
{ |
|||
{ typeof(string), content } |
|||
}); |
|||
} |
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
// This file is part of PollViewComponentClientProxy, you can customize it here
|
|||
// ReSharper disable once CheckNamespace
|
|||
namespace Volo.CmsKit.Public.Polls.ClientProxies; |
|||
|
|||
public partial class PollViewComponentClientProxy |
|||
{ |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp; |
|||
using Volo.CmsKit.Polls; |
|||
|
|||
namespace Volo.CmsKit.Public.Polls; |
|||
|
|||
[RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] |
|||
[Area(CmsKitPublicRemoteServiceConsts.ModuleName)] |
|||
[Route("api/cms-kit-public/polls")] |
|||
public class PollViewComponentController : CmsKitPublicControllerBase, IPollViewComponentAppService |
|||
{ |
|||
protected IPollViewComponentAppService PollViewComponentAppService { get; } |
|||
|
|||
public PollViewComponentController(IPollViewComponentAppService pollViewComponentAppService) |
|||
{ |
|||
PollViewComponentAppService = pollViewComponentAppService; |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{content}")] |
|||
public virtual Task<List<ContentFragment>> ParseAsync(string content) |
|||
{ |
|||
return PollViewComponentAppService.ParseAsync(content); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue