Browse Source

fix(data-protection): 修复数据保护规则实体关系映射

pull/1013/head
colin 1 year ago
parent
commit
bbbcc06e48
  1. 3
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs
  2. 4
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationMappingProfile.cs
  3. 7
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainModule.cs

3
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs

@ -16,8 +16,7 @@ public abstract class AbpDataProtectionDbContext<TDbContext> : AbpDbContext<TDbC
public IOptions<AbpDataProtectionOptions> DataProtectionOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpDataProtectionOptions>>();
public ICurrentUser CurrentUser => LazyServiceProvider.LazyGetRequiredService<ICurrentUser>();
public AbpDataProtectionDbContext(
DbContextOptions<TDbContext> options) : base(options)
protected AbpDataProtectionDbContext(DbContextOptions<TDbContext> options) : base(options)
{
}

4
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationMappingProfile.cs

@ -10,6 +10,10 @@ public class DataProtectionManagementApplicationMappingProfile :Profile
CreateMap<EntityPropertyInfo, EntityPropertyInfoDto>()
.ForMember(dto => dto.ValueRange, map => map.MapFrom(src => MapToArray(src.ValueRange)));
CreateMap<EntityTypeInfo, EntityTypeInfoDto>();
CreateMap<RoleEntityRule, RoleEntityRuleDto>()
.ForMember(dto => dto.AllowProperties, map => map.MapFrom(src => MapToArray(src.AllowProperties)));
CreateMap<OrganizationUnitEntityRule, OrganizationUnitEntityRuleDto>()
.ForMember(dto => dto.AllowProperties, map => map.MapFrom(src => MapToArray(src.AllowProperties)));
}
private string[] MapToArray(string val)

7
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainModule.cs

@ -1,6 +1,8 @@
using LINGYUN.Abp.DataProtection;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Caching;
using Volo.Abp.Domain;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Modularity;
@ -35,6 +37,11 @@ public class AbpDataProtectionManagementDomainModule : AbpModule
options.AutoEventSelectors.Add<OrganizationUnitEntityRule>();
});
Configure<AbpDistributedCacheOptions>(options =>
{
options.ConfigureCache<DataProtectedResourceCacheItem>(new DistributedCacheEntryOptions());
});
context.Services.AddHostedService<ProtectedEntitiesSaverService>();
}
}

Loading…
Cancel
Save