mirror of https://github.com/abpframework/abp.git
12 changed files with 62 additions and 76 deletions
@ -1,13 +0,0 @@ |
|||
using JetBrains.Annotations; |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace Volo.CmsKit.Admin.Blogs |
|||
{ |
|||
public class BlogFeatureDto : EntityDto<Guid> |
|||
{ |
|||
[NotNull] |
|||
public string FeatureName { get; set; } |
|||
public bool Enabled { get; set; } |
|||
} |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace Volo.CmsKit.Public.Blogs |
|||
namespace Volo.CmsKit.Blogs |
|||
{ |
|||
public class BlogFeatureDto : EntityDto<Guid> |
|||
{ |
|||
@ -1,10 +1,9 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.CmsKit.Public.Blogs |
|||
namespace Volo.CmsKit.Blogs |
|||
{ |
|||
public interface IBlogFeaturePublicAppService |
|||
public interface IBlogFeatureAppService |
|||
{ |
|||
Task<BlogFeatureDto> GetOrDefaultAsync(Guid blogId, string featureName); |
|||
} |
|||
@ -1,18 +1,19 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\common.props" /> |
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj" /> |
|||
<ProjectReference Include="..\Volo.CmsKit.Common.Application.Contracts\Volo.CmsKit.Common.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\Volo.CmsKit.Domain\Volo.CmsKit.Domain.csproj" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Caching\Volo.Abp.Caching.csproj" /> |
|||
<ProjectReference Include="..\Volo.CmsKit.Common.Application.Contracts\Volo.CmsKit.Common.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\Volo.CmsKit.Domain\Volo.CmsKit.Domain.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
|
|||
@ -1,20 +1,16 @@ |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Caching; |
|||
using Volo.CmsKit.Blogs; |
|||
|
|||
namespace Volo.CmsKit.Public.Blogs |
|||
namespace Volo.CmsKit.Blogs |
|||
{ |
|||
public class BlogFeaturePublicAppService : CmsKitPublicAppServiceBase, IBlogFeaturePublicAppService |
|||
public class BlogFeatureAppService : CmsKitAppServiceBase, IBlogFeatureAppService |
|||
{ |
|||
protected IBlogFeatureRepository BlogFeatureRepository { get; } |
|||
protected IDistributedCache<BlogFeatureDto> Cache { get; } |
|||
|
|||
public BlogFeaturePublicAppService( |
|||
public BlogFeatureAppService( |
|||
IBlogFeatureRepository blogFeatureRepository, |
|||
IDistributedCache<BlogFeatureDto> cache) |
|||
{ |
|||
@ -0,0 +1,31 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.GlobalFeatures; |
|||
using Volo.CmsKit.Blogs; |
|||
using Volo.CmsKit.GlobalFeatures; |
|||
|
|||
namespace Volo.CmsKit.Blogs |
|||
{ |
|||
[RequiresGlobalFeature(typeof(BlogsFeature))] |
|||
[RemoteService(Name = CmsKitCommonRemoteServiceConsts.RemoteServiceName)] |
|||
[Area("cms-kit")] |
|||
[Route("api/cms-kit/blogs/{blogId}/features")] |
|||
public class BlogFeatureController : CmsKitControllerBase, IBlogFeatureAppService |
|||
{ |
|||
protected IBlogFeatureAppService BlogFeatureAppService { get; } |
|||
|
|||
public BlogFeatureController(IBlogFeatureAppService blogFeatureAppService) |
|||
{ |
|||
BlogFeatureAppService = blogFeatureAppService; |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{featureName}")] |
|||
public Task<BlogFeatureDto> GetOrDefaultAsync(Guid blogId, string featureName) |
|||
{ |
|||
return BlogFeatureAppService.GetOrDefaultAsync(blogId, featureName); |
|||
} |
|||
} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.CmsKit.Public.Blogs; |
|||
|
|||
namespace Volo.CmsKit.Public.HttpApi.Volo.CmsKit.Public.Blogs |
|||
{ |
|||
public class BlogFeaturePublicController : CmsKitPublicControllerBase, IBlogFeaturePublicAppService |
|||
{ |
|||
protected IBlogFeaturePublicAppService BlogFeaturePublicAppService { get; } |
|||
|
|||
public BlogFeaturePublicController(IBlogFeaturePublicAppService blogFeaturePublicAppService) |
|||
{ |
|||
BlogFeaturePublicAppService = blogFeaturePublicAppService; |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{blogId}/{featureName}")] |
|||
public Task<BlogFeatureDto> GetOrDefaultAsync(Guid blogId, string featureName) |
|||
{ |
|||
return BlogFeaturePublicAppService.GetOrDefaultAsync(blogId, featureName); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue