Skip to content

Commit

Permalink
Merge pull request #4236 from abpframework/blog-module-admin-separation
Browse files Browse the repository at this point in the history
Blog module admin separation
  • Loading branch information
yekalkan authored Jun 16, 2020
2 parents 7f53cb9 + 8fac354 commit 923c357
Show file tree
Hide file tree
Showing 86 changed files with 1,118 additions and 254 deletions.
62 changes: 53 additions & 9 deletions modules/blogging/Volo.Blogging.sln
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Blogging.MongoDB.Tests
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Blogging.Domain.Tests", "test\Volo.Blogging.Domain.Tests\Volo.Blogging.Domain.Tests.csproj", "{B6D7EF20-9921-490A-AA95-47E3E174DC9B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin-app", "admin-app", "{BE2A423C-271E-469A-AD90-5640DEBEE9C1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "domain", "domain", "{A9EF3061-5205-46C7-ACAA-23931CB98E4F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "public-app", "public-app", "{1314C122-18F0-4C6B-895F-27645B6121FF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Blogging.Admin.Application.Contracts", "src\Volo.Blogging.Admin.Application.Contracts\Volo.Blogging.Admin.Application.Contracts.csproj", "{D8DF4D56-644E-4ADF-9DB9-712DDA62B129}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Blogging.Admin.Application", "src\Volo.Blogging.Admin.Application\Volo.Blogging.Admin.Application.csproj", "{CB5DEBB3-5C2E-48E9-AA42-497575BCC7A4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Blogging.Admin.HttpApi", "src\Volo.Blogging.Admin.HttpApi\Volo.Blogging.Admin.HttpApi.csproj", "{59BBAF94-CC8E-4313-9143-F2F5C36A7C45}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Blogging.Admin.HttpApi.Client", "src\Volo.Blogging.Admin.HttpApi.Client\Volo.Blogging.Admin.HttpApi.Client.csproj", "{58A63CC9-C886-448B-AB4E-068600294D86}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Blogging.Admin.Web", "src\Volo.Blogging.Admin.Web\Volo.Blogging.Admin.Web.csproj", "{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -117,28 +133,56 @@ Global
{B6D7EF20-9921-490A-AA95-47E3E174DC9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6D7EF20-9921-490A-AA95-47E3E174DC9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6D7EF20-9921-490A-AA95-47E3E174DC9B}.Release|Any CPU.Build.0 = Release|Any CPU
{D8DF4D56-644E-4ADF-9DB9-712DDA62B129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D8DF4D56-644E-4ADF-9DB9-712DDA62B129}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D8DF4D56-644E-4ADF-9DB9-712DDA62B129}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D8DF4D56-644E-4ADF-9DB9-712DDA62B129}.Release|Any CPU.Build.0 = Release|Any CPU
{CB5DEBB3-5C2E-48E9-AA42-497575BCC7A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB5DEBB3-5C2E-48E9-AA42-497575BCC7A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB5DEBB3-5C2E-48E9-AA42-497575BCC7A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB5DEBB3-5C2E-48E9-AA42-497575BCC7A4}.Release|Any CPU.Build.0 = Release|Any CPU
{59BBAF94-CC8E-4313-9143-F2F5C36A7C45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59BBAF94-CC8E-4313-9143-F2F5C36A7C45}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59BBAF94-CC8E-4313-9143-F2F5C36A7C45}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59BBAF94-CC8E-4313-9143-F2F5C36A7C45}.Release|Any CPU.Build.0 = Release|Any CPU
{58A63CC9-C886-448B-AB4E-068600294D86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58A63CC9-C886-448B-AB4E-068600294D86}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58A63CC9-C886-448B-AB4E-068600294D86}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58A63CC9-C886-448B-AB4E-068600294D86}.Release|Any CPU.Build.0 = Release|Any CPU
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F1D954AD-001A-4533-A8CC-94DDCF70B552} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{9F3AECDD-0B96-4EB4-BB86-59B488350B76} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{237BF49B-5FD8-413C-BBD7-2313D91D0553} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{1678D922-E56D-4D6F-94F5-12AD13C1D919} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{87A423C6-900E-4D59-A4F2-B7C49D91E6F0} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{C20F42B4-0E93-43D3-B7CD-363D7E1B4750} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{03328648-6DE6-43C1-9A27-64771A73FAAD} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{A4DBA051-7FB9-4AD7-B9B7-6810B2268122} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{0D50B2EE-5F62-4C1D-B04D-56BE0CF75967} = {EB4FB44A-FE39-4245-9DAD-D6437BCE3870}
{14409939-5A35-4145-A5C4-F3AED1617243} = {EB4FB44A-FE39-4245-9DAD-D6437BCE3870}
{BBE8D8BE-1B24-49FE-86EF-3848D4BB6829} = {25B3A516-5C0D-42E3-9294-E8A9346CEE4B}
{0B9AAD44-1FCF-4AF1-838F-A09446E98E37} = {25B3A516-5C0D-42E3-9294-E8A9346CEE4B}
{C949B953-80B3-4B36-B535-1AD74A34FEAC} = {25B3A516-5C0D-42E3-9294-E8A9346CEE4B}
{98C2D36A-F874-405D-8565-9CE59438E879} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{4C818374-2DE8-422F-8585-975E8366DB26} = {EB4FB44A-FE39-4245-9DAD-D6437BCE3870}
{0A29F64C-11F1-40B6-8E6D-91E86823775E} = {25B3A516-5C0D-42E3-9294-E8A9346CEE4B}
{B6D7EF20-9921-490A-AA95-47E3E174DC9B} = {25B3A516-5C0D-42E3-9294-E8A9346CEE4B}
{BE2A423C-271E-469A-AD90-5640DEBEE9C1} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{A9EF3061-5205-46C7-ACAA-23931CB98E4F} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{1314C122-18F0-4C6B-895F-27645B6121FF} = {42BF26EF-B8C7-42DC-9FFB-3653109B7776}
{9F3AECDD-0B96-4EB4-BB86-59B488350B76} = {A9EF3061-5205-46C7-ACAA-23931CB98E4F}
{F1D954AD-001A-4533-A8CC-94DDCF70B552} = {A9EF3061-5205-46C7-ACAA-23931CB98E4F}
{87A423C6-900E-4D59-A4F2-B7C49D91E6F0} = {A9EF3061-5205-46C7-ACAA-23931CB98E4F}
{98C2D36A-F874-405D-8565-9CE59438E879} = {A9EF3061-5205-46C7-ACAA-23931CB98E4F}
{1678D922-E56D-4D6F-94F5-12AD13C1D919} = {1314C122-18F0-4C6B-895F-27645B6121FF}
{237BF49B-5FD8-413C-BBD7-2313D91D0553} = {1314C122-18F0-4C6B-895F-27645B6121FF}
{C20F42B4-0E93-43D3-B7CD-363D7E1B4750} = {1314C122-18F0-4C6B-895F-27645B6121FF}
{03328648-6DE6-43C1-9A27-64771A73FAAD} = {1314C122-18F0-4C6B-895F-27645B6121FF}
{A4DBA051-7FB9-4AD7-B9B7-6810B2268122} = {1314C122-18F0-4C6B-895F-27645B6121FF}
{D8DF4D56-644E-4ADF-9DB9-712DDA62B129} = {BE2A423C-271E-469A-AD90-5640DEBEE9C1}
{CB5DEBB3-5C2E-48E9-AA42-497575BCC7A4} = {BE2A423C-271E-469A-AD90-5640DEBEE9C1}
{59BBAF94-CC8E-4313-9143-F2F5C36A7C45} = {BE2A423C-271E-469A-AD90-5640DEBEE9C1}
{58A63CC9-C886-448B-AB4E-068600294D86} = {BE2A423C-271E-469A-AD90-5640DEBEE9C1}
{DB75CA32-96A5-4D10-8DD0-E62A3D0DDBCB} = {BE2A423C-271E-469A-AD90-5640DEBEE9C1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F2BAE819-78D4-407A-9201-22473B2850B0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
using Volo.Abp.UI;
using Volo.Abp.VirtualFileSystem;
using Volo.Blogging;
using Volo.Blogging.Admin;
using Volo.Blogging.Files;
using Volo.BloggingTestApp.EntityFrameworkCore;
using Volo.BloggingTestApp.MongoDB;
Expand All @@ -42,6 +43,8 @@ namespace Volo.BloggingTestApp
[DependsOn(
typeof(BloggingWebModule),
typeof(BloggingApplicationModule),
typeof(BloggingAdminWebModule),
typeof(BloggingAdminApplicationModule),
#if MONGODB
typeof(BloggingTestAppMongoDbModule),
#else
Expand Down Expand Up @@ -105,12 +108,12 @@ public override void ConfigureServices(ServiceConfigurationContext context)
options.CustomSchemaIds(type => type.FullName);
});

var cultures = new List<CultureInfo>
{
new CultureInfo("cs"),
new CultureInfo("en"),
new CultureInfo("tr"),
new CultureInfo("zh-Hans")
var cultures = new List<CultureInfo>
{
new CultureInfo("cs"),
new CultureInfo("en"),
new CultureInfo("tr"),
new CultureInfo("zh-Hans")
};

Configure<RequestLocalizationOptions>(options =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<ProjectReference Include="..\Volo.BloggingTestApp.EntityFrameworkCore\Volo.BloggingTestApp.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Application\Volo.Blogging.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Web\Volo.Blogging.Web.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Admin.Application\Volo.Blogging.Admin.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Blogging.Admin.Web\Volo.Blogging.Admin.Web.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Volo.Blogging.Admin.Application.Contracts</AssemblyName>
<PackageId>Volo.Blogging.Admin.Application.Contracts</PackageId>
<RootNamespace />
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Volo.Blogging.Domain.Shared\Volo.Blogging.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\cs.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\de.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\en.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\nl.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\pl-PL.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\pt-BR.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\sl.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\tr.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\vi.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\zh-Hans.json" />
<EmbeddedResource Include="Volo\Blogging\Admin\Localization\Resources\Blogging\Admin\ApplicationContracts\zh-Hant.json" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
using Volo.Blogging.Localization;

namespace Volo.Blogging.Admin
{
[DependsOn(typeof(BloggingDomainSharedModule))]
public class BloggingAdminApplicationContractsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<BloggingAdminApplicationContractsModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<BloggingResource>()
.AddVirtualJson("Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts");
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using Volo.Blogging.Localization;

namespace Volo.Blogging.Admin
{
public class BloggingAdminPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var bloggingGroup = context.AddGroup(BloggingAdminPermissions.GroupName, L("Permission:BloggingAdmin"));

var blogs = bloggingGroup.AddPermission(BloggingAdminPermissions.Blogs.Default, L("Permission:Blogs"));
blogs.AddChild(BloggingAdminPermissions.Blogs.Management, L("Permission:Management"));
blogs.AddChild(BloggingAdminPermissions.Blogs.Update, L("Permission:Edit"));
blogs.AddChild(BloggingAdminPermissions.Blogs.Delete, L("Permission:Delete"));
blogs.AddChild(BloggingAdminPermissions.Blogs.Create, L("Permission:Create"));
}

private static LocalizableString L(string name)
{
return LocalizableString.Create<BloggingResource>(name);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Volo.Abp.Reflection;

namespace Volo.Blogging.Admin
{
public class BloggingAdminPermissions
{
public const string GroupName = "Blogging.Admin";

public static class Blogs
{
public const string Default = GroupName + ".Blog";
public const string Management = Default + ".Management";
public const string Delete = Default + ".Delete";
public const string Update = Default + ".Update";
public const string Create = Default + ".Create";
}

public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(BloggingAdminPermissions));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Volo.Blogging.Admin
{
public static class BloggingAdminRemoteServiceConsts
{
public const string RemoteServiceName = "BloggingAdmin";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using Volo.Abp.Application.Dtos;

namespace Volo.Blogging.Admin.Blogs
{
public class BlogDto : FullAuditedEntityDto<Guid>
{
public string Name { get; set; }

public string ShortName { get; set; }

public string Description { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Volo.Blogging.Blogs.Dtos
namespace Volo.Blogging.Admin.Blogs
{
public class CreateBlogDto
{
Expand All @@ -8,4 +8,4 @@ public class CreateBlogDto

public string Description { get; set; }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;

namespace Volo.Blogging.Admin.Blogs
{
public interface IBlogManagementAppService : IApplicationService
{
Task<ListResultDto<BlogDto>> GetListAsync();

Task<BlogDto> GetAsync(Guid id);

Task<BlogDto> CreateAsync(CreateBlogDto input);

Task<BlogDto> UpdateAsync(Guid id, UpdateBlogDto input);

Task DeleteAsync(Guid id);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Volo.Blogging.Blogs.Dtos
namespace Volo.Blogging.Admin.Blogs
{
public class UpdateBlogDto
{
Expand All @@ -8,4 +8,4 @@ public class UpdateBlogDto

public string Description { get; set; }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"culture": "cs",
"texts": {
"Permission:BloggingAdmin": "Blog",
"Permission:Blogs": "Blogy",
"Permission:Management": "Správa",
"Permission:Edit": "Upravit",
"Permission:Create": "Vytvořit",
"Permission:Delete": "Smazat"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"culture": "de",
"texts": {
"Permission:BloggingAdmin": "Blog",
"Permission:Blogs": "Blogs",
"Permission:Management": "Verwaltung",
"Permission:Edit": "Bearbeiten",
"Permission:Create": "Erstellen",
"Permission:Delete": "Löschen"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"culture": "en",
"texts": {
"Permission:BloggingAdmin": "Blogging",
"Permission:Blogs": "Blogs",
"Permission:Management": "Management",
"Permission:Edit": "Edit",
"Permission:Create": "Create",
"Permission:Delete": "Delete"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"culture": "nl",
"texts": {
"Permission:BloggingAdmin": "Blog",
"Permission:Blogs": "Blogs",
"Permission:Management": "Beheer",
"Permission:Edit": "Bewerk",
"Permission:Create": "Maak aan",
"Permission:Delete": "Verwijder"
}
}
Loading

0 comments on commit 923c357

Please sign in to comment.