Files
api-generator/Generator/ServiceExtension.cs
2025-10-11 13:08:09 +02:00

61 lines
2.0 KiB
C#

using Core.Dto;
using Core.Events;
using Core.Interfaces;
using Core.Yaml;
using Generator.Controllers;
using Generator.Daos;
using Generator.DataSource.Settings;
using Generator.Infrastructure.OpenApi;
using Generator.Repo;
using Generator.Services;
using Microsoft.Extensions.DependencyInjection;
namespace Generator;
public static class ServiceExtension
{
public static void AddServices(this IServiceCollection services, IDataSourceLoader loader, ArgumentsDto args)
{
loader.LoadAppsettings();
services.AddSingleton(args);
services.AddSingleton<ConfigManager>();
services.AddSingleton<DisplayEmitter>();
services.AddScoped<EnvironmentDao>();
services.AddScoped<TemplateDao>();
services.AddScoped<OpenApiDao>();
services.AddScoped<DotnetDao>();
services.AddScoped<JavaDao>();
services.AddScoped<JavascriptDao>();
services.AddScoped<CredentialsDao>();
services.AddScoped<IGeneratorDirector<OpenApiYaml>, OpenApiDirector>();
services.AddScoped<ApiAnalyzer>();
services.AddScoped<OpenApiDirector>();
services.AddScoped<PreGenerationRepo>();
services.AddScoped<GenerateRepo>();
services.AddScoped<PublisherRepo>();
services.AddScoped<RepositoryActions>();
services.AddScoped<ExportRepo>();
services.AddScoped<PreGenerationService>();
services.AddScoped<GenerationService>();
services.AddScoped<PublicationService>();
services.AddScoped<AnalyzeService>();
services.AddScoped<RepositoryService>();
services.AddScoped<ExportService>();
services.AddScoped<PreGenerationController>();
services.AddScoped<GenerationController>();
services.AddScoped<PublicationController>();
services.AddScoped<AnalyzeController>();
services.AddScoped<ExportController>();
services.AddLogging();
}
}