Browse Source

Add `clientId` parameter to `IAuditLogRepository`.

pull/19368/head
maliming 2 years ago
parent
commit
3d9b291edf
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 2
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs
  2. 8
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs
  3. 6
      modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs

2
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs

@ -18,6 +18,7 @@ public interface IAuditLogRepository : IRepository<AuditLog, Guid>
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string clientId = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
@ -35,6 +36,7 @@ public interface IAuditLogRepository : IRepository<AuditLog, Guid>
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string clientId = null,
Guid? userId = null,
string userName = null,
string applicationName = null,

8
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs

@ -29,6 +29,7 @@ public class EfCoreAuditLogRepository : EfCoreRepository<IAuditLoggingDbContext,
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string clientId = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
@ -46,6 +47,7 @@ public class EfCoreAuditLogRepository : EfCoreRepository<IAuditLoggingDbContext,
endTime,
httpMethod,
url,
clientId,
userId,
userName,
applicationName,
@ -71,6 +73,7 @@ public class EfCoreAuditLogRepository : EfCoreRepository<IAuditLoggingDbContext,
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string clientId = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
@ -87,6 +90,7 @@ public class EfCoreAuditLogRepository : EfCoreRepository<IAuditLoggingDbContext,
endTime,
httpMethod,
url,
clientId,
userId,
userName,
applicationName,
@ -108,6 +112,7 @@ public class EfCoreAuditLogRepository : EfCoreRepository<IAuditLoggingDbContext,
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string clientId = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
@ -128,6 +133,7 @@ public class EfCoreAuditLogRepository : EfCoreRepository<IAuditLoggingDbContext,
.WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null || auditLog.Exceptions == "")
.WhereIf(!httpMethod.IsNullOrEmpty(), auditLog => auditLog.HttpMethod == httpMethod)
.WhereIf(!url.IsNullOrEmpty(), auditLog => auditLog.Url != null && auditLog.Url.Contains(url))
.WhereIf(!clientId.IsNullOrEmpty(), auditLog => auditLog.ClientId == clientId)
.WhereIf(userId != null, auditLog => auditLog.UserId == userId)
.WhereIf(!userName.IsNullOrEmpty(), auditLog => auditLog.UserName == userName)
.WhereIf(!applicationName.IsNullOrEmpty(), auditLog => auditLog.ApplicationName == applicationName)
@ -159,7 +165,7 @@ public class EfCoreAuditLogRepository : EfCoreRepository<IAuditLoggingDbContext,
return GetQueryable().IncludeDetails();
}
public override async Task<IQueryable<AuditLog>> WithDetailsAsync()
public async override Task<IQueryable<AuditLog>> WithDetailsAsync()
{
return (await GetQueryableAsync()).IncludeDetails();
}

6
modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs

@ -30,6 +30,7 @@ public class MongoAuditLogRepository : MongoDbRepository<IAuditLoggingMongoDbCon
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string clientId = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
@ -47,6 +48,7 @@ public class MongoAuditLogRepository : MongoDbRepository<IAuditLoggingMongoDbCon
endTime,
httpMethod,
url,
clientId,
userId,
userName,
applicationName,
@ -72,6 +74,7 @@ public class MongoAuditLogRepository : MongoDbRepository<IAuditLoggingMongoDbCon
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string clientId = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
@ -88,6 +91,7 @@ public class MongoAuditLogRepository : MongoDbRepository<IAuditLoggingMongoDbCon
endTime,
httpMethod,
url,
clientId,
userId,
userName,
applicationName,
@ -111,6 +115,7 @@ public class MongoAuditLogRepository : MongoDbRepository<IAuditLoggingMongoDbCon
DateTime? endTime = null,
string httpMethod = null,
string url = null,
string clientId = null,
Guid? userId = null,
string userName = null,
string applicationName = null,
@ -130,6 +135,7 @@ public class MongoAuditLogRepository : MongoDbRepository<IAuditLoggingMongoDbCon
.WhereIf(hasException.HasValue && !hasException.Value, auditLog => auditLog.Exceptions == null || auditLog.Exceptions == "")
.WhereIf(!httpMethod.IsNullOrEmpty(), auditLog => auditLog.HttpMethod == httpMethod)
.WhereIf(!url.IsNullOrEmpty(), auditLog => auditLog.Url != null && auditLog.Url.Contains(url))
.WhereIf(!clientId.IsNullOrEmpty(), auditLog => auditLog.ClientId == clientId)
.WhereIf(userId != null, auditLog => auditLog.UserId == userId)
.WhereIf(!userName.IsNullOrEmpty(), auditLog => auditLog.UserName == userName)
.WhereIf(!applicationName.IsNullOrEmpty(), auditLog => auditLog.ApplicationName == applicationName)

Loading…
Cancel
Save