7 changed files with 106 additions and 58 deletions
@ -0,0 +1,76 @@ |
|||||
|
using Riok.Mapperly.Abstractions; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Mapperly; |
||||
|
|
||||
|
namespace LINGYUN.Abp.DataProtectionManagement; |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class EntityEnumInfoToEntityEnumInfoDtoMapper : MapperBase<EntityEnumInfo, EntityEnumInfoDto> |
||||
|
{ |
||||
|
public override partial EntityEnumInfoDto Map(EntityEnumInfo source); |
||||
|
public override partial void Map(EntityEnumInfo source, EntityEnumInfoDto destination); |
||||
|
} |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class EntityPropertyInfoToEntityPropertyInfoDtoMapper : MapperBase<EntityPropertyInfo, EntityPropertyInfoDto> |
||||
|
{ |
||||
|
public override partial EntityPropertyInfoDto Map(EntityPropertyInfo source); |
||||
|
public override partial void Map(EntityPropertyInfo source, EntityPropertyInfoDto destination); |
||||
|
} |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class EntityTypeInfoToEntityTypeInfoDtoMapper : MapperBase<EntityTypeInfo, EntityTypeInfoDto> |
||||
|
{ |
||||
|
public override partial EntityTypeInfoDto Map(EntityTypeInfo source); |
||||
|
public override partial void Map(EntityTypeInfo source, EntityTypeInfoDto destination); |
||||
|
} |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class RoleEntityRuleToRoleEntityRuleDtoMapper : MapperBase<RoleEntityRule, RoleEntityRuleDto> |
||||
|
{ |
||||
|
[MapProperty(nameof(RoleEntityRule.AccessedProperties), nameof(RoleEntityRuleDto.AccessedProperties), Use = nameof(MapToArray))] |
||||
|
public override partial RoleEntityRuleDto Map(RoleEntityRule source); |
||||
|
|
||||
|
[MapProperty(nameof(RoleEntityRule.AccessedProperties), nameof(RoleEntityRuleDto.AccessedProperties), Use = nameof(MapToArray))] |
||||
|
public override partial void Map(RoleEntityRule source, RoleEntityRuleDto destination); |
||||
|
|
||||
|
[UserMapping] |
||||
|
private string[] MapToArray(string val) |
||||
|
{ |
||||
|
if (val.IsNullOrWhiteSpace()) |
||||
|
{ |
||||
|
return Array.Empty<string>(); |
||||
|
} |
||||
|
return val.Split(',').ToArray(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class OrganizationUnitEntityRuleToOrganizationUnitEntityRuleDtoMapper : MapperBase<OrganizationUnitEntityRule, OrganizationUnitEntityRuleDto> |
||||
|
{ |
||||
|
[MapProperty(nameof(OrganizationUnitEntityRule.AccessedProperties), nameof(OrganizationUnitEntityRuleDto.AccessedProperties), Use = nameof(MapToArray))] |
||||
|
public override partial OrganizationUnitEntityRuleDto Map(OrganizationUnitEntityRule source); |
||||
|
|
||||
|
[MapProperty(nameof(OrganizationUnitEntityRule.AccessedProperties), nameof(OrganizationUnitEntityRuleDto.AccessedProperties), Use = nameof(MapToArray))] |
||||
|
public override partial void Map(OrganizationUnitEntityRule source, OrganizationUnitEntityRuleDto destination); |
||||
|
|
||||
|
[UserMapping] |
||||
|
private string[] MapToArray(string val) |
||||
|
{ |
||||
|
if (val.IsNullOrWhiteSpace()) |
||||
|
{ |
||||
|
return Array.Empty<string>(); |
||||
|
} |
||||
|
return val.Split(',').ToArray(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class SubjectStrategyToSubjectStrategyDtoMapper : MapperBase<SubjectStrategy, SubjectStrategyDto> |
||||
|
{ |
||||
|
public override partial SubjectStrategyDto Map(SubjectStrategy source); |
||||
|
public override partial void Map(SubjectStrategy source, SubjectStrategyDto destination); |
||||
|
} |
||||
@ -1,29 +0,0 @@ |
|||||
using AutoMapper; |
|
||||
using System; |
|
||||
using System.Linq; |
|
||||
|
|
||||
namespace LINGYUN.Abp.DataProtectionManagement; |
|
||||
public class DataProtectionManagementApplicationMappingProfile :Profile |
|
||||
{ |
|
||||
public DataProtectionManagementApplicationMappingProfile() |
|
||||
{ |
|
||||
CreateMap<EntityEnumInfo, EntityEnumInfoDto>(); |
|
||||
CreateMap<EntityPropertyInfo, EntityPropertyInfoDto>(); |
|
||||
CreateMap<EntityTypeInfo, EntityTypeInfoDto>(); |
|
||||
CreateMap<RoleEntityRule, RoleEntityRuleDto>() |
|
||||
.ForMember(dto => dto.AccessedProperties, map => map.MapFrom(src => MapToArray(src.AccessedProperties))); |
|
||||
CreateMap<OrganizationUnitEntityRule, OrganizationUnitEntityRuleDto>() |
|
||||
.ForMember(dto => dto.AccessedProperties, map => map.MapFrom(src => MapToArray(src.AccessedProperties))); |
|
||||
|
|
||||
CreateMap<SubjectStrategy, SubjectStrategyDto>(); |
|
||||
} |
|
||||
|
|
||||
private string[] MapToArray(string val) |
|
||||
{ |
|
||||
if (val.IsNullOrWhiteSpace()) |
|
||||
{ |
|
||||
return Array.Empty<string>(); |
|
||||
} |
|
||||
return val.Split(',').ToArray(); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,25 @@ |
|||||
|
using Riok.Mapperly.Abstractions; |
||||
|
using Volo.Abp.Mapperly; |
||||
|
|
||||
|
namespace LINGYUN.Abp.DataProtectionManagement; |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class EntityTypeInfoToEntityTypeInfoEtoMapper : MapperBase<EntityTypeInfo, EntityTypeInfoEto> |
||||
|
{ |
||||
|
public override partial EntityTypeInfoEto Map(EntityTypeInfo source); |
||||
|
public override partial void Map(EntityTypeInfo source, EntityTypeInfoEto destination); |
||||
|
} |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class RoleEntityRuleToRoleEntityRuleEtoMapper : MapperBase<RoleEntityRule, RoleEntityRuleEto> |
||||
|
{ |
||||
|
public override partial RoleEntityRuleEto Map(RoleEntityRule source); |
||||
|
public override partial void Map(RoleEntityRule source, RoleEntityRuleEto destination); |
||||
|
} |
||||
|
|
||||
|
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] |
||||
|
public partial class OrganizationUnitEntityRuleToOrganizationUnitEntityRuleEtoMapper : MapperBase<OrganizationUnitEntityRule, OrganizationUnitEntityRuleEto> |
||||
|
{ |
||||
|
public override partial OrganizationUnitEntityRuleEto Map(OrganizationUnitEntityRule source); |
||||
|
public override partial void Map(OrganizationUnitEntityRule source, OrganizationUnitEntityRuleEto destination); |
||||
|
} |
||||
@ -1,12 +0,0 @@ |
|||||
using AutoMapper; |
|
||||
|
|
||||
namespace LINGYUN.Abp.DataProtectionManagement; |
|
||||
public class DataProtectionManagementDomainMappingProfile : Profile |
|
||||
{ |
|
||||
public DataProtectionManagementDomainMappingProfile() |
|
||||
{ |
|
||||
CreateMap<EntityTypeInfo, EntityTypeInfoEto>(); |
|
||||
CreateMap<RoleEntityRule, RoleEntityRuleEto>(); |
|
||||
CreateMap<OrganizationUnitEntityRule, OrganizationUnitEntityRuleEto>(); |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue