From 177aa6f1c4601e4fb34aff04c4e328c98b489888 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期四, 07 八月 2025 10:17:14 +0800 Subject: [PATCH] fix:bug --- FlexJobApi.Core/FlexJobApiCoreStartup.cs | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/FlexJobApi.Core/FlexJobApiCoreStartup.cs b/FlexJobApi.Core/FlexJobApiCoreStartup.cs index c913fe3..a5a3aa0 100644 --- a/FlexJobApi.Core/FlexJobApiCoreStartup.cs +++ b/FlexJobApi.Core/FlexJobApiCoreStartup.cs @@ -1,4 +1,5 @@ -锘縰sing Furion; +锘縰sing Consul; +using Furion; using Furion.EventBus; using MediatR; using Microsoft.AspNetCore.Builder; @@ -19,16 +20,16 @@ { public void ConfigureServices(IServiceCollection services) { + services.AddHealthChecks(); + services.AddConsoleFormatter(options => { options.WithTraceId = true; - options.WithStackFrame = true; }); services.AddFileLogging(options => { options.WithTraceId = true; - options.WithStackFrame = true; options.FileNameRule = fileName => { return string.Format(fileName, DateTime.UtcNow); // 濡傛灉鏄湰鍦版椂闂翠娇鐢� DateTime.Now @@ -38,10 +39,13 @@ services.AddDatabaseLogging<DatabaseLoggingWriter>(options => { options.WithTraceId = true; - options.WithStackFrame = true; }); services.AddConfigurableOptions<AliyunOptions>(); + + services.AddHttpRemote(); + + services.AddComponent<ConsulServiceComponent>(); services.AddComponent<EventBusServiceComponent>(); @@ -70,6 +74,8 @@ .AddFriendlyException() .AddDataValidation() .AddInjectWithUnifyResult<FriendlyResultProvider>(); + + services.AddMvcFilter<ResourceActionFilter>(); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime) @@ -106,8 +112,11 @@ app.UseEndpoints(endpoints => { endpoints.MapControllers(); + endpoints.MapHealthChecks("/healthz"); }); + app.UseComponent<ConsulApplicationComponent>(env); + //lifetime.ApplicationStarted.Register(async () => //{ // await ResourceUtils.BuildDynamicControllersAsync(); -- Gitblit v1.9.1