From 88eba44f680f2faafd783f71b933006953697880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= <454313500@qq.com> Date: Mon, 22 Jan 2024 13:58:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E9=87=8D=E6=9E=84=E5=AE=A1=E8=AE=A1?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Abp.Net8/Yi.Abp.sln | 14 +++ .../Consts/AuditLogActionConsts.cs | 19 +++ .../Consts/AuditLogConsts.cs | 59 +++++++++ .../Consts/EntityChangeConsts.cs | 14 +++ .../Consts/EntityPropertyChangeConsts.cs | 24 ++++ ...ramework.AuditLogging.Domain.Shared.csproj | 9 ++ ...FrameworkAuditLoggingDomainSharedModule.cs | 7 ++ .../Entities/AuditLog.cs | 116 ++++++++++++++++++ .../Entities/AuditLogActionEntity.cs | 45 +++++++ .../Entities/EntityChangeEntity.cs | 52 ++++++++ .../Entities/EntityPropertyChangeEntity.cs | 47 +++++++ .../Yi.Framework.AuditLogging.Domain.csproj | 18 +++ .../YiFrameworkAuditLoggingDomainModule.cs | 7 ++ .../YiRbacDbContext.cs | 2 +- 14 files changed, 432 insertions(+), 1 deletion(-) create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/AuditLogActionConsts.cs create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/AuditLogConsts.cs create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/EntityChangeConsts.cs create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/EntityPropertyChangeConsts.cs create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Yi.Framework.AuditLogging.Domain.Shared.csproj create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/YiFrameworkAuditLoggingDomainSharedModule.cs create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/AuditLog.cs create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/AuditLogActionEntity.cs create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/EntityChangeEntity.cs create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/EntityPropertyChangeEntity.cs create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Yi.Framework.AuditLogging.Domain.csproj create mode 100644 Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/YiFrameworkAuditLoggingDomainModule.cs diff --git a/Yi.Abp.Net8/Yi.Abp.sln b/Yi.Abp.Net8/Yi.Abp.sln index b3d316e5..48181800 100644 --- a/Yi.Abp.Net8/Yi.Abp.sln +++ b/Yi.Abp.Net8/Yi.Abp.sln @@ -96,6 +96,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.TenantManageme EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.TenantManagement.Domain", "module\tenant-management\Yi.Framework.TenantManagement.Domain\Yi.Framework.TenantManagement.Domain.csproj", "{54D8E2BC-591C-4344-A58E-874D49C00B41}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.AuditLogging.Domain", "module\audit-logging\Yi.Framework.AuditLogging.Domain\Yi.Framework.AuditLogging.Domain.csproj", "{EFD13211-17B5-400A-B99A-9F6F4E520C1E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.AuditLogging.Domain.Shared", "module\audit-logging\Yi.Framework.AuditLogging.Domain.Shared\Yi.Framework.AuditLogging.Domain.Shared.csproj", "{9C8C3C53-3DCE-4516-867E-228858E61B26}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -238,6 +242,14 @@ Global {54D8E2BC-591C-4344-A58E-874D49C00B41}.Debug|Any CPU.Build.0 = Debug|Any CPU {54D8E2BC-591C-4344-A58E-874D49C00B41}.Release|Any CPU.ActiveCfg = Release|Any CPU {54D8E2BC-591C-4344-A58E-874D49C00B41}.Release|Any CPU.Build.0 = Release|Any CPU + {EFD13211-17B5-400A-B99A-9F6F4E520C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EFD13211-17B5-400A-B99A-9F6F4E520C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EFD13211-17B5-400A-B99A-9F6F4E520C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EFD13211-17B5-400A-B99A-9F6F4E520C1E}.Release|Any CPU.Build.0 = Release|Any CPU + {9C8C3C53-3DCE-4516-867E-228858E61B26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C8C3C53-3DCE-4516-867E-228858E61B26}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C8C3C53-3DCE-4516-867E-228858E61B26}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C8C3C53-3DCE-4516-867E-228858E61B26}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -281,6 +293,8 @@ Global {499A8C71-7892-42D0-A77E-48756E1EFF16} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853} {FA5BBAA1-08DC-472F-BB2C-5314E59D1556} = {499A8C71-7892-42D0-A77E-48756E1EFF16} {54D8E2BC-591C-4344-A58E-874D49C00B41} = {499A8C71-7892-42D0-A77E-48756E1EFF16} + {EFD13211-17B5-400A-B99A-9F6F4E520C1E} = {73CCF2C4-B9FD-44AB-8D4B-0A421805B094} + {9C8C3C53-3DCE-4516-867E-228858E61B26} = {73CCF2C4-B9FD-44AB-8D4B-0A421805B094} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {23D6FBC9-C970-4641-BC1E-2AEA59F51C18} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/AuditLogActionConsts.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/AuditLogActionConsts.cs new file mode 100644 index 00000000..0352d648 --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/AuditLogActionConsts.cs @@ -0,0 +1,19 @@ +namespace Yi.Framework.AuditLogging.Domain.Shared.Consts; + +public class AuditLogActionConsts +{ + /// + /// Default value: 256 + /// + public static int MaxServiceNameLength { get; set; } = 256; + + /// + /// Default value: 128 + /// + public static int MaxMethodNameLength { get; set; } = 128; + + /// + /// Default value: 2000 + /// + public static int MaxParametersLength { get; set; } = 2000; +} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/AuditLogConsts.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/AuditLogConsts.cs new file mode 100644 index 00000000..913eb4e5 --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/AuditLogConsts.cs @@ -0,0 +1,59 @@ +namespace Yi.Framework.AuditLogging.Domain.Shared.Consts; + +public static class AuditLogConsts +{ + /// + /// Default value: 96 + /// + public static int MaxApplicationNameLength { get; set; } = 96; + + /// + /// Default value: 64 + /// + public static int MaxClientIpAddressLength { get; set; } = 64; + + /// + /// Default value: 128 + /// + public static int MaxClientNameLength { get; set; } = 128; + + /// + /// Default value: 64 + /// + public static int MaxClientIdLength { get; set; } = 64; + + /// + /// Default value: 64 + /// + public static int MaxCorrelationIdLength { get; set; } = 64; + + /// + /// Default value: 512 + /// + public static int MaxBrowserInfoLength { get; set; } = 512; + + /// + /// Default value: 256 + /// + public static int MaxCommentsLength { get; set; } = 256; + + /// + /// Default value: 256 + /// + public static int MaxUrlLength { get; set; } = 256; + + /// + /// Default value: 16 + /// + public static int MaxHttpMethodLength { get; set; } = 16; + + /// + /// Default value: 256 + /// + public static int MaxUserNameLength { get; set; } = 256; + + /// + /// Default value: 64 + /// + public static int MaxTenantNameLength { get; set; } = 64; +} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/EntityChangeConsts.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/EntityChangeConsts.cs new file mode 100644 index 00000000..5942b7e7 --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/EntityChangeConsts.cs @@ -0,0 +1,14 @@ +namespace Yi.Framework.AuditLogging.Domain.Shared.Consts; + +public class EntityChangeConsts +{ + /// + /// Default value: 128 + /// + public static int MaxEntityTypeFullNameLength { get; set; } = 128; + + /// + /// Default value: 128 + /// + public static int MaxEntityIdLength { get; set; } = 128; +} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/EntityPropertyChangeConsts.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/EntityPropertyChangeConsts.cs new file mode 100644 index 00000000..cc1e45f6 --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Consts/EntityPropertyChangeConsts.cs @@ -0,0 +1,24 @@ +namespace Yi.Framework.AuditLogging.Domain.Shared.Consts; + +public class EntityPropertyChangeConsts +{ + /// + /// Default value: 512 + /// + public static int MaxNewValueLength { get; set; } = 512; + + /// + /// Default value: 512 + /// + public static int MaxOriginalValueLength { get; set; } = 512; + + /// + /// Default value: 128 + /// + public static int MaxPropertyNameLength { get; set; } = 128; + + /// + /// Default value: 64 + /// + public static int MaxPropertyTypeFullNameLength { get; set; } = 64; +} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Yi.Framework.AuditLogging.Domain.Shared.csproj b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Yi.Framework.AuditLogging.Domain.Shared.csproj new file mode 100644 index 00000000..fa71b7ae --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/Yi.Framework.AuditLogging.Domain.Shared.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/YiFrameworkAuditLoggingDomainSharedModule.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/YiFrameworkAuditLoggingDomainSharedModule.cs new file mode 100644 index 00000000..8f04b3ae --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain.Shared/YiFrameworkAuditLoggingDomainSharedModule.cs @@ -0,0 +1,7 @@ +namespace Yi.Framework.AuditLogging.Domain.Shared +{ + public class YiFrameworkAuditLoggingDomainSharedModule + { + + } +} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/AuditLog.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/AuditLog.cs new file mode 100644 index 00000000..dcdbe84d --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/AuditLog.cs @@ -0,0 +1,116 @@ +using Volo.Abp.Auditing; +using Volo.Abp.Data; +using Volo.Abp.Domain.Entities; +using Volo.Abp.MultiTenancy; +using Yi.Framework.AuditLogging.Domain.Shared.Consts; + +namespace Yi.Framework.AuditLogging.Domain.Entities +{ + [DisableAuditing] + public class AuditLogAggregateRoot: AggregateRoot, IMultiTenant + { + public AuditLogAggregateRoot() + { + + } + + public AuditLogAggregateRoot( + Guid id, + string applicationName, + Guid? tenantId, + string tenantName, + Guid? userId, + string userName, + DateTime executionTime, + int executionDuration, + string clientIpAddress, + string clientName, + string clientId, + string correlationId, + string browserInfo, + string httpMethod, + string url, + int? httpStatusCode, + Guid? impersonatorUserId, + string impersonatorUserName, + Guid? impersonatorTenantId, + string impersonatorTenantName, + ExtraPropertyDictionary extraPropertyDictionary, + List entityChanges, + List actions, + string exceptions, + string comments) + : base(id) + { + ApplicationName = applicationName.Truncate(AuditLogConsts.MaxApplicationNameLength); + TenantId = tenantId; + TenantName = tenantName.Truncate(AuditLogConsts.MaxTenantNameLength); + UserId = userId; + UserName = userName.Truncate(AuditLogConsts.MaxUserNameLength); + ExecutionTime = executionTime; + ExecutionDuration = executionDuration; + ClientIpAddress = clientIpAddress.Truncate(AuditLogConsts.MaxClientIpAddressLength); + ClientName = clientName.Truncate(AuditLogConsts.MaxClientNameLength); + ClientId = clientId.Truncate(AuditLogConsts.MaxClientIdLength); + CorrelationId = correlationId.Truncate(AuditLogConsts.MaxCorrelationIdLength); + BrowserInfo = browserInfo.Truncate(AuditLogConsts.MaxBrowserInfoLength); + HttpMethod = httpMethod.Truncate(AuditLogConsts.MaxHttpMethodLength); + Url = url.Truncate(AuditLogConsts.MaxUrlLength); + HttpStatusCode = httpStatusCode; + ImpersonatorUserId = impersonatorUserId; + ImpersonatorUserName = impersonatorUserName.Truncate(AuditLogConsts.MaxUserNameLength); + ImpersonatorTenantId = impersonatorTenantId; + ImpersonatorTenantName = impersonatorTenantName.Truncate(AuditLogConsts.MaxTenantNameLength); + ExtraProperties = extraPropertyDictionary; + EntityChanges = entityChanges; + Actions = actions; + Exceptions = exceptions; + Comments = comments.Truncate(AuditLogConsts.MaxCommentsLength); + } + + public virtual string ApplicationName { get; set; } + + public virtual Guid? UserId { get; protected set; } + + public virtual string UserName { get; protected set; } + + public virtual string TenantName { get; protected set; } + + public virtual Guid? ImpersonatorUserId { get; protected set; } + + public virtual string ImpersonatorUserName { get; protected set; } + + public virtual Guid? ImpersonatorTenantId { get; protected set; } + + public virtual string ImpersonatorTenantName { get; protected set; } + + public virtual DateTime ExecutionTime { get; protected set; } + + public virtual int ExecutionDuration { get; protected set; } + + public virtual string ClientIpAddress { get; protected set; } + + public virtual string ClientName { get; protected set; } + + public virtual string ClientId { get; set; } + + public virtual string CorrelationId { get; set; } + + public virtual string BrowserInfo { get; protected set; } + + public virtual string HttpMethod { get; protected set; } + + public virtual string Url { get; protected set; } + + public virtual string Exceptions { get; protected set; } + + public virtual string Comments { get; protected set; } + + public virtual int? HttpStatusCode { get; set; } + + public virtual Guid? TenantId { get; protected set; } + public virtual List EntityChanges { get; protected set; } + + public virtual List Actions { get; protected set; } + } +} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/AuditLogActionEntity.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/AuditLogActionEntity.cs new file mode 100644 index 00000000..b4e049fe --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/AuditLogActionEntity.cs @@ -0,0 +1,45 @@ +using System; +using Volo.Abp.Auditing; +using Volo.Abp.Data; +using Volo.Abp.Domain.Entities; +using Volo.Abp.MultiTenancy; +using Yi.Framework.AuditLogging.Domain.Shared.Consts; + +namespace Yi.Framework.AuditLogging.Domain.Entities; + +[DisableAuditing] +public class AuditLogActionEntity : Entity, IMultiTenant +{ + public virtual Guid? TenantId { get; protected set; } + + public virtual Guid AuditLogId { get; protected set; } + + public virtual string ServiceName { get; protected set; } + + public virtual string MethodName { get; protected set; } + + public virtual string Parameters { get; protected set; } + + public virtual DateTime ExecutionTime { get; protected set; } + + public virtual int ExecutionDuration { get; protected set; } + + + protected AuditLogActionEntity() + { + } + + public AuditLogActionEntity(Guid id, Guid auditLogId, AuditLogActionInfo actionInfo, Guid? tenantId = null) + { + + Id = id; + TenantId = tenantId; + AuditLogId = auditLogId; + ExecutionTime = actionInfo.ExecutionTime; + ExecutionDuration = actionInfo.ExecutionDuration; + + ServiceName = actionInfo.ServiceName.TruncateFromBeginning(AuditLogActionConsts.MaxServiceNameLength); + MethodName = actionInfo.MethodName.TruncateFromBeginning(AuditLogActionConsts.MaxMethodNameLength); + Parameters = actionInfo.Parameters.Length > AuditLogActionConsts.MaxParametersLength ? "" : actionInfo.Parameters; + } +} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/EntityChangeEntity.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/EntityChangeEntity.cs new file mode 100644 index 00000000..d119ccf7 --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/EntityChangeEntity.cs @@ -0,0 +1,52 @@ +using Volo.Abp.Auditing; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; +using Yi.Framework.AuditLogging.Domain.Shared.Consts; + +namespace Yi.Framework.AuditLogging.Domain.Entities +{ + public class EntityChangeEntity : Entity, IMultiTenant + { + public virtual Guid AuditLogId { get; protected set; } + + public virtual Guid? TenantId { get; protected set; } + + public virtual DateTime ChangeTime { get; protected set; } + + public virtual EntityChangeType ChangeType { get; protected set; } + + public virtual Guid? EntityTenantId { get; protected set; } + + public virtual string EntityId { get; protected set; } + + public virtual string EntityTypeFullName { get; protected set; } + + public virtual ICollection PropertyChanges { get; protected set; } + + + public EntityChangeEntity( + IGuidGenerator guidGenerator, + Guid auditLogId, + EntityChangeInfo entityChangeInfo, + Guid? tenantId = null) + { + Id = guidGenerator.Create(); + AuditLogId = auditLogId; + TenantId = tenantId; + ChangeTime = entityChangeInfo.ChangeTime; + ChangeType = entityChangeInfo.ChangeType; + EntityTenantId = entityChangeInfo.EntityTenantId; + EntityId = entityChangeInfo.EntityId.Truncate(EntityChangeConsts.MaxEntityTypeFullNameLength); + EntityTypeFullName = entityChangeInfo.EntityTypeFullName.TruncateFromBeginning(EntityChangeConsts.MaxEntityTypeFullNameLength); + + PropertyChanges = entityChangeInfo + .PropertyChanges? + .Select(p => new EntityPropertyChangeEntity(guidGenerator, Id, p, tenantId)) + .ToList() + ?? new List(); + + + } + } +} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/EntityPropertyChangeEntity.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/EntityPropertyChangeEntity.cs new file mode 100644 index 00000000..7140c701 --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Entities/EntityPropertyChangeEntity.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Auditing; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; +using Yi.Framework.AuditLogging.Domain.Shared.Consts; + +namespace Yi.Framework.AuditLogging.Domain.Entities +{ + public class EntityPropertyChangeEntity:Entity, IMultiTenant + { + public EntityPropertyChangeEntity() + { + + } + + + public EntityPropertyChangeEntity( + IGuidGenerator guidGenerator, + Guid entityChangeId, + EntityPropertyChangeInfo entityChangeInfo, + Guid? tenantId = null) + { + Id = guidGenerator.Create(); + TenantId = tenantId; + EntityChangeId = entityChangeId; + NewValue = entityChangeInfo.NewValue.Truncate(EntityPropertyChangeConsts.MaxNewValueLength); + OriginalValue = entityChangeInfo.OriginalValue.Truncate(EntityPropertyChangeConsts.MaxOriginalValueLength); + PropertyName = entityChangeInfo.PropertyName.TruncateFromBeginning(EntityPropertyChangeConsts.MaxPropertyNameLength); + PropertyTypeFullName = entityChangeInfo.PropertyTypeFullName.TruncateFromBeginning(EntityPropertyChangeConsts.MaxPropertyTypeFullNameLength); + } + public virtual Guid? TenantId { get; protected set; } + public virtual Guid EntityChangeId { get; protected set; } + + public virtual string NewValue { get; protected set; } + + public virtual string OriginalValue { get; protected set; } + + public virtual string PropertyName { get; protected set; } + + public virtual string PropertyTypeFullName { get; protected set; } + } +} diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Yi.Framework.AuditLogging.Domain.csproj b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Yi.Framework.AuditLogging.Domain.csproj new file mode 100644 index 00000000..46b5eced --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/Yi.Framework.AuditLogging.Domain.csproj @@ -0,0 +1,18 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + diff --git a/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/YiFrameworkAuditLoggingDomainModule.cs b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/YiFrameworkAuditLoggingDomainModule.cs new file mode 100644 index 00000000..e5687bd5 --- /dev/null +++ b/Yi.Abp.Net8/module/audit-logging/Yi.Framework.AuditLogging.Domain/YiFrameworkAuditLoggingDomainModule.cs @@ -0,0 +1,7 @@ +namespace Yi.Framework.AuditLogging.Domain +{ + public class YiFrameworkAuditLoggingDomainModule + { + + } +} diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/YiRbacDbContext.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/YiRbacDbContext.cs index a43997b7..6bd77d52 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/YiRbacDbContext.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.SqlSugarCore/YiRbacDbContext.cs @@ -39,7 +39,7 @@ namespace Yi.Framework.Rbac.SqlSugarCore var roleInfo = CurrentUser.GetRoleInfo(); //如果无岗位,或者无角色,只能看自己的数据 - if (CurrentUser.GetDeptId() is null || roleInfo is null) + if (/*CurrentUser.GetDeptId() is null ||*/ roleInfo is null) { expUser.Or(it => it.Id == CurrentUser.Id); expRole.Or(it => roleInfo.Select(x=>x.Id).Contains(it.Id));