using F9WebAiTest.Application.Services; using F9WebAiTest.Application.Services.Attendance; using F9WebAiTest.Application.Services.Auth; using F9WebAiTest.Application.Services.Base; using F9WebAiTest.Application.Services.Notice; using F9WebAiTest.Application.Services.Prod; using F9WebAiTest.Application.Services.QC; using F9WebAiTest.Application.Services.Reports; using F9WebAiTest.Application.Interfaces.Reports; using MediatR; using Microsoft.Extensions.DependencyInjection; namespace F9WebAiTest.Application; public static class DependencyInjection { public static IServiceCollection AddApplication(this IServiceCollection services) { services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); // 质量模块:工艺执行书 / 样茧试缫 services.AddScoped(); services.AddScoped(); // 报表数据提供者(按 Config.DsName 解析,自动注册所有实现) foreach (var t in typeof(DependencyInjection).Assembly.GetTypes() .Where(t => !t.IsAbstract && typeof(IReportDataProvider).IsAssignableFrom(t))) { services.AddScoped(typeof(IReportDataProvider), t); } // MediatR:注册命令/查询 Handler services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(NotificationService).Assembly)); return services; } }