| | |
| | | using Furion; |
| | | using Consul; |
| | | using Furion; |
| | | using Furion.EventBus; |
| | | using MediatR; |
| | | using Microsoft.AspNetCore.Builder; |
| | |
| | | { |
| | | public void ConfigureServices(IServiceCollection services) |
| | | { |
| | | services.AddHealthChecks(); |
| | | |
| | | services.AddConsoleFormatter(options => |
| | | { |
| | | options.WithTraceId = true; |
| | |
| | | options.WithStackFrame = true; |
| | | }); |
| | | |
| | | services.AddConfigurableOptions<AliyunOptions>(); |
| | | |
| | | services.AddHttpRemote(); |
| | | |
| | | services.AddComponent<ConsulServiceComponent>(); |
| | | |
| | | services.AddComponent<EventBusServiceComponent>(); |
| | | |
| | | services.AddComponent<DistributedCacheServiceComponent>(); |
| | |
| | | services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblies(App.Assemblies.ToArray())); |
| | | |
| | | services.AddHostedService<XmlDocBuildHostedService>(); |
| | | services.AddHostedService<BuildDynamicControllersHostedService>(); |
| | | |
| | | services.AddJwt<JwtHandler>(enableGlobalAuthorize: true); |
| | | |
| | |
| | | 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(); |
| | | //}); |
| | | } |
| | | } |
| | | } |