sunpengfei
2025-08-04 91a2e02189f94545e12a97f930dde793084ad24f
FlexJobApi.Core/FlexJobApiCoreStartup.cs
@@ -41,6 +41,8 @@
                options.WithStackFrame = true;
            });
            services.AddConfigurableOptions<AliyunOptions>();
            services.AddComponent<EventBusServiceComponent>();
            services.AddComponent<DistributedCacheServiceComponent>();
@@ -62,14 +64,14 @@
            services.AddControllers()
                    .AddNewtonsoftJson(options =>
                    {
                        options.SerializerSettings.Converters.Add(new StringEnumConverter());
                        //options.SerializerSettings.Converters.Add(new StringEnumConverter());
                    })
                    .AddFriendlyException()
                    .AddDataValidation()
                    .AddInjectWithUnifyResult<FriendlyResultProvider>();
        }
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime lifetime)
        {
            // 解析事件总线发布服务
            var eventPublisher = app.ApplicationServices.GetRequiredService<IEventPublisher>();
@@ -87,7 +89,7 @@
            app.UseUnifyResultStatusCodes();
            app.UseHttpsRedirection();
            //app.UseHttpsRedirection();
            app.UseRouting();
@@ -104,6 +106,11 @@
            {
                endpoints.MapControllers();
            });
            lifetime.ApplicationStarted.Register(async () =>
            {
                await ResourceUtils.BuildWebApis();
            });
        }
    }
}