Merge branch 'abp-dev' into abp
This commit is contained in:
@@ -152,19 +152,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Rbac.Test", "t
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tool", "tool", "{084CBEEC-5D37-4716-B9C7-D80D6960DFF4}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tool", "tool", "{084CBEEC-5D37-4716-B9C7-D80D6960DFF4}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Abp.Tool", "tool\Yi.Abp.Tool\Yi.Abp.Tool.csproj", "{4FEBBDD9-E4F4-4BAF-8599-E2D57C08A74F}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Abp.Tool", "tool\Yi.Abp.Tool\Yi.Abp.Tool.csproj", "{4FEBBDD9-E4F4-4BAF-8599-E2D57C08A74F}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Abp.Tool.Web", "tool\Yi.Abp.Tool.Web\Yi.Abp.Tool.Web.csproj", "{2CE51D4C-1EF9-462B-BA14-7EA01A7E4AF1}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Abp.Tool.Web", "tool\Yi.Abp.Tool.Web\Yi.Abp.Tool.Web.csproj", "{2CE51D4C-1EF9-462B-BA14-7EA01A7E4AF1}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Abp.Tool.Application", "tool\Yi.Abp.Tool.Application\Yi.Abp.Tool.Application.csproj", "{776590BA-B900-4C8B-986A-5B721FA4B306}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Abp.Tool.Application", "tool\Yi.Abp.Tool.Application\Yi.Abp.Tool.Application.csproj", "{776590BA-B900-4C8B-986A-5B721FA4B306}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Abp.Tool.Application.Contracts", "tool\Yi.Abp.Tool.Application.Contracts\Yi.Abp.Tool.Application.Contracts.csproj", "{3A3AF1ED-FC7F-48CF-8ACE-9D50426B4675}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Abp.Tool.Application.Contracts", "tool\Yi.Abp.Tool.Application.Contracts\Yi.Abp.Tool.Application.Contracts.csproj", "{3A3AF1ED-FC7F-48CF-8ACE-9D50426B4675}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Abp.Tool.Domain", "tool\Yi.Abp.Tool.Domain\Yi.Abp.Tool.Domain.csproj", "{68F73B7B-0F8A-41C1-8092-6D6FFAED32F8}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Abp.Tool.Domain", "tool\Yi.Abp.Tool.Domain\Yi.Abp.Tool.Domain.csproj", "{68F73B7B-0F8A-41C1-8092-6D6FFAED32F8}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Abp.Tool.Domain.Shared", "tool\Yi.Abp.Tool.Domain.Shared\Yi.Abp.Tool.Domain.Shared.csproj", "{4AE84CDE-2A47-4D68-8E93-86193F72E4E8}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Abp.Tool.Domain.Shared", "tool\Yi.Abp.Tool.Domain.Shared\Yi.Abp.Tool.Domain.Shared.csproj", "{4AE84CDE-2A47-4D68-8E93-86193F72E4E8}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Abp.Tool.HttpApi.Client", "tool\Yi.Abp.Tool.HttpApi.Client\Yi.Abp.Tool.HttpApi.Client.csproj", "{C8F97775-D903-4365-A4FF-3DA97E318CD2}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Abp.Tool.HttpApi.Client", "tool\Yi.Abp.Tool.HttpApi.Client\Yi.Abp.Tool.HttpApi.Client.csproj", "{C8F97775-D903-4365-A4FF-3DA97E318CD2}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.SettingManagement.Application", "module\setting-management\Yi.Framework.SettingManagement.Application\Yi.Framework.SettingManagement.Application.csproj", "{2A31D7CB-BDCC-4253-BA73-273B6B5E1956}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -420,6 +422,10 @@ Global
|
|||||||
{C8F97775-D903-4365-A4FF-3DA97E318CD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C8F97775-D903-4365-A4FF-3DA97E318CD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C8F97775-D903-4365-A4FF-3DA97E318CD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C8F97775-D903-4365-A4FF-3DA97E318CD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C8F97775-D903-4365-A4FF-3DA97E318CD2}.Release|Any CPU.Build.0 = Release|Any CPU
|
{C8F97775-D903-4365-A4FF-3DA97E318CD2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{2A31D7CB-BDCC-4253-BA73-273B6B5E1956}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{2A31D7CB-BDCC-4253-BA73-273B6B5E1956}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{2A31D7CB-BDCC-4253-BA73-273B6B5E1956}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{2A31D7CB-BDCC-4253-BA73-273B6B5E1956}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -494,6 +500,7 @@ Global
|
|||||||
{68F73B7B-0F8A-41C1-8092-6D6FFAED32F8} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
|
{68F73B7B-0F8A-41C1-8092-6D6FFAED32F8} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
|
||||||
{4AE84CDE-2A47-4D68-8E93-86193F72E4E8} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
|
{4AE84CDE-2A47-4D68-8E93-86193F72E4E8} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
|
||||||
{C8F97775-D903-4365-A4FF-3DA97E318CD2} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
|
{C8F97775-D903-4365-A4FF-3DA97E318CD2} = {084CBEEC-5D37-4716-B9C7-D80D6960DFF4}
|
||||||
|
{2A31D7CB-BDCC-4253-BA73-273B6B5E1956} = {8C68059E-F3B1-4D28-A1C9-A5830F53E5D3}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {23D6FBC9-C970-4641-BC1E-2AEA59F51C18}
|
SolutionGuid = {23D6FBC9-C970-4641-BC1E-2AEA59F51C18}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
using SqlSugar;
|
|
||||||
using Volo.Abp.Domain.Entities;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Bbs.Domain.Entities
|
|
||||||
{
|
|
||||||
[SugarTable("Setting")]
|
|
||||||
public class SettingAggregateRoot : AggregateRoot<Guid>
|
|
||||||
{
|
|
||||||
|
|
||||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
|
||||||
public override Guid Id { get; protected set; }
|
|
||||||
public int CommentPage { get; set; }
|
|
||||||
public int DiscussPage { get; set; }
|
|
||||||
public int CommentExperience { get; set; }
|
|
||||||
public int DiscussExperience { get; set; }
|
|
||||||
public string Title { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -83,7 +83,7 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
|||||||
{
|
{
|
||||||
throw new UserFriendlyException(UserConst.No_Permission);
|
throw new UserFriendlyException(UserConst.No_Permission);
|
||||||
}
|
}
|
||||||
//这里抛出一个登录的事件
|
//这里抛出一个登录的事件,也可以在全部流程走完,在应用层组装
|
||||||
if (_httpContextAccessor.HttpContext is not null)
|
if (_httpContextAccessor.HttpContext is not null)
|
||||||
{
|
{
|
||||||
var loginEntity = new LoginLogAggregateRoot().GetInfoByHttpContext(_httpContextAccessor.HttpContext);
|
var loginEntity = new LoginLogAggregateRoot().GetInfoByHttpContext(_httpContextAccessor.HttpContext);
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using Volo.Abp.Application.Services;
|
||||||
|
using Volo.Abp.SettingManagement.Localization;
|
||||||
|
|
||||||
|
namespace Yi.Framework.SettingManagement.Application;
|
||||||
|
|
||||||
|
public abstract class SettingManagementAppServiceBase : ApplicationService
|
||||||
|
{
|
||||||
|
protected SettingManagementAppServiceBase()
|
||||||
|
{
|
||||||
|
LocalizationResource = typeof(AbpSettingManagementResource);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<Import Project="..\..\..\common.props" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
|
||||||
|
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="$(AbpVersion)" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\framework\Yi.Framework.Ddd.Application\Yi.Framework.Ddd.Application.csproj" />
|
||||||
|
<ProjectReference Include="..\Yi.Framework.SettingManagement.Domain\Yi.Framework.SettingManagement.Domain.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using Volo.Abp.Application;
|
||||||
|
using Volo.Abp.Modularity;
|
||||||
|
using Volo.Abp.SettingManagement;
|
||||||
|
using Volo.Abp.Timing;
|
||||||
|
|
||||||
|
namespace Yi.Framework.SettingManagement.Application;
|
||||||
|
|
||||||
|
[DependsOn(
|
||||||
|
typeof(AbpDddApplicationModule),
|
||||||
|
typeof(AbpSettingManagementApplicationContractsModule),
|
||||||
|
typeof(AbpTimingModule)
|
||||||
|
)]
|
||||||
|
public class YiFrameworkSettingManagementApplicationModule : AbpModule
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -6,20 +6,20 @@ using Volo.Abp.Domain.Repositories;
|
|||||||
|
|
||||||
namespace Yi.Framework.SettingManagement.Domain;
|
namespace Yi.Framework.SettingManagement.Domain;
|
||||||
|
|
||||||
public interface ISettingRepository : IBasicRepository<SettingEntity, Guid>
|
public interface ISettingRepository : IBasicRepository<SettingAggregateRoot, Guid>
|
||||||
{
|
{
|
||||||
Task<SettingEntity> FindAsync(
|
Task<SettingAggregateRoot> FindAsync(
|
||||||
string name,
|
string name,
|
||||||
string providerName,
|
string providerName,
|
||||||
string providerKey,
|
string providerKey,
|
||||||
CancellationToken cancellationToken = default);
|
CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
Task<List<SettingEntity>> GetListAsync(
|
Task<List<SettingAggregateRoot>> GetListAsync(
|
||||||
string providerName,
|
string providerName,
|
||||||
string providerKey,
|
string providerKey,
|
||||||
CancellationToken cancellationToken = default);
|
CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
Task<List<SettingEntity>> GetListAsync(
|
Task<List<SettingAggregateRoot>> GetListAsync(
|
||||||
string[] names,
|
string[] names,
|
||||||
string providerName,
|
string providerName,
|
||||||
string providerKey,
|
string providerKey,
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
using SqlSugar;
|
||||||
using Volo.Abp;
|
using Volo.Abp;
|
||||||
using Volo.Abp.Domain.Entities;
|
using Volo.Abp.Domain.Entities;
|
||||||
|
using Check = Volo.Abp.Check;
|
||||||
|
|
||||||
namespace Yi.Framework.SettingManagement.Domain;
|
namespace Yi.Framework.SettingManagement.Domain;
|
||||||
|
|
||||||
public class SettingEntity : Entity<Guid>, IAggregateRoot<Guid>
|
[SugarTable("Setting")]
|
||||||
|
public class SettingAggregateRoot : Entity<Guid>, IAggregateRoot<Guid>
|
||||||
{
|
{
|
||||||
[NotNull]
|
[NotNull]
|
||||||
public virtual string Name { get; protected set; }
|
public virtual string Name { get; protected set; }
|
||||||
@@ -13,17 +16,17 @@ public class SettingEntity : Entity<Guid>, IAggregateRoot<Guid>
|
|||||||
public virtual string Value { get; internal set; }
|
public virtual string Value { get; internal set; }
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
public virtual string ProviderName { get; protected set; }
|
public virtual string? ProviderName { get; protected set; }
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
public virtual string ProviderKey { get; protected set; }
|
public virtual string? ProviderKey { get; protected set; }
|
||||||
|
|
||||||
public SettingEntity()
|
public SettingAggregateRoot()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingEntity(
|
public SettingAggregateRoot(
|
||||||
Guid id,
|
Guid id,
|
||||||
[NotNull] string name,
|
[NotNull] string name,
|
||||||
[NotNull] string value,
|
[NotNull] string value,
|
||||||
@@ -6,7 +6,7 @@ using Volo.Abp.EventBus;
|
|||||||
|
|
||||||
namespace Yi.Framework.SettingManagement.Domain;
|
namespace Yi.Framework.SettingManagement.Domain;
|
||||||
|
|
||||||
public class SettingCacheItemInvalidator : ILocalEventHandler<EntityChangedEventData<SettingEntity>>, ITransientDependency
|
public class SettingCacheItemInvalidator : ILocalEventHandler<EntityChangedEventData<SettingAggregateRoot>>, ITransientDependency
|
||||||
{
|
{
|
||||||
protected IDistributedCache<SettingCacheItem> Cache { get; }
|
protected IDistributedCache<SettingCacheItem> Cache { get; }
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ public class SettingCacheItemInvalidator : ILocalEventHandler<EntityChangedEvent
|
|||||||
Cache = cache;
|
Cache = cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task HandleEventAsync(EntityChangedEventData<SettingEntity> eventData)
|
public virtual async Task HandleEventAsync(EntityChangedEventData<SettingAggregateRoot> eventData)
|
||||||
{
|
{
|
||||||
var cacheKey = CalculateCacheKey(
|
var cacheKey = CalculateCacheKey(
|
||||||
eventData.Entity.Name,
|
eventData.Entity.Name,
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class SettingManagementStore : ISettingManagementStore, ITransientDepende
|
|||||||
var setting = await SettingRepository.FindAsync(name, providerName, providerKey);
|
var setting = await SettingRepository.FindAsync(name, providerName, providerKey);
|
||||||
if (setting == null)
|
if (setting == null)
|
||||||
{
|
{
|
||||||
setting = new SettingEntity(GuidGenerator.Create(), name, value, providerName, providerKey);
|
setting = new SettingAggregateRoot(GuidGenerator.Create(), name, value, providerName, providerKey);
|
||||||
await SettingRepository.InsertAsync(setting);
|
await SettingRepository.InsertAsync(setting);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -11,4 +11,8 @@
|
|||||||
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="$(AbpVersion)" />
|
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="$(AbpVersion)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\framework\Yi.Framework.SqlSugarCore.Abstractions\Yi.Framework.SqlSugarCore.Abstractions.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ using Yi.Framework.SqlSugarCore.Repositories;
|
|||||||
|
|
||||||
namespace Volo.Abp.SettingManagement.EntityFrameworkCore;
|
namespace Volo.Abp.SettingManagement.EntityFrameworkCore;
|
||||||
|
|
||||||
public class SqlSugarCoreSettingRepository : SqlSugarRepository<SettingEntity, Guid>,
|
public class SqlSugarCoreSettingRepository : SqlSugarRepository<SettingAggregateRoot, Guid>,
|
||||||
ISettingRepository
|
ISettingRepository
|
||||||
{
|
{
|
||||||
public SqlSugarCoreSettingRepository(ISugarDbContextProvider<ISqlSugarDbContext> sugarDbContextProvider) : base(sugarDbContextProvider)
|
public SqlSugarCoreSettingRepository(ISugarDbContextProvider<ISqlSugarDbContext> sugarDbContextProvider) : base(sugarDbContextProvider)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task<SettingEntity> FindAsync(
|
public virtual async Task<SettingAggregateRoot> FindAsync(
|
||||||
string name,
|
string name,
|
||||||
string providerName,
|
string providerName,
|
||||||
string providerKey,
|
string providerKey,
|
||||||
@@ -23,7 +23,7 @@ public class SqlSugarCoreSettingRepository : SqlSugarRepository<SettingEntity, G
|
|||||||
.FirstAsync();
|
.FirstAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task<List<SettingEntity>> GetListAsync(
|
public virtual async Task<List<SettingAggregateRoot>> GetListAsync(
|
||||||
string providerName,
|
string providerName,
|
||||||
string providerKey,
|
string providerKey,
|
||||||
CancellationToken cancellationToken = default)
|
CancellationToken cancellationToken = default)
|
||||||
@@ -34,7 +34,7 @@ public class SqlSugarCoreSettingRepository : SqlSugarRepository<SettingEntity, G
|
|||||||
).ToListAsync();
|
).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task<List<SettingEntity>> GetListAsync(
|
public virtual async Task<List<SettingAggregateRoot>> GetListAsync(
|
||||||
string[] names,
|
string[] names,
|
||||||
string providerName,
|
string providerName,
|
||||||
string providerKey,
|
string providerKey,
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
<ProjectReference Include="..\..\module\tenant-management\Yi.Framework.TenantManagement.Application.Contracts\Yi.Framework.TenantManagement.Application.Contracts.csproj" />
|
<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" />
|
<ProjectReference Include="..\Yi.Abp.Domain.Shared\Yi.Abp.Domain.Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="$(AbpVersion)" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Dtos\" />
|
<Folder Include="Dtos\" />
|
||||||
<Folder Include="IServices\" />
|
<Folder Include="IServices\" />
|
||||||
|
|||||||
@@ -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.Bbs.Application.Contracts;
|
||||||
using Yi.Framework.ChatHub.Application.Contracts;
|
using Yi.Framework.ChatHub.Application.Contracts;
|
||||||
using Yi.Framework.Ddd.Application.Contracts;
|
using Yi.Framework.Ddd.Application.Contracts;
|
||||||
@@ -13,6 +14,7 @@ namespace Yi.Abp.Application.Contracts
|
|||||||
typeof(YiFrameworkRbacApplicationContractsModule),
|
typeof(YiFrameworkRbacApplicationContractsModule),
|
||||||
typeof(YiFrameworkBbsApplicationContractsModule),
|
typeof(YiFrameworkBbsApplicationContractsModule),
|
||||||
typeof(YiFrameworkChatHubApplicationContractsModule),
|
typeof(YiFrameworkChatHubApplicationContractsModule),
|
||||||
|
typeof(AbpSettingManagementApplicationContractsModule),
|
||||||
|
|
||||||
typeof(YiFrameworkTenantManagementApplicationContractsModule),
|
typeof(YiFrameworkTenantManagementApplicationContractsModule),
|
||||||
typeof(YiFrameworkDddApplicationContractsModule))]
|
typeof(YiFrameworkDddApplicationContractsModule))]
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.RateLimiting;
|
using Microsoft.AspNetCore.RateLimiting;
|
||||||
using Volo.Abp.Application.Services;
|
using Volo.Abp.Application.Services;
|
||||||
|
using Volo.Abp.Settings;
|
||||||
using Volo.Abp.Uow;
|
using Volo.Abp.Uow;
|
||||||
using Yi.Framework.Bbs.Application.Contracts.Dtos.Banner;
|
using Yi.Framework.Bbs.Application.Contracts.Dtos.Banner;
|
||||||
using Yi.Framework.Bbs.Domain.Entities.Forum;
|
using Yi.Framework.Bbs.Domain.Entities.Forum;
|
||||||
using Yi.Framework.Rbac.Domain.Authorization;
|
using Yi.Framework.Rbac.Domain.Authorization;
|
||||||
using Yi.Framework.Rbac.Domain.Extensions;
|
using Yi.Framework.Rbac.Domain.Extensions;
|
||||||
|
using Yi.Framework.SettingManagement.Domain;
|
||||||
using Yi.Framework.SqlSugarCore.Abstractions;
|
using Yi.Framework.SqlSugarCore.Abstractions;
|
||||||
|
|
||||||
namespace Yi.Abp.Application.Services
|
namespace Yi.Abp.Application.Services
|
||||||
@@ -120,7 +122,7 @@ namespace Yi.Abp.Application.Services
|
|||||||
var dto = entity.Adapt<BannerGetListOutputDto>();
|
var dto = entity.Adapt<BannerGetListOutputDto>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int RequestNumber { get; set; } = 0;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 速率限制
|
/// 速率限制
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -132,6 +134,30 @@ namespace Yi.Abp.Application.Services
|
|||||||
RequestNumber++;
|
RequestNumber++;
|
||||||
return 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()
|
||||||
|
{
|
||||||
|
//DDD需要提前定义
|
||||||
|
//默认来说,不提供修改操作,配置应该独立
|
||||||
|
var enableOrNull = await _settingProvider.GetOrNullAsync("DDD");
|
||||||
|
|
||||||
|
//如果要进行修改,可使用yi.framework下的ISettingManager
|
||||||
|
await _settingManager.SetGlobalAsync("DDD", "false");
|
||||||
|
|
||||||
|
var enableOrNull2 = await _settingManager.GetOrNullGlobalAsync("DDD");
|
||||||
|
|
||||||
|
//当然,他的独特地方,是支持来自多个模块,例如配置文件?
|
||||||
|
var result= await _settingManager.GetOrNullConfigurationAsync("Test");
|
||||||
|
return result ?? string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,11 @@
|
|||||||
<ProjectReference Include="..\..\module\chat-hub\Yi.Framework.ChatHub.Application\Yi.Framework.ChatHub.Application.csproj" />
|
<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\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\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="..\..\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.Application.Contracts\Yi.Abp.Application.Contracts.csproj" />
|
||||||
<ProjectReference Include="..\Yi.Abp.Domain\Yi.Abp.Domain.csproj" />
|
<ProjectReference Include="..\Yi.Abp.Domain\Yi.Abp.Domain.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
using Yi.Abp.Application.Contracts;
|
using Volo.Abp.SettingManagement;
|
||||||
|
using Yi.Abp.Application.Contracts;
|
||||||
using Yi.Abp.Domain;
|
using Yi.Abp.Domain;
|
||||||
using Yi.Framework.Bbs.Application;
|
using Yi.Framework.Bbs.Application;
|
||||||
using Yi.Framework.ChatHub.Application;
|
using Yi.Framework.ChatHub.Application;
|
||||||
using Yi.Framework.CodeGen.Application;
|
using Yi.Framework.CodeGen.Application;
|
||||||
using Yi.Framework.Ddd.Application;
|
using Yi.Framework.Ddd.Application;
|
||||||
using Yi.Framework.Rbac.Application;
|
using Yi.Framework.Rbac.Application;
|
||||||
|
using Yi.Framework.SettingManagement.Application;
|
||||||
using Yi.Framework.TenantManagement.Application;
|
using Yi.Framework.TenantManagement.Application;
|
||||||
|
|
||||||
namespace Yi.Abp.Application
|
namespace Yi.Abp.Application
|
||||||
@@ -19,6 +21,7 @@ namespace Yi.Abp.Application
|
|||||||
typeof(YiFrameworkChatHubApplicationModule),
|
typeof(YiFrameworkChatHubApplicationModule),
|
||||||
typeof(YiFrameworkTenantManagementApplicationModule),
|
typeof(YiFrameworkTenantManagementApplicationModule),
|
||||||
typeof(YiFrameworkCodeGenApplicationModule),
|
typeof(YiFrameworkCodeGenApplicationModule),
|
||||||
|
typeof (YiFrameworkSettingManagementApplicationModule),
|
||||||
|
|
||||||
typeof(YiFrameworkDddApplicationModule)
|
typeof(YiFrameworkDddApplicationModule)
|
||||||
)]
|
)]
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Volo.Abp.Settings;
|
||||||
|
|
||||||
|
namespace Yi.Abp.Domain.Shared.Settings
|
||||||
|
{
|
||||||
|
internal class TestSettingProvider : SettingDefinitionProvider
|
||||||
|
{
|
||||||
|
public override void Define(ISettingDefinitionContext context)
|
||||||
|
{
|
||||||
|
context.Add(
|
||||||
|
new SettingDefinition("DDD","127.0.0.1"),
|
||||||
|
new SettingDefinition("TTT", "127.0.0.1")
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,9 @@
|
|||||||
<ProjectReference Include="..\..\module\rbac\Yi.Framework.Rbac.Domain.Shared\Yi.Framework.Rbac.Domain.Shared.csproj" />
|
<ProjectReference Include="..\..\module\rbac\Yi.Framework.Rbac.Domain.Shared\Yi.Framework.Rbac.Domain.Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Volo.Abp.SettingManagement.Domain.Shared" Version="$(AbpVersion)" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Consts\" />
|
<Folder Include="Consts\" />
|
||||||
<Folder Include="Dtos\" />
|
<Folder Include="Dtos\" />
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Volo.Abp.Domain;
|
using Volo.Abp.Domain;
|
||||||
|
using Volo.Abp.SettingManagement;
|
||||||
using Yi.Framework.AuditLogging.Domain.Shared;
|
using Yi.Framework.AuditLogging.Domain.Shared;
|
||||||
using Yi.Framework.Bbs.Domain.Shared;
|
using Yi.Framework.Bbs.Domain.Shared;
|
||||||
using Yi.Framework.ChatHub.Domain.Shared;
|
using Yi.Framework.ChatHub.Domain.Shared;
|
||||||
@@ -12,6 +13,7 @@ namespace Yi.Abp.Domain.Shared
|
|||||||
typeof(YiFrameworkChatHubDomainSharedModule),
|
typeof(YiFrameworkChatHubDomainSharedModule),
|
||||||
typeof(YiFrameworkAuditLoggingDomainSharedModule),
|
typeof(YiFrameworkAuditLoggingDomainSharedModule),
|
||||||
|
|
||||||
|
typeof(AbpSettingManagementDomainSharedModule),
|
||||||
typeof(AbpDddDomainSharedModule))]
|
typeof(AbpDddDomainSharedModule))]
|
||||||
public class YiAbpDomainSharedModule : AbpModule
|
public class YiAbpDomainSharedModule : AbpModule
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,11 +13,13 @@
|
|||||||
<ProjectReference Include="..\..\module\bbs\Yi.Framework.Bbs.Domain\Yi.Framework.Bbs.Domain.csproj" />
|
<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\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\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="..\..\module\tenant-management\Yi.Framework.TenantManagement.Domain\Yi.Framework.TenantManagement.Domain.csproj" />
|
||||||
<ProjectReference Include="..\Yi.Abp.Domain.Shared\Yi.Abp.Domain.Shared.csproj" />
|
<ProjectReference Include="..\Yi.Abp.Domain.Shared\Yi.Abp.Domain.Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
|
<ItemGroup>
|
||||||
<Folder Include="EventHandlers\" />
|
<Folder Include="EventHandlers\" />
|
||||||
<Folder Include="Entities\" />
|
<Folder Include="Entities\" />
|
||||||
<Folder Include="Managers\" />
|
<Folder Include="Managers\" />
|
||||||
|
|||||||
@@ -7,18 +7,20 @@ using Yi.Framework.Bbs.Domain;
|
|||||||
using Yi.Framework.ChatHub.Domain;
|
using Yi.Framework.ChatHub.Domain;
|
||||||
using Yi.Framework.Mapster;
|
using Yi.Framework.Mapster;
|
||||||
using Yi.Framework.Rbac.Domain;
|
using Yi.Framework.Rbac.Domain;
|
||||||
|
using Yi.Framework.SettingManagement.Domain;
|
||||||
using Yi.Framework.TenantManagement.Domain;
|
using Yi.Framework.TenantManagement.Domain;
|
||||||
|
|
||||||
namespace Yi.Abp.Domain
|
namespace Yi.Abp.Domain
|
||||||
{
|
{
|
||||||
[DependsOn(
|
[DependsOn(
|
||||||
typeof(YiAbpDomainSharedModule),
|
typeof(YiAbpDomainSharedModule),
|
||||||
|
|
||||||
typeof(YiFrameworkTenantManagementDomainModule),
|
typeof(YiFrameworkTenantManagementDomainModule),
|
||||||
typeof(YiFrameworkRbacDomainModule),
|
typeof(YiFrameworkRbacDomainModule),
|
||||||
typeof(YiFrameworkBbsDomainModule),
|
typeof(YiFrameworkBbsDomainModule),
|
||||||
typeof(YiFrameworkChatHubDomainModule),
|
typeof(YiFrameworkChatHubDomainModule),
|
||||||
typeof(YiFrameworkAuditLoggingDomainModule),
|
typeof(YiFrameworkAuditLoggingDomainModule),
|
||||||
|
typeof(YiFrameworkSettingManagementDomainModule),
|
||||||
|
|
||||||
typeof(YiFrameworkMapsterModule),
|
typeof(YiFrameworkMapsterModule),
|
||||||
typeof(AbpDddDomainModule),
|
typeof(AbpDddDomainModule),
|
||||||
|
|||||||
@@ -9,10 +9,12 @@
|
|||||||
<ProjectReference Include="..\..\module\chat-hub\Yi.Framework.ChatHub.SqlSugarCore\Yi.Framework.ChatHub.SqlSugarCore.csproj" />
|
<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\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\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="..\..\module\tenant-management\Yi.Framework.TenantManagement.SqlSugarCore\Yi.Framework.TenantManagement.SqlSugarCore.csproj" />
|
||||||
<ProjectReference Include="..\Yi.Abp.Domain\Yi.Abp.Domain.csproj" />
|
<ProjectReference Include="..\Yi.Abp.Domain\Yi.Abp.Domain.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="DataSeeds\" />
|
<Folder Include="DataSeeds\" />
|
||||||
<Folder Include="Repositories\" />
|
<Folder Include="Repositories\" />
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using Yi.Framework.ChatHub.SqlSugarCore;
|
|||||||
using Yi.Framework.CodeGen.SqlSugarCore;
|
using Yi.Framework.CodeGen.SqlSugarCore;
|
||||||
using Yi.Framework.Mapster;
|
using Yi.Framework.Mapster;
|
||||||
using Yi.Framework.Rbac.SqlSugarCore;
|
using Yi.Framework.Rbac.SqlSugarCore;
|
||||||
|
using Yi.Framework.SettingManagement.SqlSugarCore;
|
||||||
using Yi.Framework.SqlSugarCore;
|
using Yi.Framework.SqlSugarCore;
|
||||||
using Yi.Framework.SqlSugarCore.Abstractions;
|
using Yi.Framework.SqlSugarCore.Abstractions;
|
||||||
using Yi.Framework.TenantManagement.SqlSugarCore;
|
using Yi.Framework.TenantManagement.SqlSugarCore;
|
||||||
@@ -22,6 +23,7 @@ namespace Yi.Abp.SqlsugarCore
|
|||||||
typeof(YiFrameworkCodeGenSqlSugarCoreModule),
|
typeof(YiFrameworkCodeGenSqlSugarCoreModule),
|
||||||
typeof(YiFrameworkChatHubSqlSugarCoreModule),
|
typeof(YiFrameworkChatHubSqlSugarCoreModule),
|
||||||
|
|
||||||
|
typeof(YiFrameworkSettingManagementSqlSugarCoreModule),
|
||||||
typeof(YiFrameworkAuditLoggingSqlSugarCoreModule),
|
typeof(YiFrameworkAuditLoggingSqlSugarCoreModule),
|
||||||
typeof(YiFrameworkTenantManagementSqlSugarCoreModule),
|
typeof(YiFrameworkTenantManagementSqlSugarCoreModule),
|
||||||
typeof(YiFrameworkMapsterModule),
|
typeof(YiFrameworkMapsterModule),
|
||||||
|
|||||||
@@ -11,7 +11,10 @@
|
|||||||
"SelfUrl": "http://*:19001",
|
"SelfUrl": "http://*:19001",
|
||||||
"CorsOrigins": "http://localhost:19001;http://localhost:18000"
|
"CorsOrigins": "http://localhost:19001;http://localhost:18000"
|
||||||
},
|
},
|
||||||
|
//配置
|
||||||
|
"Settings": {
|
||||||
|
"Test": "hello"
|
||||||
|
},
|
||||||
//数据库类型列表
|
//数据库类型列表
|
||||||
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
||||||
|
|
||||||
|
|||||||
BIN
Yi.Abp.Net8/src/Yi.Abp.Web/yi-abp-dev.db
Normal file
BIN
Yi.Abp.Net8/src/Yi.Abp.Web/yi-abp-dev.db
Normal file
Binary file not shown.
Reference in New Issue
Block a user