|
|
|
@ -19,12 +19,13 @@ namespace Volo.Abp.AuditLogging.MongoDB |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<Paging.PagedResult<AuditLog>> GetListAsync(string sorting = null, int maxResultCount = 50, int skipCount = 0, string filter = null, |
|
|
|
string httpMethod = null, string url = null, HttpStatusCode? httpStatusCode = null, bool includeDetails = false) |
|
|
|
string httpMethod = null, string url = null, string userName = null, HttpStatusCode? httpStatusCode = null, bool includeDetails = false) |
|
|
|
{ |
|
|
|
var query = GetMongoQueryable() |
|
|
|
.WhereIf(httpMethod != null, q => q.HttpMethod.ToLowerInvariant() == httpMethod.ToLowerInvariant()) |
|
|
|
.WhereIf(url != null, q => q.Url.ToLowerInvariant().Contains(url.ToLowerInvariant())) |
|
|
|
.WhereIf(httpStatusCode != null && httpStatusCode > 0, q => q.HttpStatusCode == (int?)httpStatusCode); |
|
|
|
.WhereIf(httpMethod != null, auditLog => auditLog.HttpMethod != null && auditLog.HttpMethod.ToLowerInvariant() == httpMethod.ToLowerInvariant()) |
|
|
|
.WhereIf(url != null, auditLog => auditLog.Url != null && auditLog.Url.ToLowerInvariant().Contains(url.ToLowerInvariant())) |
|
|
|
.WhereIf(userName != null, auditLog => auditLog.UserName != null && auditLog.UserName == userName) |
|
|
|
.WhereIf(httpStatusCode != null && httpStatusCode > 0, auditLog => auditLog.HttpStatusCode == (int?)httpStatusCode); |
|
|
|
|
|
|
|
var totalCount = await query.As<IMongoQueryable<AuditLog>>().LongCountAsync(); |
|
|
|
|
|
|
|
|