feat: 完成审计日志模块引入

This commit is contained in:
陈淳
2024-01-23 15:08:01 +08:00
parent 96ae77e5ab
commit e9b5147743
19 changed files with 183 additions and 101 deletions

View File

@@ -1,4 +1,5 @@
using System;
using SqlSugar;
using Volo.Abp.Auditing;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities;
@@ -8,24 +9,29 @@ using Yi.Framework.AuditLogging.Domain.Shared.Consts;
namespace Yi.Framework.AuditLogging.Domain.Entities;
[DisableAuditing]
[SugarTable("YiAuditLogAction")]
[SugarIndex($"index_{nameof(AuditLogId)}", nameof(AuditLogId), OrderByType.Asc)]
[SugarIndex($"index_{nameof(TenantId)}_{nameof(ExecutionTime)}", nameof(TenantId), OrderByType.Asc, nameof(ServiceName), OrderByType.Asc, nameof(MethodName), OrderByType.Asc, nameof(ExecutionTime), OrderByType.Asc)]
public class AuditLogActionEntity : Entity<Guid>, 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? ServiceName { get; protected set; }
public virtual string MethodName { get; protected set; }
public virtual string? MethodName { get; protected set; }
public virtual string Parameters { get; protected set; }
public virtual string? Parameters { get; protected set; }
public virtual DateTime ExecutionTime { get; protected set; }
public virtual DateTime? ExecutionTime { get; protected set; }
public virtual int ExecutionDuration { get; protected set; }
public virtual int? ExecutionDuration { get; protected set; }
protected AuditLogActionEntity()
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
public AuditLogActionEntity()
{
}