|
|
@ -41,7 +41,6 @@ namespace Sanhe.Abp.AuditLogging.Elasticsearch |
|
|
|
Logger = NullLogger<ElasticsearchAuditLogManager>.Instance; |
|
|
|
Logger = NullLogger<ElasticsearchAuditLogManager>.Instance; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual async Task<long> GetCountAsync( |
|
|
|
public virtual async Task<long> GetCountAsync( |
|
|
|
DateTime? startTime = null, |
|
|
|
DateTime? startTime = null, |
|
|
|
DateTime? endTime = null, |
|
|
|
DateTime? endTime = null, |
|
|
@ -213,13 +212,20 @@ namespace Sanhe.Abp.AuditLogging.Elasticsearch |
|
|
|
|
|
|
|
|
|
|
|
var auditLog = await _converter.ConvertAsync(auditLogInfo); |
|
|
|
var auditLog = await _converter.ConvertAsync(auditLogInfo); |
|
|
|
|
|
|
|
|
|
|
|
var response = await client.IndexAsync( |
|
|
|
//var response = await client.IndexAsync( |
|
|
|
auditLog, |
|
|
|
// auditLog, |
|
|
|
(x) => x.Index(CreateIndex()) |
|
|
|
// (x) => x.Index(CreateIndex()) |
|
|
|
.Id(auditLog.Id), |
|
|
|
// .Id(auditLog.Id), |
|
|
|
cancellationToken); |
|
|
|
// cancellationToken); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 使用 Bulk 命令传输可能存在参数庞大的日志结构 |
|
|
|
|
|
|
|
var response = await client.BulkAsync( |
|
|
|
|
|
|
|
dsl => dsl.Index(CreateIndex()) |
|
|
|
|
|
|
|
.Create<AuditLog>(ct => |
|
|
|
|
|
|
|
ct.Id(auditLog.Id) |
|
|
|
|
|
|
|
.Document(auditLog))); |
|
|
|
|
|
|
|
|
|
|
|
return response.Id; |
|
|
|
return response.Items?.FirstOrDefault()?.Id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected virtual List<Func<QueryContainerDescriptor<AuditLog>, QueryContainer>> BuildQueryDescriptor( |
|
|
|
protected virtual List<Func<QueryContainerDescriptor<AuditLog>, QueryContainer>> BuildQueryDescriptor( |
|
|
|