diff --git a/modules/blogging/Volo.Blogging.sln b/modules/blogging/Volo.Blogging.sln index 454f1e6a960..607d2c3b1b9 100644 --- a/modules/blogging/Volo.Blogging.sln +++ b/modules/blogging/Volo.Blogging.sln @@ -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 @@ -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} diff --git a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs index 8d57cb8aee6..3d371921459 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs +++ b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs @@ -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; @@ -42,6 +43,8 @@ namespace Volo.BloggingTestApp [DependsOn( typeof(BloggingWebModule), typeof(BloggingApplicationModule), + typeof(BloggingAdminWebModule), + typeof(BloggingAdminApplicationModule), #if MONGODB typeof(BloggingTestAppMongoDbModule), #else @@ -105,12 +108,12 @@ public override void ConfigureServices(ServiceConfigurationContext context) options.CustomSchemaIds(type => type.FullName); }); - var cultures = new List - { - new CultureInfo("cs"), - new CultureInfo("en"), - new CultureInfo("tr"), - new CultureInfo("zh-Hans") + var cultures = new List + { + new CultureInfo("cs"), + new CultureInfo("en"), + new CultureInfo("tr"), + new CultureInfo("zh-Hans") }; Configure(options => diff --git a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj index a677553ee5e..6e269e702ac 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj +++ b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj @@ -26,6 +26,8 @@ + + diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/FodyWeavers.xml b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/FodyWeavers.xml new file mode 100644 index 00000000000..be0de3a9084 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/FodyWeavers.xsd b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 00000000000..3f3946e282d --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo.Blogging.Admin.Application.Contracts.csproj b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo.Blogging.Admin.Application.Contracts.csproj new file mode 100644 index 00000000000..e7f7b6a8b5b --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo.Blogging.Admin.Application.Contracts.csproj @@ -0,0 +1,31 @@ + + + + + + + netstandard2.0 + Volo.Blogging.Admin.Application.Contracts + Volo.Blogging.Admin.Application.Contracts + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminApplicationContractsModule.cs b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminApplicationContractsModule.cs new file mode 100644 index 00000000000..b2b6d000c04 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminApplicationContractsModule.cs @@ -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(options => + { + options.FileSets.AddEmbedded(); + }); + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts"); + }); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminPermissionDefinitionProvider.cs b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminPermissionDefinitionProvider.cs new file mode 100644 index 00000000000..77c8f98e62c --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminPermissionDefinitionProvider.cs @@ -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(name); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminPermissions.cs b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminPermissions.cs new file mode 100644 index 00000000000..9150af601b6 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminPermissions.cs @@ -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)); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminRemoteServiceConsts.cs b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminRemoteServiceConsts.cs new file mode 100644 index 00000000000..1c4282adad8 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/BloggingAdminRemoteServiceConsts.cs @@ -0,0 +1,7 @@ +namespace Volo.Blogging.Admin +{ + public static class BloggingAdminRemoteServiceConsts + { + public const string RemoteServiceName = "BloggingAdmin"; + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/BlogDto.cs b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/BlogDto.cs new file mode 100644 index 00000000000..38b87e277ca --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/BlogDto.cs @@ -0,0 +1,14 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Volo.Blogging.Admin.Blogs +{ + public class BlogDto : FullAuditedEntityDto + { + public string Name { get; set; } + + public string ShortName { get; set; } + + public string Description { get; set; } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/CreateBlogDto.cs b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/CreateBlogDto.cs similarity index 82% rename from modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/CreateBlogDto.cs rename to modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/CreateBlogDto.cs index 802e271e33a..5f473114041 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/CreateBlogDto.cs +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/CreateBlogDto.cs @@ -1,4 +1,4 @@ -namespace Volo.Blogging.Blogs.Dtos +namespace Volo.Blogging.Admin.Blogs { public class CreateBlogDto { @@ -8,4 +8,4 @@ public class CreateBlogDto public string Description { get; set; } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/IBlogManagementAppService.cs b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/IBlogManagementAppService.cs new file mode 100644 index 00000000000..3554413d5f8 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/IBlogManagementAppService.cs @@ -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> GetListAsync(); + + Task GetAsync(Guid id); + + Task CreateAsync(CreateBlogDto input); + + Task UpdateAsync(Guid id, UpdateBlogDto input); + + Task DeleteAsync(Guid id); + } +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/UpdateBlogDto.cs b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/UpdateBlogDto.cs similarity index 81% rename from modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/UpdateBlogDto.cs rename to modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/UpdateBlogDto.cs index 2e3b0b7b4e0..529ace6e0d5 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/UpdateBlogDto.cs +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Blogs/UpdateBlogDto.cs @@ -1,4 +1,4 @@ -namespace Volo.Blogging.Blogs.Dtos +namespace Volo.Blogging.Admin.Blogs { public class UpdateBlogDto { @@ -8,4 +8,4 @@ public class UpdateBlogDto public string Description { get; set; } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/cs.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/cs.json new file mode 100644 index 00000000000..1c8657c85c4 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/cs.json @@ -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" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/de.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/de.json new file mode 100644 index 00000000000..5666cbb3688 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/de.json @@ -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" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/en.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/en.json new file mode 100644 index 00000000000..f3708eacad3 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/en.json @@ -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" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/nl.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/nl.json new file mode 100644 index 00000000000..c1174611c1e --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/nl.json @@ -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" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/pl-PL.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/pl-PL.json new file mode 100644 index 00000000000..e8f61354563 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/pl-PL.json @@ -0,0 +1,11 @@ +{ + "culture": "pl-PL", + "texts": { + "Permission:BloggingAdmin": "Blog", + "Permission:Blogs": "Blogi", + "Permission:Management": "Zarządzanie", + "Permission:Edit": "Edytuj", + "Permission:Create": "Utwórz", + "Permission:Delete": "Usuń" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/pt-BR.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/pt-BR.json new file mode 100644 index 00000000000..09fd08fe5ac --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/pt-BR.json @@ -0,0 +1,11 @@ +{ + "culture": "pt-BR", + "texts": { + "Permission:BloggingAdmin": "Blog", + "Permission:Blogs": "Blogs", + "Permission:Management": "Gerenciamento", + "Permission:Edit": "Editar", + "Permission:Create": "Criar", + "Permission:Delete": "Excluir" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/sl.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/sl.json new file mode 100644 index 00000000000..455c49008ca --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/sl.json @@ -0,0 +1,11 @@ +{ + "culture": "sl", + "texts": { + "Permission:BloggingAdmin": "Blog", + "Permission:Blogs": "Blogi", + "Permission:Management": "Upravljanje", + "Permission:Edit": "Urejanje", + "Permission:Create": "Ustvarjanje", + "Permission:Delete": "Brisanje" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/tr.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/tr.json new file mode 100644 index 00000000000..dedb5d3dd6e --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/tr.json @@ -0,0 +1,11 @@ +{ + "culture": "tr", + "texts": { + "Permission:BloggingAdmin": "Blog", + "Permission:Blogs": "Bloglar", + "Permission:Management": "Yönetme", + "Permission:Edit": "Düzenle", + "Permission:Create": "Ekle", + "Permission:Delete": "Sil" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/vi.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/vi.json new file mode 100644 index 00000000000..387083b1005 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/vi.json @@ -0,0 +1,11 @@ +{ + "culture": "vi", + "texts": { + "Permission:BloggingAdmin": "Blog", + "Permission:Blogs": "Blogs", + "Permission:Management": "Quản lý", + "Permission:Edit": "Sửa", + "Permission:Create": "Tạo", + "Permission:Delete": "Xóa" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/zh-Hans.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/zh-Hans.json new file mode 100644 index 00000000000..a17bb45c097 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/zh-Hans.json @@ -0,0 +1,11 @@ +{ + "culture": "zh-Hans", + "texts": { + "Permission:BloggingAdmin": "博客", + "Permission:Blogs": "博客", + "Permission:Management": "管理", + "Permission:Edit": "编辑", + "Permission:Create": "创建", + "Permission:Delete": "删除" + } + } diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/zh-Hant.json b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/zh-Hant.json new file mode 100644 index 00000000000..2d2d28dcbba --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application.Contracts/Volo/Blogging/Admin/Localization/Resources/Blogging/Admin/ApplicationContracts/zh-Hant.json @@ -0,0 +1,11 @@ +{ + "culture": "zh-Hant", + "texts": { + "Permission:BloggingAdmin": "部落格", + "Permission:Blogs": "部落格", + "Permission:Management": "管理", + "Permission:Edit": "標及", + "Permission:Create": "新增", + "Permission:Delete": "刪除" + } + } diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/FodyWeavers.xml b/modules/blogging/src/Volo.Blogging.Admin.Application/FodyWeavers.xml new file mode 100644 index 00000000000..be0de3a9084 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/FodyWeavers.xsd b/modules/blogging/src/Volo.Blogging.Admin.Application/FodyWeavers.xsd new file mode 100644 index 00000000000..3f3946e282d --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj new file mode 100644 index 00000000000..cf5354adb95 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo.Blogging.Admin.Application.csproj @@ -0,0 +1,20 @@ + + + + + + + netstandard2.0 + Volo.Blogging.Admin.Application + Volo.Blogging.Admin.Application + + + + + + + + + + + diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminAppServiceBase.cs b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminAppServiceBase.cs new file mode 100644 index 00000000000..4e8ff9d3151 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminAppServiceBase.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Application.Services; +using Volo.Blogging.Localization; + +namespace Volo.Blogging.Admin +{ + public abstract class BloggingAdminAppServiceBase : ApplicationService + { + protected BloggingAdminAppServiceBase() + { + ObjectMapperContext = typeof(BloggingAdminApplicationModule); + LocalizationResource = typeof(BloggingResource); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationAutoMapperProfile.cs b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationAutoMapperProfile.cs new file mode 100644 index 00000000000..2f2cf745630 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationAutoMapperProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using Volo.Blogging.Admin.Blogs; +using Volo.Blogging.Blogs; + +namespace Volo.Blogging.Admin +{ + public class BloggingAdminApplicationAutoMapperProfile : Profile + { + public BloggingAdminApplicationAutoMapperProfile() + { + CreateMap(); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationModule.cs b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationModule.cs new file mode 100644 index 00000000000..2de8b3af07a --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/BloggingAdminApplicationModule.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Caching; +using Volo.Abp.Modularity; +using Volo.Blogging.Comments; +using Volo.Blogging.Posts; + +namespace Volo.Blogging.Admin +{ + [DependsOn( + typeof(BloggingDomainModule), + typeof(BloggingAdminApplicationContractsModule), + typeof(AbpCachingModule), + typeof(AbpAutoMapperModule))] + public class BloggingAdminApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddProfile(validate: true); + }); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/Blogs/BlogManagementAppService.cs b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/Blogs/BlogManagementAppService.cs new file mode 100644 index 00000000000..1df6f52c9b0 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Application/Volo/Blogging/Admin/Blogs/BlogManagementAppService.cs @@ -0,0 +1,64 @@ +using Microsoft.AspNetCore.Authorization; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Blogging.Blogs; + +namespace Volo.Blogging.Admin.Blogs +{ + public class BlogManagementAppService : BloggingAdminAppServiceBase, IBlogManagementAppService + { + private readonly IBlogRepository _blogRepository; + + public BlogManagementAppService(IBlogRepository blogRepository) + { + _blogRepository = blogRepository; + } + + public async Task> GetListAsync() + { + var blogs = await _blogRepository.GetListAsync(); + + return new ListResultDto( + ObjectMapper.Map, List>(blogs) + ); + } + + public async Task GetAsync(Guid id) + { + var blog = await _blogRepository.GetAsync(id); + + return ObjectMapper.Map(blog); + } + + [Authorize(BloggingAdminPermissions.Blogs.Create)] + public async Task CreateAsync(CreateBlogDto input) + { + var newBlog = await _blogRepository.InsertAsync(new Blog(GuidGenerator.Create(), input.Name, input.ShortName) + { + Description = input.Description + }); + + return ObjectMapper.Map(newBlog); + } + + [Authorize(BloggingAdminPermissions.Blogs.Update)] + public async Task UpdateAsync(Guid id, UpdateBlogDto input) + { + var blog = await _blogRepository.GetAsync(id); + + blog.SetName(input.Name); + blog.SetShortName(input.ShortName); + blog.Description = input.Description; + + return ObjectMapper.Map(blog); + } + + [Authorize(BloggingAdminPermissions.Blogs.Delete)] + public async Task DeleteAsync(Guid id) + { + await _blogRepository.DeleteAsync(id); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/FodyWeavers.xml b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/FodyWeavers.xml new file mode 100644 index 00000000000..be0de3a9084 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/FodyWeavers.xsd b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/FodyWeavers.xsd new file mode 100644 index 00000000000..3f3946e282d --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo.Blogging.Admin.HttpApi.Client.csproj b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo.Blogging.Admin.HttpApi.Client.csproj new file mode 100644 index 00000000000..55b11f728d2 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo.Blogging.Admin.HttpApi.Client.csproj @@ -0,0 +1,18 @@ + + + + + + + netstandard2.0 + Volo.Blogging.Admin.HttpApi.Client + Volo.Blogging.Admin.HttpApi.Client + + + + + + + + + diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo/Blogging/Admin/BloggingAdminHttpApiClientModule.cs b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo/Blogging/Admin/BloggingAdminHttpApiClientModule.cs new file mode 100644 index 00000000000..9ccb1b5d15d --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client/Volo/Blogging/Admin/BloggingAdminHttpApiClientModule.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Modularity; + +namespace Volo.Blogging.Admin +{ + [DependsOn( + typeof(BloggingAdminApplicationContractsModule), + typeof(AbpHttpClientModule))] + public class BloggingAdminHttpApiClientModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies(typeof(BloggingAdminApplicationContractsModule).Assembly, + BloggingAdminRemoteServiceConsts.RemoteServiceName); + } + + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi/FodyWeavers.xml b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/FodyWeavers.xml new file mode 100644 index 00000000000..be0de3a9084 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi/FodyWeavers.xsd b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/FodyWeavers.xsd new file mode 100644 index 00000000000..3f3946e282d --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi/Volo.Blogging.Admin.HttpApi.csproj b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/Volo.Blogging.Admin.HttpApi.csproj new file mode 100644 index 00000000000..e9435610dfd --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/Volo.Blogging.Admin.HttpApi.csproj @@ -0,0 +1,18 @@ + + + + + + + netcoreapp3.1 + Volo.Blogging.Admin.HttpApi + Volo.Blogging.Admin.HttpApi + + + + + + + + + diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi/Volo/Blogging/Admin/BlogManagementController.cs b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/Volo/Blogging/Admin/BlogManagementController.cs new file mode 100644 index 00000000000..782a05a42e9 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/Volo/Blogging/Admin/BlogManagementController.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Blogging.Admin.Blogs; + +namespace Volo.Blogging.Admin +{ + [RemoteService(Name = BloggingAdminRemoteServiceConsts.RemoteServiceName)] + [Area("bloggingAdmin")] + [Route("api/blogging/blogs/admin")] + public class BlogManagementController : AbpController, IBlogManagementAppService + { + private readonly IBlogManagementAppService _blogManagementAppService; + + public BlogManagementController(IBlogManagementAppService blogManagementAppService) + { + _blogManagementAppService = blogManagementAppService; + } + + [HttpGet] + public async Task> GetListAsync() + { + return await _blogManagementAppService.GetListAsync(); + } + + [HttpGet] + [Route("{id}")] + public async Task GetAsync(Guid id) + { + return await _blogManagementAppService.GetAsync(id); + } + + [HttpPost] + public async Task CreateAsync(CreateBlogDto input) + { + return await _blogManagementAppService.CreateAsync(input); + } + + [HttpPut] + [Route("{id}")] + public async Task UpdateAsync(Guid id, UpdateBlogDto input) + { + return await _blogManagementAppService.UpdateAsync(id, input); + } + + [HttpDelete] + [Route("{id}")] + public async Task DeleteAsync(Guid id) + { + await _blogManagementAppService.DeleteAsync(id); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.HttpApi/Volo/Blogging/Admin/BloggingAdminHttpApiModule.cs b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/Volo/Blogging/Admin/BloggingAdminHttpApiModule.cs new file mode 100644 index 00000000000..bd88cc14d5e --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.HttpApi/Volo/Blogging/Admin/BloggingAdminHttpApiModule.cs @@ -0,0 +1,33 @@ +using Localization.Resources.AbpUi; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Blogging.Localization; +using Microsoft.Extensions.DependencyInjection; + +namespace Volo.Blogging.Admin +{ + [DependsOn( + typeof(BloggingAdminApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] + public class BloggingAdminHttpApiModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(BloggingAdminHttpApiModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/AbpBloggingAdminWebAutoMapperProfile.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/AbpBloggingAdminWebAutoMapperProfile.cs new file mode 100644 index 00000000000..082daf9bae8 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/AbpBloggingAdminWebAutoMapperProfile.cs @@ -0,0 +1,16 @@ +using AutoMapper; +using Volo.Blogging.Admin.Blogs; +using Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs; +using EditModel = Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs.EditModel; + +namespace Volo.Blogging.Admin +{ + public class AbpBloggingAdminWebAutoMapperProfile : Profile + { + public AbpBloggingAdminWebAutoMapperProfile() + { + CreateMap(); + CreateMap(); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminMenuContributor.cs similarity index 58% rename from modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs rename to modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminMenuContributor.cs index cac26eb3124..00587382995 100644 --- a/modules/blogging/src/Volo.Blogging.Web/BloggingMenuContributor.cs +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminMenuContributor.cs @@ -1,13 +1,10 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Localization; -using System.Threading.Tasks; +using System.Threading.Tasks; using Volo.Abp.UI.Navigation; using Volo.Blogging.Localization; -namespace Volo.Blogging +namespace Volo.Blogging.Admin { - public class BloggingMenuContributor : IMenuContributor + public class BloggingAdminMenuContributor : IMenuContributor { public async Task ConfigureMenuAsync(MenuConfigurationContext context) { @@ -21,17 +18,17 @@ private async Task ConfigureMainMenu(MenuConfigurationContext context) { var l = context.GetLocalizer(); - if (await context.IsGrantedAsync(BloggingPermissions.Blogs.Management)) + if (await context.IsGrantedAsync(BloggingAdminPermissions.Blogs.Management)) { var managementRootMenuItem = new ApplicationMenuItem("BlogManagement", l["Menu:BlogManagement"]); //TODO: Using the same permission. Reconsider. - if (await context.IsGrantedAsync(BloggingPermissions.Blogs.Management)) + if (await context.IsGrantedAsync(BloggingAdminPermissions.Blogs.Management)) { - managementRootMenuItem.AddItem(new ApplicationMenuItem("BlogManagement.Blogs", l["Menu:Blogs"], "~/Admin/Blogs")); + managementRootMenuItem.AddItem(new ApplicationMenuItem("BlogManagement.Blogs", l["Menu:Blogs"], "~/Blogging/Admin/Blogs")); } - context.Menu.AddItem(managementRootMenuItem); + context.Menu.GetAdministration().AddItem(managementRootMenuItem); } } } diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminWebModule.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminWebModule.cs new file mode 100644 index 00000000000..f62333fb02b --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/BloggingAdminWebModule.cs @@ -0,0 +1,53 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; +using Volo.Abp.VirtualFileSystem; +using Volo.Blogging.Localization; + +namespace Volo.Blogging.Admin +{ + [DependsOn( + typeof(BloggingAdminHttpApiModule), + typeof(AbpAspNetCoreMvcUiBootstrapModule), + typeof(AbpAspNetCoreMvcUiBundlingModule), + typeof(AbpAutoMapperModule) + )] + public class BloggingAdminWebModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.PreConfigure(options => + { + options.AddAssemblyResource(typeof(BloggingResource), typeof(BloggingAdminWebModule).Assembly); + }); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(BloggingAdminWebModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.MenuContributors.Add(new BloggingAdminMenuContributor()); + }); + + Configure(options => + { + options.FileSets.AddEmbedded("Volo.Blogging.Admin"); + }); + + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddProfile(validate: true); + }); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xml b/modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xml new file mode 100644 index 00000000000..be0de3a9084 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xsd b/modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xsd new file mode 100644 index 00000000000..3f3946e282d --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml similarity index 79% rename from modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml rename to modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml index ec34de5f296..466c6b9578b 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml @@ -1,7 +1,7 @@ @page @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal -@using Volo.Blogging.Pages.Blog -@model Volo.Blogging.Pages.Admin.Blogs.CreateModel +@inherits Volo.Blogging.Admin.Pages.Blogging.BloggingAdminPage +@model Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs.CreateModel @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Blogging.Localization @inject IHtmlLocalizer L @@ -10,7 +10,7 @@ } - + diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml.cs similarity index 69% rename from modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs rename to modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml.cs index f8c40a1b01b..b2d89fbd557 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Create.cshtml.cs @@ -2,23 +2,20 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Blogging.Admin.Blogs; using Volo.Blogging.Blogs; -using Volo.Blogging.Blogs.Dtos; -using Volo.Blogging.Pages.Blog; -namespace Volo.Blogging.Pages.Admin.Blogs +namespace Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs { - public class CreateModel : BloggingPageModel + public class CreateModel : BloggingAdminPageModel { - private readonly IBlogAppService _blogAppService; + private readonly IBlogManagementAppService _blogAppService; private readonly IAuthorizationService _authorization; [BindProperty] public BlogCreateModalView Blog { get; set; } = new BlogCreateModalView(); - public CreateModel(IBlogAppService blogAppService, IAuthorizationService authorization) + public CreateModel(IBlogManagementAppService blogAppService, IAuthorizationService authorization) { _blogAppService = blogAppService; _authorization = authorization; @@ -26,7 +23,7 @@ public CreateModel(IBlogAppService blogAppService, IAuthorizationService authori public virtual async Task OnGetAsync() { - if (!await _authorization.IsGrantedAsync(BloggingPermissions.Blogs.Create)) + if (!await _authorization.IsGrantedAsync(BloggingAdminPermissions.Blogs.Create)) { return Redirect("/"); } @@ -38,7 +35,7 @@ public virtual async Task OnPostAsync() { var blogDto = ObjectMapper.Map(Blog); - await _blogAppService.Create(blogDto); + await _blogAppService.CreateAsync(blogDto); return NoContent(); } @@ -59,4 +56,4 @@ public class BlogCreateModalView } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml similarity index 73% rename from modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml rename to modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml index 0d969aa8add..7bd42e8549b 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml @@ -1,7 +1,7 @@ @page @using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal -@using Volo.Blogging.Pages.Blog -@model Volo.Blogging.Pages.Admin.Blogs.EditModel +@inherits Volo.Blogging.Admin.Pages.Blogging.BloggingAdminPage +@model Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs.EditModel @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Blogging.Localization @inject IHtmlLocalizer L @@ -9,8 +9,7 @@ Layout = null; } - - + diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml.cs similarity index 74% rename from modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs rename to modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml.cs index 9c407202618..536810e0158 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Edit.cshtml.cs @@ -1,20 +1,16 @@ using System; using System.ComponentModel.DataAnnotations; -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Blogging.Admin.Blogs; using Volo.Blogging.Blogs; -using Volo.Blogging.Blogs.Dtos; -using Volo.Blogging.Pages.Blog; -using Volo.Blogging.Posts; -namespace Volo.Blogging.Pages.Admin.Blogs +namespace Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs { - public class EditModel : BloggingPageModel + public class EditModel : BloggingAdminPageModel { - private readonly IBlogAppService _blogAppService; + private readonly IBlogManagementAppService _blogAppService; private readonly IAuthorizationService _authorization; [BindProperty(SupportsGet = true)] @@ -23,7 +19,7 @@ public class EditModel : BloggingPageModel [BindProperty] public BlogEditViewModel Blog { get; set; } = new BlogEditViewModel(); - public EditModel(IBlogAppService blogAppService, IAuthorizationService authorization) + public EditModel(IBlogManagementAppService blogAppService, IAuthorizationService authorization) { _blogAppService = blogAppService; _authorization = authorization; @@ -31,7 +27,7 @@ public EditModel(IBlogAppService blogAppService, IAuthorizationService authoriza public virtual async Task OnGetAsync() { - if (!await _authorization.IsGrantedAsync(BloggingPermissions.Blogs.Update)) + if (!await _authorization.IsGrantedAsync(BloggingAdminPermissions.Blogs.Update)) { return Redirect("/"); } @@ -45,7 +41,7 @@ public virtual async Task OnGetAsync() public virtual async Task OnPostAsync() { - await _blogAppService.Update(Blog.Id, new UpdateBlogDto() + await _blogAppService.UpdateAsync(Blog.Id, new UpdateBlogDto() { Name = Blog.Name, ShortName = Blog.ShortName, @@ -74,5 +70,5 @@ public class BlogEditViewModel } } - -} \ No newline at end of file + +} diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml similarity index 72% rename from modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml rename to modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml index 43b803aa814..bd0d4a0bfb0 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml @@ -1,10 +1,12 @@ @page @using Microsoft.AspNetCore.Authorization +@using Volo.Blogging.Admin +@using Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs @using Volo.Blogging -@using Volo.Blogging.Pages.Blog -@model Volo.Blogging.Pages.Admin.Blogs.IndexModel @using Microsoft.AspNetCore.Mvc.Localization @using Volo.Blogging.Localization +@inherits Volo.Blogging.Admin.Pages.Blogging.BloggingAdminPage +@model IndexModel @inject IHtmlLocalizer L @inject IAuthorizationService Authorization @{ @@ -12,9 +14,11 @@ } @section scripts { - - - + + + + + } @@ -24,7 +28,7 @@

@L["Blogs"]

- @if (await Authorization.IsGrantedAsync(BloggingPermissions.Blogs.Create)) + @if (await Authorization.IsGrantedAsync(BloggingAdminPermissions.Blogs.Create)) { } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml.cs similarity index 65% rename from modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml.cs rename to modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml.cs index 038f2e63f3d..22a09389ef3 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Index.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/Index.cshtml.cs @@ -1,12 +1,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; -using Volo.Blogging.Pages.Blog; -namespace Volo.Blogging.Pages.Admin.Blogs +namespace Volo.Blogging.Admin.Pages.Blogging.Admin.Blogs { - public class IndexModel : BloggingPageModel + public class IndexModel : BloggingAdminPageModel { private readonly IAuthorizationService _authorization; @@ -17,7 +15,7 @@ public IndexModel(IAuthorizationService authorization) public virtual async Task OnGetAsync() { - if (!await _authorization.IsGrantedAsync(BloggingPermissions.Blogs.Management)) + if (!await _authorization.IsGrantedAsync(BloggingAdminPermissions.Blogs.Management)) { return Redirect("/"); } @@ -25,4 +23,4 @@ public virtual async Task OnGetAsync() return Page(); } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/create.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js similarity index 100% rename from modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/create.js rename to modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/create.js diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/edit.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js similarity index 100% rename from modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/edit.js rename to modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/edit.js diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/index.js b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js similarity index 85% rename from modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/index.js rename to modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js index c2a18e083dd..a89f4cf9954 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/index.js +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/Blogging/Admin/Blogs/index.js @@ -1,8 +1,8 @@ $(function () { var l = abp.localization.getResource('Blogging'); - var _createModal = new abp.ModalManager(abp.appPath + 'Admin/Blogs/Create'); - var _editModal = new abp.ModalManager(abp.appPath + 'Admin/Blogs/Edit'); + var _createModal = new abp.ModalManager(abp.appPath + 'Blogging/Admin/Blogs/Create'); + var _editModal = new abp.ModalManager(abp.appPath + 'Blogging/Admin/Blogs/Edit'); var _dataTable = $('#BlogsTable').DataTable(abp.libs.datatables.normalizeConfiguration({ processing: true, @@ -14,7 +14,7 @@ autoWidth: false, scrollCollapse: true, order: [[3, "desc"]], - ajax: abp.libs.datatables.createAjax(volo.blogging.blogs.getList), + ajax: abp.libs.datatables.createAjax(volo.blogging.admin.blogManagement.getList), columnDefs: [ { rowAction: { @@ -22,7 +22,7 @@ [ { text: l('Edit'), - visible: abp.auth.isGranted('Blogging.Blog.Update'), + visible: abp.auth.isGranted('Blogging.Admin.Blog.Update'), action: function (data) { _editModal.open({ blogId: data.record.id @@ -31,10 +31,10 @@ }, { text: l('Delete'), - visible: abp.auth.isGranted('Blogging.Blog.Delete'), + visible: abp.auth.isGranted('Blogging.Admin.Blog.Delete'), confirmMessage: function (data) { return l('BlogDeletionWarningMessage') }, action: function (data) { - volo.blogging.blogs + volo.blogging.admin.blogManagement .delete(data.record.id) .then(function () { _dataTable.ajax.reload(); @@ -79,4 +79,4 @@ _dataTable.ajax.reload(); }); -}); \ No newline at end of file +}); diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPage.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPage.cs new file mode 100644 index 00000000000..819c3aa3cd4 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPage.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNetCore.Mvc.Localization; +using Microsoft.AspNetCore.Mvc.Razor.Internal; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Blogging.Localization; + +namespace Volo.Blogging.Admin.Pages.Blogging +{ + public abstract class BloggingAdminPage : AbpPage + { + [RazorInject] + public IHtmlLocalizer L { get; set; } + + public const string DefaultTitle = "Blogging"; + + public const int MaxShortContentLength = 200; + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPageModel.cs b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPageModel.cs new file mode 100644 index 00000000000..67951fc08bd --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/BloggingAdminPageModel.cs @@ -0,0 +1,12 @@ +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace Volo.Blogging.Admin.Pages +{ + public abstract class BloggingAdminPageModel : AbpPageModel + { + public BloggingAdminPageModel() + { + ObjectMapperContext = typeof(BloggingAdminWebModule); + } + } +} diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/_ViewImports.cshtml b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/_ViewImports.cshtml new file mode 100644 index 00000000000..caae8c9ac57 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Pages/_ViewImports.cshtml @@ -0,0 +1,5 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling +@addTagHelper *, Volo.Blogging.Web \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Properties/launchSettings.json b/modules/blogging/src/Volo.Blogging.Admin.Web/Properties/launchSettings.json new file mode 100644 index 00000000000..64a5fd912c7 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50000/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Blogging.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:50014/" + } + } +} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/Volo.Blogging.Admin.Web.csproj b/modules/blogging/src/Volo.Blogging.Admin.Web/Volo.Blogging.Admin.Web.csproj new file mode 100644 index 00000000000..d15cf9c770d --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/Volo.Blogging.Admin.Web.csproj @@ -0,0 +1,34 @@ + + + + + + + netcoreapp3.1 + Volo.Blogging.Admin.Web + Volo.Blogging.Admin.Web + 2.8 + Library + true + Volo.Blogging.Admin + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json b/modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json new file mode 100644 index 00000000000..d8e67fbecae --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json @@ -0,0 +1,18 @@ +[ + { + "outputFile": "Pages/Blog/Shared/Styles/blog.css", + "inputFile": "Pages/Blog/Shared/Styles/blog.scss" + }, + { + "outputFile": "Pages/Blog/Shared/Styles/_home.css", + "inputFile": "Pages/Blog/Shared/Styles/_home.scss" + }, + { + "outputFile": "Pages/Blog/Posts/Index.css", + "inputFile": "Pages/Blog/Posts/Index.scss" + }, + { + "outputFile": "Pages/Blogs/Shared/Styles/blog.css", + "inputFile": "Pages/Blogs/Shared/Styles/blog.scss" + } +] \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json.defaults b/modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json.defaults new file mode 100644 index 00000000000..c75eb7d519c --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Admin.Web/compilerconfig.json.defaults @@ -0,0 +1,49 @@ +{ + "compilers": { + "less": { + "autoPrefix": "", + "cssComb": "none", + "ieCompat": true, + "strictMath": false, + "strictUnits": false, + "relativeUrls": true, + "rootPath": "", + "sourceMapRoot": "", + "sourceMapBasePath": "", + "sourceMap": false + }, + "sass": { + "includePath": "", + "indentType": "space", + "indentWidth": 2, + "outputStyle": "nested", + "Precision": 5, + "relativeUrls": true, + "sourceMapRoot": "", + "sourceMap": false + }, + "stylus": { + "sourceMap": false + }, + "babel": { + "sourceMap": false + }, + "coffeescript": { + "bare": false, + "runtimeMode": "node", + "sourceMap": false + } + }, + "minifiers": { + "css": { + "enabled": true, + "termSemicolons": true, + "gzip": false + }, + "javascript": { + "enabled": true, + "termSemicolons": true, + "gzip": false + } + } +} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissionDefinitionProvider.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissionDefinitionProvider.cs index 65a6ab1ab73..6c2361230de 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissionDefinitionProvider.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissionDefinitionProvider.cs @@ -10,12 +10,6 @@ public override void Define(IPermissionDefinitionContext context) { var bloggingGroup = context.AddGroup(BloggingPermissions.GroupName, L("Permission:Blogging")); - var blogs = bloggingGroup.AddPermission(BloggingPermissions.Blogs.Default, L("Permission:Blogs")); - blogs.AddChild(BloggingPermissions.Blogs.Management, L("Permission:Management")); - blogs.AddChild(BloggingPermissions.Blogs.Update, L("Permission:Edit")); - blogs.AddChild(BloggingPermissions.Blogs.Delete, L("Permission:Delete")); - blogs.AddChild(BloggingPermissions.Blogs.Create, L("Permission:Create")); - var posts = bloggingGroup.AddPermission(BloggingPermissions.Posts.Default, L("Permission:Posts")); posts.AddChild(BloggingPermissions.Posts.Update, L("Permission:Edit")); posts.AddChild(BloggingPermissions.Posts.Delete, L("Permission:Delete")); diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissions.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissions.cs index fae85acf880..7aa05452e33 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissions.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/BloggingPermissions.cs @@ -6,15 +6,6 @@ public class BloggingPermissions { public const string GroupName = "Blogging"; - 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 class Posts { public const string Default = GroupName + ".Post"; diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/IBlogAppService.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/IBlogAppService.cs index fbac86d827a..0710101b93c 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/IBlogAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/IBlogAppService.cs @@ -13,11 +13,5 @@ public interface IBlogAppService : IApplicationService Task GetByShortNameAsync(string shortName); Task GetAsync(Guid id); - - Task Create(CreateBlogDto input); - - Task Update(Guid id, UpdateBlogDto input); - - Task Delete(Guid id); } } diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json index 5b11dd808cc..30063c1d6d2 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/cs.json @@ -5,10 +5,6 @@ "Permission:Blogs": "Blogy", "Permission:Posts": "Příspěvky", "Permission:Tags": "Tagy", - "Permission:Comments": "Komentáře", - "Permission:Management": "Správa", - "Permission:Edit": "Upravit", - "Permission:Create": "Vytvořit", - "Permission:Delete": "Smazat" + "Permission:Comments": "Komentáře" } } diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/de.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/de.json index 9455b3cd449..9f2a7d45107 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/de.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/de.json @@ -3,12 +3,8 @@ "texts": { "Permission:Blogging": "Blog", "Permission:Blogs": "Blogs", - "Permission:Posts": "Beitr�ge", + "Permission:Posts": "Beitr�ge", "Permission:Tags": "Tags", - "Permission:Comments": "Kommentare", - "Permission:Management": "Verwaltung", - "Permission:Edit": "Bearbeiten", - "Permission:Create": "Erstellen", - "Permission:Delete": "L�schen" + "Permission:Comments": "Kommentare" } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/en.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/en.json index 425f8733bb5..eb70a98276a 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/en.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/en.json @@ -5,10 +5,6 @@ "Permission:Blogs": "Blogs", "Permission:Posts": "Posts", "Permission:Tags": "Tags", - "Permission:Comments": "Comments", - "Permission:Management": "Management", - "Permission:Edit": "Edit", - "Permission:Create": "Create", - "Permission:Delete": "Delete" + "Permission:Comments": "Comments" } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/nl.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/nl.json index 7e34f16b79e..70440c84701 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/nl.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/nl.json @@ -5,10 +5,6 @@ "Permission:Blogs": "Blogs", "Permission:Posts": "Posts", "Permission:Tags": "Tags", - "Permission:Comments": "Kommentaar", - "Permission:Management": "Beheer", - "Permission:Edit": "Bewerk", - "Permission:Create": "Maak aan", - "Permission:Delete": "Verwijder" + "Permission:Comments": "Kommentaar" } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/pl-PL.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/pl-PL.json index 05ba8451c65..2a223d536bc 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/pl-PL.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/pl-PL.json @@ -5,10 +5,6 @@ "Permission:Blogs": "Blogi", "Permission:Posts": "Posty", "Permission:Tags": "Tagi", - "Permission:Comments": "Komentarze", - "Permission:Management": "Zarządzanie", - "Permission:Edit": "Edytuj", - "Permission:Create": "Utwórz", - "Permission:Delete": "Usuń" + "Permission:Comments": "Komentarze" } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/pt-BR.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/pt-BR.json index 364e0303e57..9dd2977079c 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/pt-BR.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/pt-BR.json @@ -5,10 +5,6 @@ "Permission:Blogs": "Blogs", "Permission:Posts": "Postagens", "Permission:Tags": "Etiquetas", - "Permission:Comments": "Comentários", - "Permission:Management": "Gerenciamento", - "Permission:Edit": "Editar", - "Permission:Create": "Criar", - "Permission:Delete": "Excluir" + "Permission:Comments": "Comentários" } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/sl.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/sl.json index a834583f0ad..cad2be999f8 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/sl.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/sl.json @@ -5,10 +5,6 @@ "Permission:Blogs": "Blogi", "Permission:Posts": "Objave", "Permission:Tags": "Oznake", - "Permission:Comments": "Komentarji", - "Permission:Management": "Upravljanje", - "Permission:Edit": "Urejanje", - "Permission:Create": "Ustvarjanje", - "Permission:Delete": "Brisanje" + "Permission:Comments": "Komentarji" } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/tr.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/tr.json index 9444a12b7b5..1d158bc6649 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/tr.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/tr.json @@ -5,10 +5,6 @@ "Permission:Blogs": "Bloglar", "Permission:Posts": "Yazılar", "Permission:Tags": "Etiketler", - "Permission:Comments": "Yorumlar", - "Permission:Management": "Yönetme", - "Permission:Edit": "Düzenle", - "Permission:Create": "Ekle", - "Permission:Delete": "Sil" + "Permission:Comments": "Yorumlar" } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/vi.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/vi.json index a32ee04bb9f..2f65d48fae6 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/vi.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/vi.json @@ -5,10 +5,6 @@ "Permission:Blogs": "Blogs", "Permission:Posts": "Bài viết", "Permission:Tags": "Thẻ", - "Permission:Comments": "Bình luận", - "Permission:Management": "Quản lý", - "Permission:Edit": "Sửa", - "Permission:Create": "Tạo", - "Permission:Delete": "Xóa" + "Permission:Comments": "Bình luận" } } diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/zh-Hans.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/zh-Hans.json index 16dd399bc0b..afc509cd353 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/zh-Hans.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/zh-Hans.json @@ -1,14 +1,10 @@ { - "culture": "zh-Hans", - "texts": { - "Permission:Blogging": "博客", - "Permission:Blogs": "博客", - "Permission:Posts": "帖子", - "Permission:Tags": "标签", - "Permission:Comments": "评论", - "Permission:Management": "管理", - "Permission:Edit": "编辑", - "Permission:Create": "创建", - "Permission:Delete": "删除" - } - } \ No newline at end of file + "culture": "zh-Hans", + "texts": { + "Permission:Blogging": "博客", + "Permission:Blogs": "博客", + "Permission:Posts": "帖子", + "Permission:Tags": "标签", + "Permission:Comments": "评论" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/zh-Hant.json b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/zh-Hant.json index bca246ba43b..487be120e5c 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/zh-Hant.json +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/zh-Hant.json @@ -1,14 +1,10 @@ { - "culture": "zh-Hant", - "texts": { - "Permission:Blogging": "部落格", - "Permission:Blogs": "部落格", - "Permission:Posts": "文章", - "Permission:Tags": "標籤", - "Permission:Comments": "評論", - "Permission:Management": "管理", - "Permission:Edit": "標及", - "Permission:Create": "新增", - "Permission:Delete": "刪除" - } - } \ No newline at end of file + "culture": "zh-Hant", + "texts": { + "Permission:Blogging": "部落格", + "Permission:Blogs": "部落格", + "Permission:Posts": "文章", + "Permission:Tags": "標籤", + "Permission:Comments": "評論" + } +} diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs index 88b9a754101..1b0a903d2e7 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs @@ -44,34 +44,5 @@ public async Task GetAsync(Guid id) return ObjectMapper.Map(blog); } - - [Authorize(BloggingPermissions.Blogs.Create)] - public async Task Create(CreateBlogDto input) - { - var newBlog = await _blogRepository.InsertAsync(new Blog(GuidGenerator.Create(), input.Name, input.ShortName) - { - Description = input.Description - }); - - return ObjectMapper.Map(newBlog); - } - - [Authorize(BloggingPermissions.Blogs.Update)] - public async Task Update(Guid id, UpdateBlogDto input) - { - var blog = await _blogRepository.GetAsync(id); - - blog.SetName(input.Name); - blog.SetShortName(input.ShortName); - blog.Description = input.Description; - - return ObjectMapper.Map(blog); - } - - [Authorize(BloggingPermissions.Blogs.Delete)] - public async Task Delete(Guid id) - { - await _blogRepository.DeleteAsync(id); - } } } diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json index 18f8e00c8a3..8ffe3d8fa72 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json @@ -2,7 +2,7 @@ "culture": "en", "texts": { "Menu:Blogs": "Blogs", - "Menu:BlogManagement": "Blog Management", + "Menu:BlogManagement": "Blogging", "Title": "Title", "Delete": "Delete", "Reply": "Reply", @@ -46,4 +46,4 @@ "ShareOn": "Share on", "TitleLengthWarning": "Keep your title size under 60 characters to be SEO friendly!" } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs index cb67ac3fb75..9ef141b3de1 100644 --- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs +++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/BlogsController.cs @@ -40,25 +40,5 @@ public async Task GetAsync(Guid id) { return await _blogAppService.GetAsync(id); } - - [HttpPost] - public async Task Create(CreateBlogDto input) - { - return await _blogAppService.Create(input); - } - - [HttpPut] - [Route("{id}")] - public async Task Update(Guid id, UpdateBlogDto input) - { - return await _blogAppService.Update(id, input); - } - - [HttpDelete] - [Route("{id}")] - public async Task Delete(Guid id) - { - await _blogAppService.Delete(id); - } } } diff --git a/modules/blogging/src/Volo.Blogging.Web/AbpBloggingWebAutoMapperProfile.cs b/modules/blogging/src/Volo.Blogging.Web/AbpBloggingWebAutoMapperProfile.cs index ccd4a029535..e5d40c6be3f 100644 --- a/modules/blogging/src/Volo.Blogging.Web/AbpBloggingWebAutoMapperProfile.cs +++ b/modules/blogging/src/Volo.Blogging.Web/AbpBloggingWebAutoMapperProfile.cs @@ -1,12 +1,7 @@ using AutoMapper; using Volo.Abp.AutoMapper; -using Volo.Blogging.Blogs; -using Volo.Blogging.Blogs.Dtos; -using Volo.Blogging.Pages.Admin.Blogs; using Volo.Blogging.Pages.Blog.Posts; using Volo.Blogging.Posts; -using EditModel = Volo.Blogging.Pages.Admin.Blogs.EditModel; -using IndexModel = Volo.Blogging.Pages.Blog.IndexModel; namespace Volo.Blogging { @@ -16,8 +11,6 @@ public AbpBloggingWebAutoMapperProfile() { CreateMap().Ignore(x=>x.Tags); CreateMap(); - CreateMap(); - CreateMap(); } } } diff --git a/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs b/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs index 432857686f7..e238f48a370 100644 --- a/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs +++ b/modules/blogging/src/Volo.Blogging.Web/BloggingWebModule.cs @@ -37,11 +37,6 @@ public override void PreConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context) { - Configure(options => - { - options.MenuContributors.Add(new BloggingMenuContributor()); - }); - Configure(options => { options.FileSets.AddEmbedded("Volo.Blogging"); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Index.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Index.cshtml.cs index 2835b05dc5a..32a451c8be1 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Index.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Index.cshtml.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; @@ -34,4 +33,4 @@ public virtual async Task OnGetAsync() return Page(); } } -} \ No newline at end of file +} diff --git a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo.Blogging.Application.Tests.csproj b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo.Blogging.Application.Tests.csproj index e41384500bc..2bc4009d261 100644 --- a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo.Blogging.Application.Tests.csproj +++ b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo.Blogging.Application.Tests.csproj @@ -11,6 +11,7 @@ + diff --git a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BlogAppService_Tests.cs b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BlogAppService_Tests.cs index 7c67db978be..8726330b393 100644 --- a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BlogAppService_Tests.cs +++ b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BlogAppService_Tests.cs @@ -1,13 +1,9 @@ -using System; -using System.Linq; +using System.Linq; using System.Threading.Tasks; using Shouldly; using Volo.Blogging.Blogs; -using Volo.Blogging.Blogs.Dtos; -using Volo.Blogging.Comments; -using Volo.Blogging.Comments.Dtos; using Volo.Blogging.Pages.Blogs.Shared.Helpers; -using Volo.Blogging.Posts; +using Volo.Blogging.Admin.Blogs; using Xunit; namespace Volo.Blogging @@ -15,11 +11,13 @@ namespace Volo.Blogging public class BlogAppService_Tests : BloggingApplicationTestBase { private readonly IBlogAppService _blogAppService; + private readonly IBlogManagementAppService _blogManagementAppService; private readonly IBlogRepository _blogRepository; public BlogAppService_Tests() { _blogAppService = GetRequiredService(); + _blogManagementAppService = GetRequiredService(); _blogRepository = GetRequiredService(); } @@ -68,7 +66,7 @@ public async Task Should_Create_A_Blog() var shortName = "test shortName"; var description = "test description"; - var blogDto = await _blogAppService.Create(new CreateBlogDto() { Name = name, ShortName = name, Description = description }); + var blogDto = await _blogManagementAppService.CreateAsync(new CreateBlogDto() { Name = name, ShortName = name, Description = description }); UsingDbContext(context => { @@ -85,9 +83,9 @@ public async Task Should_Update_A_Blog() { var newDescription = "new description"; - var oldBlog = (await _blogRepository.GetListAsync()).FirstOrDefault(); ; + var oldBlog = (await _blogManagementAppService.GetListAsync()).Items.FirstOrDefault(); ; - await _blogAppService.Update(oldBlog.Id, new UpdateBlogDto() + await _blogManagementAppService.UpdateAsync(oldBlog.Id, new UpdateBlogDto() { Description = newDescription, Name = oldBlog.Name, ShortName = oldBlog.ShortName }); UsingDbContext(context => @@ -102,7 +100,7 @@ public async Task Should_Delete_A_Blog() { var blog = (await _blogRepository.GetListAsync()).First(); - await _blogAppService.Delete(blog.Id); + await _blogManagementAppService.DeleteAsync(blog.Id); } } } diff --git a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BloggingApplicationTestModule.cs b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BloggingApplicationTestModule.cs index ab2cbd12dd6..fb3934ee5f8 100644 --- a/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BloggingApplicationTestModule.cs +++ b/modules/blogging/test/Volo.Blogging.Application.Tests/Volo/Blogging/BloggingApplicationTestModule.cs @@ -1,11 +1,13 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; +using Volo.Blogging.Admin; using Volo.Blogging.EntityFrameworkCore; namespace Volo.Blogging { [DependsOn( typeof(BloggingApplicationModule), + typeof(BloggingAdminApplicationModule), typeof(BloggingEntityFrameworkCoreTestModule), typeof(BloggingTestBaseModule))] public class BloggingApplicationTestModule : AbpModule diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index 8fc6f7c06c1..aa773a77555 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -147,6 +147,11 @@ $projects = ( "modules/blogging/src/Volo.Blogging.HttpApi", "modules/blogging/src/Volo.Blogging.MongoDB", "modules/blogging/src/Volo.Blogging.Web", + "modules/blogging/src/Volo.Blogging.Admin.Application", + "modules/blogging/src/Volo.Blogging.Admin.Application.Contracts", + "modules/blogging/src/Volo.Blogging.Admin.HttpApi", + "modules/blogging/src/Volo.Blogging.Admin.HttpApi.Client", + "modules/blogging/src/Volo.Blogging.Admin.Web", # modules/client-simulation "modules/client-simulation/src/Volo.ClientSimulation",