| | |
| | | hostingContext.Configuration.ConfigureApplication(); |
| | | config.Sources.Clear(); |
| | | config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); |
| | | config.AddJsonFile("outbound_time_config.json", optional: true, reloadOnChange: true); |
| | | }); |
| | | |
| | | builder.Host.UseSerilog((context, services, loggerConfiguration) => |
| | |
| | | builder.Services.AddSingleton<RoundRobinService>(); |
| | | builder.Services.Configure<AutoOutboundTaskOptions>( |
| | | builder.Configuration.GetSection("AutoOutboundTask")); |
| | | builder.Services.Configure<OutboundTimeConfigOptions>( |
| | | builder.Configuration.GetSection(OutboundTimeConfigOptions.SectionName)); |
| | | builder.Services.AddMemoryCacheSetup(); // 缓存服务 |
| | | builder.Services.AddWebSocketSetup(); |
| | | builder.Services.AddSqlsugarSetup(); // SqlSugar 数据库配置 |
| | | builder.Services.AddDbSetup(); // Db 数据库配置 |
| | | builder.Services.AddInitializationHostServiceSetup(); // 应用程序初始化服务注册 |
| | | builder.Services.AddHostedService<AutoOutboundTaskBackgroundService>(); // 启动自动出库任务后台服务 |
| | | builder.Services.AddHostedService<StockMonitorBackgroundService>(); // 启动库存监控后台服务 |
| | | // builder.Services.AddHostedService<PermissionDataHostService>(); // 权限数据服务 |
| | | builder.Services.AddAutoMapperSetup(); |
| | | |