Merge pull request #9245 from PMExtra/feature/audit_log-user_id

feat(audit-logging): add userId filter
pull/9253/head
maliming 4 years ago committed by GitHub
commit adb2adfba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,6 +18,7 @@ namespace Volo.Abp.AuditLogging
DateTime? endTime = null,
string httpMethod = null,
string url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
@ -33,6 +34,7 @@ namespace Volo.Abp.AuditLogging
DateTime? endTime = null,
string httpMethod = null,
string url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,

@ -29,6 +29,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
DateTime? endTime = null,
string httpMethod = null,
string url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
@ -44,6 +45,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
endTime,
httpMethod,
url,
userId,
userName,
applicationName,
correlationId,
@ -67,6 +69,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
DateTime? endTime = null,
string httpMethod = null,
string url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
@ -81,6 +84,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
endTime,
httpMethod,
url,
userId,
userName,
applicationName,
correlationId,
@ -100,6 +104,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
DateTime? endTime = null,
string httpMethod = null,
string url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
@ -118,6 +123,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
.WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null || auditLog.Exceptions == "")
.WhereIf(httpMethod != null, auditLog => auditLog.HttpMethod == httpMethod)
.WhereIf(url != null, auditLog => auditLog.Url != null && auditLog.Url.Contains(url))
.WhereIf(userId != null, auditLog => auditLog.UserId == userId)
.WhereIf(userName != null, auditLog => auditLog.UserName == userName)
.WhereIf(applicationName != null, auditLog => auditLog.ApplicationName == applicationName)
.WhereIf(correlationId != null, auditLog => auditLog.CorrelationId == correlationId)

@ -30,6 +30,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
DateTime? endTime = null,
string httpMethod = null,
string url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
@ -45,6 +46,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
endTime,
httpMethod,
url,
userId,
userName,
applicationName,
correlationId,
@ -68,6 +70,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
DateTime? endTime = null,
string httpMethod = null,
string url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
@ -82,6 +85,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
endTime,
httpMethod,
url,
userId,
userName,
applicationName,
correlationId,
@ -103,6 +107,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
DateTime? endTime = null,
string httpMethod = null,
string url = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
string correlationId = null,
@ -120,6 +125,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
.WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null || auditLog.Exceptions == "")
.WhereIf(httpMethod != null, auditLog => auditLog.HttpMethod == httpMethod)
.WhereIf(url != null, auditLog => auditLog.Url != null && auditLog.Url.Contains(url))
.WhereIf(userId != null, auditLog => auditLog.UserId == userId)
.WhereIf(userName != null, auditLog => auditLog.UserName == userName)
.WhereIf(applicationName != null, auditLog => auditLog.ApplicationName == applicationName)
.WhereIf(correlationId != null, auditLog => auditLog.CorrelationId == correlationId)
@ -128,7 +134,6 @@ namespace Volo.Abp.AuditLogging.MongoDB
.WhereIf(minDuration != null && minDuration > 0, auditLog => auditLog.ExecutionDuration >= minDuration);
}
public virtual async Task<Dictionary<DateTime, double>> GetAverageExecutionDurationPerDayAsync(
DateTime startDate,
DateTime endDate,

Loading…
Cancel
Save