mirror of https://github.com/abpframework/abp.git
committed by
GitHub
86 changed files with 1118 additions and 254 deletions
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -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> |
|||
@ -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"); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -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); |
|||
} |
|||
} |
|||
} |
|||
@ -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)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
namespace Volo.Blogging.Admin |
|||
{ |
|||
public static class BloggingAdminRemoteServiceConsts |
|||
{ |
|||
public const string RemoteServiceName = "BloggingAdmin"; |
|||
} |
|||
} |
|||
@ -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; } |
|||
} |
|||
} |
|||
@ -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); |
|||
} |
|||
} |
|||
@ -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" |
|||
} |
|||
} |
|||
@ -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" |
|||
} |
|||
} |
|||
@ -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" |
|||
} |
|||
} |
|||
@ -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" |
|||
} |
|||
} |
|||
@ -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ń" |
|||
} |
|||
} |
|||
@ -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" |
|||
} |
|||
} |
|||
@ -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" |
|||
} |
|||
} |
|||
@ -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" |
|||
} |
|||
} |
|||
@ -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" |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"Permission:BloggingAdmin": "博客", |
|||
"Permission:Blogs": "博客", |
|||
"Permission:Management": "管理", |
|||
"Permission:Edit": "编辑", |
|||
"Permission:Create": "创建", |
|||
"Permission:Delete": "删除" |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
{ |
|||
"culture": "zh-Hant", |
|||
"texts": { |
|||
"Permission:BloggingAdmin": "部落格", |
|||
"Permission:Blogs": "部落格", |
|||
"Permission:Management": "管理", |
|||
"Permission:Edit": "標及", |
|||
"Permission:Create": "新增", |
|||
"Permission:Delete": "刪除" |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -0,0 +1,20 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Blogging.Admin.Application</AssemblyName> |
|||
<PackageId>Volo.Blogging.Admin.Application</PackageId> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="System.Drawing.Common" Version="4.7.0" /> |
|||
<ProjectReference Include="..\Volo.Blogging.Admin.Application.Contracts\Volo.Blogging.Admin.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\Volo.Blogging.Domain\Volo.Blogging.Domain.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Caching\Volo.Abp.Caching.csproj" /> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -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); |
|||
} |
|||
} |
|||
} |
|||
@ -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<Blog, BlogDto>(); |
|||
} |
|||
} |
|||
} |
|||
@ -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<BloggingAdminApplicationModule>(); |
|||
Configure<AbpAutoMapperOptions>(options => |
|||
{ |
|||
options.AddProfile<BloggingAdminApplicationAutoMapperProfile>(validate: true); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -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<ListResultDto<BlogDto>> GetListAsync() |
|||
{ |
|||
var blogs = await _blogRepository.GetListAsync(); |
|||
|
|||
return new ListResultDto<BlogDto>( |
|||
ObjectMapper.Map<List<Blog>, List<BlogDto>>(blogs) |
|||
); |
|||
} |
|||
|
|||
public async Task<BlogDto> GetAsync(Guid id) |
|||
{ |
|||
var blog = await _blogRepository.GetAsync(id); |
|||
|
|||
return ObjectMapper.Map<Blog, BlogDto>(blog); |
|||
} |
|||
|
|||
[Authorize(BloggingAdminPermissions.Blogs.Create)] |
|||
public async Task<BlogDto> CreateAsync(CreateBlogDto input) |
|||
{ |
|||
var newBlog = await _blogRepository.InsertAsync(new Blog(GuidGenerator.Create(), input.Name, input.ShortName) |
|||
{ |
|||
Description = input.Description |
|||
}); |
|||
|
|||
return ObjectMapper.Map<Blog, BlogDto>(newBlog); |
|||
} |
|||
|
|||
[Authorize(BloggingAdminPermissions.Blogs.Update)] |
|||
public async Task<BlogDto> 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, BlogDto>(blog); |
|||
} |
|||
|
|||
[Authorize(BloggingAdminPermissions.Blogs.Delete)] |
|||
public async Task DeleteAsync(Guid id) |
|||
{ |
|||
await _blogRepository.DeleteAsync(id); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -0,0 +1,18 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Blogging.Admin.HttpApi.Client</AssemblyName> |
|||
<PackageId>Volo.Blogging.Admin.HttpApi.Client</PackageId> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Blogging.Admin.Application.Contracts\Volo.Blogging.Admin.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Http.Client\Volo.Abp.Http.Client.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -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); |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -0,0 +1,18 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp3.1</TargetFramework> |
|||
<AssemblyName>Volo.Blogging.Admin.HttpApi</AssemblyName> |
|||
<PackageId>Volo.Blogging.Admin.HttpApi</PackageId> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Blogging.Admin.Application.Contracts\Volo.Blogging.Admin.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -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<ListResultDto<BlogDto>> GetListAsync() |
|||
{ |
|||
return await _blogManagementAppService.GetListAsync(); |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
public async Task<BlogDto> GetAsync(Guid id) |
|||
{ |
|||
return await _blogManagementAppService.GetAsync(id); |
|||
} |
|||
|
|||
[HttpPost] |
|||
public async Task<BlogDto> CreateAsync(CreateBlogDto input) |
|||
{ |
|||
return await _blogManagementAppService.CreateAsync(input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("{id}")] |
|||
public async Task<BlogDto> UpdateAsync(Guid id, UpdateBlogDto input) |
|||
{ |
|||
return await _blogManagementAppService.UpdateAsync(id, input); |
|||
} |
|||
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
public async Task DeleteAsync(Guid id) |
|||
{ |
|||
await _blogManagementAppService.DeleteAsync(id); |
|||
} |
|||
} |
|||
} |
|||
@ -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<IMvcBuilder>(mvcBuilder => |
|||
{ |
|||
mvcBuilder.AddApplicationPartIfNotExists(typeof(BloggingAdminHttpApiModule).Assembly); |
|||
}); |
|||
} |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources |
|||
.Get<BloggingResource>() |
|||
.AddBaseTypes(typeof(AbpUiResource)); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -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<CreateModel.BlogCreateModalView, CreateBlogDto>(); |
|||
CreateMap<BlogDto, EditModel.BlogEditViewModel>(); |
|||
} |
|||
} |
|||
} |
|||
@ -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<AbpMvcDataAnnotationsLocalizationOptions>(options => |
|||
{ |
|||
options.AddAssemblyResource(typeof(BloggingResource), typeof(BloggingAdminWebModule).Assembly); |
|||
}); |
|||
|
|||
PreConfigure<IMvcBuilder>(mvcBuilder => |
|||
{ |
|||
mvcBuilder.AddApplicationPartIfNotExists(typeof(BloggingAdminWebModule).Assembly); |
|||
}); |
|||
} |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpNavigationOptions>(options => |
|||
{ |
|||
options.MenuContributors.Add(new BloggingAdminMenuContributor()); |
|||
}); |
|||
|
|||
Configure<AbpVirtualFileSystemOptions>(options => |
|||
{ |
|||
options.FileSets.AddEmbedded<BloggingAdminWebModule>("Volo.Blogging.Admin"); |
|||
}); |
|||
|
|||
context.Services.AddAutoMapperObjectMapper<BloggingAdminWebModule>(); |
|||
Configure<AbpAutoMapperOptions>(options => |
|||
{ |
|||
options.AddProfile<AbpBloggingAdminWebAutoMapperProfile>(validate: true); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -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<BloggingResource> L { get; set; } |
|||
|
|||
public const string DefaultTitle = "Blogging"; |
|||
|
|||
public const int MaxShortContentLength = 200; |
|||
} |
|||
} |
|||
@ -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); |
|||
} |
|||
} |
|||
} |
|||
@ -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 |
|||
@ -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/" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp3.1</TargetFramework> |
|||
<AssemblyName>Volo.Blogging.Admin.Web</AssemblyName> |
|||
<PackageId>Volo.Blogging.Admin.Web</PackageId> |
|||
<TypeScriptToolsVersion>2.8</TypeScriptToolsVersion> |
|||
<OutputType>Library</OutputType> |
|||
<IsPackable>true</IsPackable> |
|||
<RootNamespace>Volo.Blogging.Admin</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Packages\Volo.Abp.AspNetCore.Mvc.UI.Packages.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Bundling\Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" /> |
|||
<ProjectReference Include="..\Volo.Blogging.Admin.HttpApi\Volo.Blogging.Admin.HttpApi.csproj" /> |
|||
<PackageReference Include="Markdig.Signed" Version="0.18.0" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<EmbeddedResource Include="Pages\**\*.js" /> |
|||
<EmbeddedResource Include="Pages\**\*.css" /> |
|||
<Content Remove="Pages\**\*.js" /> |
|||
<Content Remove="Pages\**\*.css" /> |
|||
<Content Remove="compilerconfig.json" /> |
|||
<Content Remove="Properties\launchSettings.json" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -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" |
|||
} |
|||
] |
|||
@ -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 |
|||
} |
|||
} |
|||
} |
|||
@ -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": "删除" |
|||
} |
|||
} |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"Permission:Blogging": "博客", |
|||
"Permission:Blogs": "博客", |
|||
"Permission:Posts": "帖子", |
|||
"Permission:Tags": "标签", |
|||
"Permission:Comments": "评论" |
|||
} |
|||
} |
|||
|
|||
@ -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": "刪除" |
|||
} |
|||
} |
|||
"culture": "zh-Hant", |
|||
"texts": { |
|||
"Permission:Blogging": "部落格", |
|||
"Permission:Blogs": "部落格", |
|||
"Permission:Posts": "文章", |
|||
"Permission:Tags": "標籤", |
|||
"Permission:Comments": "評論" |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue