mirror of https://github.com/abpframework/abp.git
21 changed files with 115 additions and 64 deletions
@ -1,7 +1,6 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Volo.Abp.Validation; |
|
||||
|
|
||||
namespace Volo.CmsKit.Pages |
namespace Volo.CmsKit.Admin.Pages |
||||
{ |
{ |
||||
public class CheckUrlInputDto |
public class CheckUrlInputDto |
||||
{ |
{ |
||||
@ -1,7 +1,6 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Volo.Abp.Validation; |
|
||||
|
|
||||
namespace Volo.CmsKit.Pages |
namespace Volo.CmsKit.Admin.Pages |
||||
{ |
{ |
||||
public class CreatePageInputDto |
public class CreatePageInputDto |
||||
{ |
{ |
||||
@ -1,8 +1,6 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Volo.Abp.Validation; |
|
||||
using Volo.CmsKit.Contents; |
|
||||
|
|
||||
namespace Volo.CmsKit.Pages |
namespace Volo.CmsKit.Admin.Pages |
||||
{ |
{ |
||||
public class CreatePageWithContentInputDto |
public class CreatePageWithContentInputDto |
||||
{ |
{ |
||||
@ -1,14 +1,11 @@ |
|||||
using System; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using JetBrains.Annotations; |
|
||||
|
|
||||
namespace Volo.CmsKit.Pages |
namespace Volo.CmsKit.Admin.Pages |
||||
{ |
{ |
||||
public interface IPageAppService |
public interface IPageAdminAppService |
||||
{ |
{ |
||||
Task<PageDto> GetAsync(Guid id); |
Task<PageDto> GetAsync(Guid id); |
||||
|
|
||||
Task<PageDto> GetByUrlAsync([NotNull] string url); |
|
||||
|
|
||||
Task<PageDto> CreatePageAsync(CreatePageInputDto input); |
Task<PageDto> CreatePageAsync(CreatePageInputDto input); |
||||
|
|
||||
@ -1,7 +1,7 @@ |
|||||
using System; |
using System; |
||||
using Volo.Abp.Application.Dtos; |
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
namespace Volo.CmsKit.Pages |
namespace Volo.CmsKit.Admin.Pages |
||||
{ |
{ |
||||
public class PageDto : EntityDto<Guid> |
public class PageDto : EntityDto<Guid> |
||||
{ |
{ |
||||
@ -1,8 +1,6 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Volo.Abp.Validation; |
|
||||
using Volo.CmsKit.Contents; |
|
||||
|
|
||||
namespace Volo.CmsKit.Pages |
namespace Volo.CmsKit.Admin.Pages |
||||
{ |
{ |
||||
public class UpdatePageContentInputDto |
public class UpdatePageContentInputDto |
||||
{ |
{ |
||||
@ -1,7 +1,6 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Volo.Abp.Validation; |
|
||||
|
|
||||
namespace Volo.CmsKit.Pages |
namespace Volo.CmsKit.Admin.Pages |
||||
{ |
{ |
||||
public class UpdatePageInputDto |
public class UpdatePageInputDto |
||||
{ |
{ |
||||
@ -0,0 +1,10 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using JetBrains.Annotations; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Pages |
||||
|
{ |
||||
|
public interface IPageAppService |
||||
|
{ |
||||
|
Task<PageDto> GetByUrlAsync([NotNull] string url); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Pages |
||||
|
{ |
||||
|
public class PageDto : EntityDto<Guid> |
||||
|
{ |
||||
|
public string Title { get; set; } |
||||
|
|
||||
|
public string Url { get; set; } |
||||
|
|
||||
|
public string Description { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.CmsKit.Pages; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Pages |
||||
|
{ |
||||
|
public class PageAppService : CmsKitPublicAppServiceBase, IPageAppService |
||||
|
{ |
||||
|
protected readonly IPageRepository PageRepository; |
||||
|
|
||||
|
public PageAppService(IPageRepository pageRepository) |
||||
|
{ |
||||
|
PageRepository = pageRepository; |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<PageDto> GetByUrlAsync(string url) |
||||
|
{ |
||||
|
var page = await PageRepository.GetByUrlAsync(url); |
||||
|
|
||||
|
return ObjectMapper.Map<Page, PageDto>(page); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Pages |
||||
|
{ |
||||
|
[RemoteService(Name = CmsKitPublicRemoteServiceConsts.RemoteServiceName)] |
||||
|
[Area("cms-kit")] |
||||
|
[Route("api/cms-kit-public/comments")] |
||||
|
public class PagesPublicController |
||||
|
{ |
||||
|
protected readonly IPageAppService PageAppService; |
||||
|
|
||||
|
public PagesPublicController(IPageAppService pageAppService) |
||||
|
{ |
||||
|
PageAppService = pageAppService; |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("url/{url}")] |
||||
|
public Task<PageDto> GetByUrlAsync(string url) |
||||
|
{ |
||||
|
return PageAppService.GetByUrlAsync(url); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,9 +1,8 @@ |
|||||
@page "{pageUrl}" |
@page "{pageUrl}" |
||||
@using Microsoft.AspNetCore.Mvc.Localization |
@using Microsoft.AspNetCore.Mvc.Localization |
||||
@using Volo.CmsKit.Localization |
@using Volo.CmsKit.Localization |
||||
@using Volo.CmsKit.Web.Pages.CmsKit.Pages |
@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages |
||||
@using Volo.CmsKit.Web.Pages.CmsKit.Shared.Components.Pages |
@model Volo.CmsKit.Public.Web.Pages.CmsKit.Pages.IndexModel |
||||
@model IndexModel |
|
||||
@inject IHtmlLocalizer<CmsKitResource> L |
@inject IHtmlLocalizer<CmsKitResource> L |
||||
|
|
||||
@await Component.InvokeAsync(typeof(DefaultPageViewComponent), |
@await Component.InvokeAsync(typeof(DefaultPageViewComponent), |
||||
@ -1,8 +1,9 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Microsoft.AspNetCore.Mvc; |
using Microsoft.AspNetCore.Mvc; |
||||
using Volo.CmsKit.Pages; |
using Volo.CmsKit.Public.Pages; |
||||
|
using Volo.CmsKit.Web.Pages; |
||||
|
|
||||
namespace Volo.CmsKit.Web.Pages.CmsKit.Pages |
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Pages |
||||
{ |
{ |
||||
public class IndexModel : CommonPageModel |
public class IndexModel : CommonPageModel |
||||
{ |
{ |
||||
Loading…
Reference in new issue