File was renamed from FlexJobApi.Core/FlexJobApiCoreStartup.cs |
| | |
| | | using Consul; |
| | | using FlexJobApi.Core; |
| | | using Furion; |
| | | using Furion.EventBus; |
| | | using Furion.Schedule; |
| | | using MediatR; |
| | | using Microsoft.AspNetCore.Builder; |
| | | using Microsoft.AspNetCore.Hosting; |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace FlexJobApi.Core |
| | | namespace FlexJobApi.Web.Entry |
| | | { |
| | | [AppStartup(2)] |
| | | public class FlexJobApiCoreStartup : AppStartup |
| | | public class Startup : AppStartup |
| | | { |
| | | public void ConfigureServices(IServiceCollection services) |
| | | { |
| | | services.AddHealthChecks(); |
| | | |
| | | services.AddConsoleFormatter(options => |
| | | { |
| | | options.WithTraceId = true; |
| | | }); |
| | | |
| | | services.AddFileLogging(options => |
| | | { |
| | | options.WithTraceId = true; |
| | | options.FileNameRule = fileName => |
| | | { |
| | | return string.Format(fileName, DateTime.Now); |
| | | }; |
| | | }); |
| | | |
| | | //services.AddDatabaseLogging<DatabaseLoggingWriter>(options => |
| | | //{ |
| | | // options.WithTraceId = true; |
| | | //}); |
| | | |
| | | services.AddConfigurableOptions<AliyunOptions>(); |
| | | |
| | | services.AddComponent<LogServiceComponent>(); |
| | | |
| | | services.AddComponent<ConsulServiceComponent>(); |
| | | |
| | |
| | | services.AddCorsAccessor(); |
| | | |
| | | services.AddHostedService<BuildDynamicControllersHostedService>(); |
| | | |
| | | services.AddSchedule(options => |
| | | { |
| | | options.BuildSqlType = SqlTypes.SqlServer; |
| | | options.JobDetail.LogEnabled = true; |
| | | options.AddPersistence<DbJobPersistence>(); |
| | | }); |
| | | |
| | | services.AddSpecificationDocuments(options => |
| | | { |
| | |
| | | |
| | | app.UseInject(string.Empty); |
| | | |
| | | app.UseStaticFiles(); |
| | | app.UseScheduleUI(); |
| | | |
| | | app.UseSpecificationDocuments(); |
| | | |
| | | app.UseEndpoints(endpoints => |