using System.Net; using NPin.Framework.AuditLogging.Domain.Entities; using NPin.Framework.AuditLogging.Domain.Events; using NPin.Framework.SqlSugarCore.Abstractions; using Volo.Abp.Auditing; namespace NPin.Framework.AuditLogging.Domain.Repositories; public interface IAuditLogRepository : ISqlSugarRepository { /// /// 获取每日平均执行时长 /// /// /// /// /// Task> GetAverageExecutionDurationPerDayAsync(DateTime startDate, DateTime endDate, CancellationToken cancellationToken = default); /// /// 获取数量 /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Task GetCountAsync(DateTime? startTime = null, DateTime? endTime = null, string httpMethod = null, string url = null, Guid? userId = null, string userName = null, string applicationName = null, string clientIpAddress = null, string correlationId = null, int? maxExecutionDuration = null, int? minExecutionDuration = null, bool? hasException = null, HttpStatusCode? httpStatusCode = null, CancellationToken cancellationToken = default); /// /// 获取实体改变日志 /// /// /// /// Task GetEntityChange(Guid entityChangeId, CancellationToken cancellationToken = default); /// /// 获取实体改变日志数量 /// /// /// /// /// /// /// /// /// Task GetEntityChangeCountAsync(Guid? auditLogId = null, DateTime? startTime = null, DateTime? endTime = null, EntityChangeType? changeType = null, string entityId = null, string entityTypeFullName = null, CancellationToken cancellationToken = default); /// /// 获取实体改变日志列表 /// /// /// /// /// /// /// /// /// /// /// /// /// Task> GetEntityChangeListAsync(string sorting = null, int maxResultCount = 50, int skipCount = 0, Guid? auditLogId = null, DateTime? startTime = null, DateTime? endTime = null, EntityChangeType? changeType = null, string entityId = null, string entityTypeFullName = null, bool includeDetails = false, CancellationToken cancellationToken = default); /// /// 获取用户名改变日志列表 /// /// /// /// /// Task> GetEntityChangesWithUsernameAsync(string entityId, string entityTypeFullName, CancellationToken cancellationToken = default); /// /// 获取用户名改变日志 /// /// /// Task GetEntityChangeWithUsernameAsync(Guid entityChangeId); /// /// 获取审计日志列表 /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Task> GetListAsync(string sorting = null, int maxResultCount = 50, int skipCount = 0, DateTime? startTime = null, DateTime? endTime = null, string httpMethod = null, string url = null, Guid? userId = null, string userName = null, string applicationName = null, string clientIpAddress = null, string correlationId = null, int? maxExecutionDuration = null, int? minExecutionDuration = null, bool? hasException = null, HttpStatusCode? httpStatusCode = null, bool includeDetails = false); }