22 changed files with 107 additions and 84 deletions
@ -1,33 +1,9 @@ |
|||||
using Microsoft.Extensions.DependencyInjection; |
using Volo.Abp.Modularity; |
||||
using Volo.Abp.Domain.Entities.Events.Distributed; |
|
||||
using Volo.Abp.Identity; |
|
||||
using Volo.Abp.Localization; |
|
||||
using Volo.Abp.Modularity; |
|
||||
using Volo.Abp.VirtualFileSystem; |
|
||||
|
|
||||
namespace LINGYUN.Abp.Account |
namespace LINGYUN.Abp.Account |
||||
{ |
{ |
||||
[DependsOn(typeof(AbpAccountDomainSharedModule))] |
[DependsOn(typeof(AbpAccountDomainSharedModule))] |
||||
public class AbpAccountDomainModule : AbpModule |
public class AbpAccountDomainModule : AbpModule |
||||
{ |
{ |
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
|
||||
{ |
|
||||
Configure<AbpVirtualFileSystemOptions>(options => |
|
||||
{ |
|
||||
options.FileSets.AddEmbedded<AbpAccountDomainModule>(); |
|
||||
}); |
|
||||
|
|
||||
Configure<AbpLocalizationOptions>(options => |
|
||||
{ |
|
||||
options.Resources |
|
||||
.Get<Localization.AccountResource>() |
|
||||
.AddVirtualJson("/LINGYUN/Abp/Account/Localization/Resources"); |
|
||||
}); |
|
||||
|
|
||||
Configure<AbpDistributedEntityEventOptions>(options => |
|
||||
{ |
|
||||
options.AutoEventSelectors.AddNamespace("Volo.Abp.Identity"); |
|
||||
}); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,12 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netstandard2.0</TargetFramework> |
||||
|
<RootNamespace /> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Volo.Abp.Settings" Version="3.1.0" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,28 @@ |
|||||
|
using JetBrains.Annotations; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Volo.Abp.Settings |
||||
|
{ |
||||
|
public static class ISettingProviderExtensions |
||||
|
{ |
||||
|
public static async Task<string> GetOrDefaultAsync( |
||||
|
[NotNull] this ISettingProvider settingProvider, |
||||
|
[NotNull] string name, |
||||
|
[NotNull] IServiceProvider serviceProvider) |
||||
|
{ |
||||
|
Check.NotNull(settingProvider, nameof(settingProvider)); |
||||
|
Check.NotNull(serviceProvider, nameof(serviceProvider)); |
||||
|
Check.NotNullOrWhiteSpace(name, nameof(name)); |
||||
|
var value = await settingProvider.GetOrNullAsync(name); |
||||
|
if (value.IsNullOrWhiteSpace()) |
||||
|
{ |
||||
|
var settingDefintionManager = serviceProvider.GetRequiredService<ISettingDefinitionManager>(); |
||||
|
var setting = settingDefintionManager.Get(name); |
||||
|
return setting.DefaultValue; |
||||
|
} |
||||
|
return value; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue