From 71d0c92a63f1e26c6ba9634413083de1acaf916c Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期三, 06 八月 2025 11:18:29 +0800 Subject: [PATCH] feat:数据字典类别开发 --- FlexJobApi.Core/FlexJobApiCoreStartup.cs | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/FlexJobApi.Core/FlexJobApiCoreStartup.cs b/FlexJobApi.Core/FlexJobApiCoreStartup.cs index f52f125..cc2c31d 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,6 +20,8 @@ { public void ConfigureServices(IServiceCollection services) { + services.AddHealthChecks(); + services.AddConsoleFormatter(options => { options.WithTraceId = true; @@ -43,6 +46,10 @@ services.AddConfigurableOptions<AliyunOptions>(); + services.AddHttpRemote(); + + services.AddComponent<ConsulServiceComponent>(); + services.AddComponent<EventBusServiceComponent>(); services.AddComponent<DistributedCacheServiceComponent>(); @@ -50,6 +57,7 @@ services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblies(App.Assemblies.ToArray())); services.AddHostedService<XmlDocBuildHostedService>(); + services.AddHostedService<BuildDynamicControllersHostedService>(); services.AddJwt<JwtHandler>(enableGlobalAuthorize: true); @@ -105,12 +113,15 @@ app.UseEndpoints(endpoints => { endpoints.MapControllers(); + endpoints.MapHealthChecks("/healthz"); }); - lifetime.ApplicationStarted.Register(async () => - { - await ResourceUtils.BuildWebApis(); - }); + app.UseComponent<ConsulApplicationComponent>(env); + + //lifetime.ApplicationStarted.Register(async () => + //{ + // await ResourceUtils.BuildDynamicControllersAsync(); + //}); } } } -- Gitblit v1.9.1