From 59e73ad4283491cd407854874879e0ddc8dafaba Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期四, 07 八月 2025 14:08:20 +0800
Subject: [PATCH] feat:地区字典

---
 FlexJobApi.Core/FlexJobApiCoreStartup.cs |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/FlexJobApi.Core/FlexJobApiCoreStartup.cs b/FlexJobApi.Core/FlexJobApiCoreStartup.cs
index eec79a6..a63fda8 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,8 +39,13 @@
             services.AddDatabaseLogging<DatabaseLoggingWriter>(options =>
             {
                 options.WithTraceId = true;
-                options.WithStackFrame = true;
             });
+
+            services.AddConfigurableOptions<AliyunOptions>();
+
+            services.AddHttpRemote();
+
+            services.AddComponent<ConsulServiceComponent>();
 
             services.AddComponent<EventBusServiceComponent>();
 
@@ -52,6 +58,8 @@
             services.AddJwt<JwtHandler>(enableGlobalAuthorize: true);
 
             services.AddCorsAccessor();
+
+            services.AddHostedService<BuildDynamicControllersHostedService>();
 
             services.AddSpecificationDocuments(options =>
             {
@@ -67,6 +75,8 @@
                     .AddFriendlyException()
                     .AddDataValidation()
                     .AddInjectWithUnifyResult<FriendlyResultProvider>();
+
+            services.AddMvcFilter<ResourceActionFilter>();
         }
 
         public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime)
@@ -103,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