feat: 新增配置管理

This commit is contained in:
chenchun
2024-06-27 18:37:49 +08:00
parent 389ce08dad
commit fcea4c63a7
24 changed files with 132 additions and 48 deletions

View File

@@ -9,7 +9,9 @@
<ProjectReference Include="..\..\module\tenant-management\Yi.Framework.TenantManagement.Application.Contracts\Yi.Framework.TenantManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\Yi.Abp.Domain.Shared\Yi.Abp.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="$(AbpVersion)" />
</ItemGroup>
<ItemGroup>
<Folder Include="Dtos\" />
<Folder Include="IServices\" />

View File

@@ -1,4 +1,5 @@
using Yi.Abp.Domain.Shared;
using Volo.Abp.SettingManagement;
using Yi.Abp.Domain.Shared;
using Yi.Framework.Bbs.Application.Contracts;
using Yi.Framework.ChatHub.Application.Contracts;
using Yi.Framework.Ddd.Application.Contracts;
@@ -13,6 +14,7 @@ namespace Yi.Abp.Application.Contracts
typeof(YiFrameworkRbacApplicationContractsModule),
typeof(YiFrameworkBbsApplicationContractsModule),
typeof(YiFrameworkChatHubApplicationContractsModule),
typeof(AbpSettingManagementApplicationContractsModule),
typeof(YiFrameworkTenantManagementApplicationContractsModule),
typeof(YiFrameworkDddApplicationContractsModule))]

View File

@@ -2,11 +2,13 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.RateLimiting;
using Volo.Abp.Application.Services;
using Volo.Abp.Settings;
using Volo.Abp.Uow;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Banner;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Rbac.Domain.Authorization;
using Yi.Framework.Rbac.Domain.Extensions;
using Yi.Framework.SettingManagement.Domain;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Abp.Application.Services
@@ -120,7 +122,7 @@ namespace Yi.Abp.Application.Services
var dto = entity.Adapt<BannerGetListOutputDto>();
}
private static int RequestNumber { get; set; } = 0;
/// <summary>
/// 速率限制
/// </summary>
@@ -132,6 +134,27 @@ namespace Yi.Abp.Application.Services
RequestNumber++;
return RequestNumber;
}
private static int RequestNumber { get; set; } = 0;
public ISettingProvider _settingProvider { get; set; }
public ISettingManager _settingManager { get; set; }
/// <summary>
/// 系统配置模块
/// </summary>
/// <returns></returns>
public async Task<string> GetSettingAsync()
{
//默认来说,不提供修改操作,配置应该独立
var enableOrNull = await _settingProvider.GetOrNullAsync("abp.ddd.enable");
//如果要进行修改可使用yi.framework下的ISettingManager
await _settingManager.SetAsync("abp.ddd.enable", "false", "系统", "admin");
var enableOrNull2 = await _settingProvider.GetOrNullAsync("abp.ddd.enable");
return enableOrNull2 ?? string.Empty;
}
}
}

View File

@@ -8,10 +8,11 @@
<ProjectReference Include="..\..\module\chat-hub\Yi.Framework.ChatHub.Application\Yi.Framework.ChatHub.Application.csproj" />
<ProjectReference Include="..\..\module\code-gen\Yi.Framework.CodeGen.Application\Yi.Framework.CodeGen.Application.csproj" />
<ProjectReference Include="..\..\module\rbac\Yi.Framework.Rbac.Application\Yi.Framework.Rbac.Application.csproj" />
<ProjectReference Include="..\..\module\setting-management\Yi.Framework.SettingManagement.Application\Yi.Framework.SettingManagement.Application.csproj" />
<ProjectReference Include="..\..\module\tenant-management\Yi.Framework.TenantManagement.Application\Yi.Framework.TenantManagement.Application.csproj" />
<ProjectReference Include="..\Yi.Abp.Application.Contracts\Yi.Abp.Application.Contracts.csproj" />
<ProjectReference Include="..\Yi.Abp.Domain\Yi.Abp.Domain.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,10 +1,12 @@
using Yi.Abp.Application.Contracts;
using Volo.Abp.SettingManagement;
using Yi.Abp.Application.Contracts;
using Yi.Abp.Domain;
using Yi.Framework.Bbs.Application;
using Yi.Framework.ChatHub.Application;
using Yi.Framework.CodeGen.Application;
using Yi.Framework.Ddd.Application;
using Yi.Framework.Rbac.Application;
using Yi.Framework.SettingManagement.Application;
using Yi.Framework.TenantManagement.Application;
namespace Yi.Abp.Application
@@ -19,6 +21,7 @@ namespace Yi.Abp.Application
typeof(YiFrameworkChatHubApplicationModule),
typeof(YiFrameworkTenantManagementApplicationModule),
typeof(YiFrameworkCodeGenApplicationModule),
typeof (YiFrameworkSettingManagementApplicationModule),
typeof(YiFrameworkDddApplicationModule)
)]

View File

@@ -12,6 +12,9 @@
<ProjectReference Include="..\..\module\rbac\Yi.Framework.Rbac.Domain.Shared\Yi.Framework.Rbac.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="$(AbpVersion)" />
</ItemGroup>
<ItemGroup>
<Folder Include="Consts\" />
<Folder Include="Dtos\" />

View File

@@ -1,4 +1,5 @@
using Volo.Abp.Domain;
using Volo.Abp.SettingManagement;
using Yi.Framework.AuditLogging.Domain.Shared;
using Yi.Framework.Bbs.Domain.Shared;
using Yi.Framework.ChatHub.Domain.Shared;
@@ -12,6 +13,7 @@ namespace Yi.Abp.Domain.Shared
typeof(YiFrameworkChatHubDomainSharedModule),
typeof(YiFrameworkAuditLoggingDomainSharedModule),
typeof(AbpSettingManagementDomainSharedModule),
typeof(AbpDddDomainSharedModule))]
public class YiAbpDomainSharedModule : AbpModule
{

View File

@@ -13,11 +13,13 @@
<ProjectReference Include="..\..\module\bbs\Yi.Framework.Bbs.Domain\Yi.Framework.Bbs.Domain.csproj" />
<ProjectReference Include="..\..\module\chat-hub\Yi.Framework.ChatHub.Domain\Yi.Framework.ChatHub.Domain.csproj" />
<ProjectReference Include="..\..\module\rbac\Yi.Framework.Rbac.Domain\Yi.Framework.Rbac.Domain.csproj" />
<ProjectReference Include="..\..\module\setting-management\Yi.Framework.SettingManagement.Domain\Yi.Framework.SettingManagement.Domain.csproj" />
<ProjectReference Include="..\..\module\tenant-management\Yi.Framework.TenantManagement.Domain\Yi.Framework.TenantManagement.Domain.csproj" />
<ProjectReference Include="..\Yi.Abp.Domain.Shared\Yi.Abp.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Folder Include="EventHandlers\" />
<Folder Include="Entities\" />
<Folder Include="Managers\" />

View File

@@ -7,18 +7,20 @@ using Yi.Framework.Bbs.Domain;
using Yi.Framework.ChatHub.Domain;
using Yi.Framework.Mapster;
using Yi.Framework.Rbac.Domain;
using Yi.Framework.SettingManagement.Domain;
using Yi.Framework.TenantManagement.Domain;
namespace Yi.Abp.Domain
{
[DependsOn(
typeof(YiAbpDomainSharedModule),
typeof(YiFrameworkTenantManagementDomainModule),
typeof(YiFrameworkRbacDomainModule),
typeof(YiFrameworkBbsDomainModule),
typeof(YiFrameworkChatHubDomainModule),
typeof(YiFrameworkAuditLoggingDomainModule),
typeof(YiFrameworkSettingManagementDomainModule),
typeof(YiFrameworkMapsterModule),
typeof(AbpDddDomainModule),

View File

@@ -9,10 +9,12 @@
<ProjectReference Include="..\..\module\chat-hub\Yi.Framework.ChatHub.SqlSugarCore\Yi.Framework.ChatHub.SqlSugarCore.csproj" />
<ProjectReference Include="..\..\module\code-gen\Yi.Framework.CodeGen.SqlSugarCore\Yi.Framework.CodeGen.SqlSugarCore.csproj" />
<ProjectReference Include="..\..\module\rbac\Yi.Framework.Rbac.SqlSugarCore\Yi.Framework.Rbac.SqlSugarCore.csproj" />
<ProjectReference Include="..\..\module\setting-management\Yi.Framework.SettingManagement.SqlSugarCore\Yi.Framework.SettingManagement.SqlSugarCore.csproj" />
<ProjectReference Include="..\..\module\tenant-management\Yi.Framework.TenantManagement.SqlSugarCore\Yi.Framework.TenantManagement.SqlSugarCore.csproj" />
<ProjectReference Include="..\Yi.Abp.Domain\Yi.Abp.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="DataSeeds\" />
<Folder Include="Repositories\" />

View File

@@ -8,6 +8,7 @@ using Yi.Framework.ChatHub.SqlSugarCore;
using Yi.Framework.CodeGen.SqlSugarCore;
using Yi.Framework.Mapster;
using Yi.Framework.Rbac.SqlSugarCore;
using Yi.Framework.SettingManagement.SqlSugarCore;
using Yi.Framework.SqlSugarCore;
using Yi.Framework.SqlSugarCore.Abstractions;
using Yi.Framework.TenantManagement.SqlSugarCore;
@@ -22,6 +23,7 @@ namespace Yi.Abp.SqlsugarCore
typeof(YiFrameworkCodeGenSqlSugarCoreModule),
typeof(YiFrameworkChatHubSqlSugarCoreModule),
typeof(YiFrameworkSettingManagementSqlSugarCoreModule),
typeof(YiFrameworkAuditLoggingSqlSugarCoreModule),
typeof(YiFrameworkTenantManagementSqlSugarCoreModule),
typeof(YiFrameworkMapsterModule),

Binary file not shown.