diff --git a/aspnet-core/modules/QueryManagement/src/CompanyName.ProjectName.QueryManagement.ElasticSearch/CompanyNameProjectNameLogRepository.cs b/aspnet-core/modules/QueryManagement/src/CompanyName.ProjectName.QueryManagement.ElasticSearch/CompanyNameProjectNameLogRepository.cs index ae3c1ff0..12215dc7 100644 --- a/aspnet-core/modules/QueryManagement/src/CompanyName.ProjectName.QueryManagement.ElasticSearch/CompanyNameProjectNameLogRepository.cs +++ b/aspnet-core/modules/QueryManagement/src/CompanyName.ProjectName.QueryManagement.ElasticSearch/CompanyNameProjectNameLogRepository.cs @@ -32,13 +32,15 @@ namespace CompanyName.ProjectName.QueryManagement.ElasticSearch public async Task> PaingAsync(PagingElasticSearchLogInput input) { // 默认查询当天 - input.StartCreationTime ??= DateTime.Now.Date; - - input.EndCreationTime ??= DateTime.Now.Date; + input.StartCreationTime = input.StartCreationTime?.AddMilliseconds(-1) ?? DateTime.Now.Date.AddMilliseconds(-1); + input.EndCreationTime = + input.EndCreationTime?.AddDays(1).AddMilliseconds(-1) ?? DateTime.Now.Date.AddDays(1).AddMilliseconds(-1); var mustFilters = new List, QueryContainer>> { - t => t.DateRange(f => f.Field(fd => fd.CreationTime).GreaterThanOrEquals(input.StartCreationTime.Value)), - t => t.DateRange(f => f.Field(fd => fd.CreationTime).LessThanOrEquals(input.EndCreationTime.Value)) + t => t.DateRange(f => + f.Field(fd => fd.CreationTime).TimeZone("Asia/Shanghai").GreaterThanOrEquals(input.StartCreationTime.Value)), + t => t.DateRange( + f => f.Field(fd => fd.CreationTime).TimeZone("Asia/Shanghai").LessThanOrEquals(input.EndCreationTime.Value)) }; if (!string.IsNullOrWhiteSpace(input.Filter)) diff --git a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Extensions/SerilogToEsExtensions.cs b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Extensions/SerilogToEsExtensions.cs index 87f67b44..999c4161 100644 --- a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Extensions/SerilogToEsExtensions.cs +++ b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Extensions/SerilogToEsExtensions.cs @@ -38,7 +38,7 @@ namespace CompanyName.ProjectName.Extensions if (!writeToElasticSearch) return; - var applicationName = "YHWmsOperationApiGateway.HttpApi.Host"; + var applicationName = "CompanyName.ProjectName.HttpApi.Host"; var esUrl = configuration["LogToElasticSearch:ElasticSearch:Url"]; // 需要设置ES URL diff --git a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs index ba3ebb57..7c148f4f 100644 --- a/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs +++ b/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs @@ -39,6 +39,7 @@ using CompanyName.ProjectName.Extensions.Customs.Http; using CompanyName.ProjectName.MultiTenancy; using Savorboard.CAP.InMemoryMessageQueue; using Serilog; +using Swashbuckle.AspNetCore.SwaggerUI; using Volo.Abp.AspNetCore.ExceptionHandling; using Volo.Abp.AspNetCore.MultiTenancy; @@ -111,11 +112,8 @@ namespace CompanyName.ProjectName app.UseAbpSwaggerUI(options => { options.SwaggerEndpoint("/swagger/v1/swagger.json", "ProjectName API"); - - var configuration = context.GetConfiguration(); - options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); - options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); - options.OAuthScopes("ProjectName"); + options.DocExpansion(DocExpansion.None); + options.DefaultModelsExpandDepth(-1); }); app.UseAuditing(); @@ -315,7 +313,6 @@ namespace CompanyName.ProjectName options => { options.SwaggerDoc("v1", new OpenApiInfo {Title = "CompanyNameProjectName API", Version = "v1"}); - options.DocInclusionPredicate((docName, description) => true); options.EnableAnnotations(); // 启用注解 options.DocumentFilter();