| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Converters; |
| | | using Newtonsoft.Json.Serialization; |
| | | using Serilog; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Authorization; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | config.Sources.Clear(); |
| | | config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); |
| | | }); |
| | | |
| | | builder.Host.UseSerilog((context, services, loggerConfiguration) => |
| | | { |
| | | loggerConfiguration |
| | | .ReadFrom.Configuration(context.Configuration) |
| | | .ReadFrom.Services(services) |
| | | .Enrich.FromLogContext() |
| | | .WriteTo.Console() |
| | | .WriteTo.File("logs/log-.txt", rollingInterval: RollingInterval.Day); |
| | | }); |
| | | builder.ConfigureApplication(); |
| | | |
| | | // App.ExpDateTime = DateTime.Parse("2025-03-31 00:00:00"); // 设置过期时间 |
| | |
| | | builder.Services.AddSqlsugarSetup(); // SqlSugar 数据库配置 |
| | | builder.Services.AddDbSetup(); // Db 数据库配置 |
| | | builder.Services.AddInitializationHostServiceSetup(); // 应用程序初始化服务注册 |
| | | builder.Services.AddHostedService<AutoOutboundTaskBackgroundService>(); |
| | | builder.Services.AddHostedService<AutoOutboundTaskBackgroundService>(); // 启动自动出库任务后台服务 |
| | | // builder.Services.AddHostedService<PermissionDataHostService>(); // 权限数据服务 |
| | | builder.Services.AddAutoMapperSetup(); |
| | | |