мини рефакторинг

добавлены пачноты
This commit is contained in:
2026-07-24 14:07:34 +04:00
parent eb8dac7627
commit ae1d7a12b8
9 changed files with 31 additions and 408 deletions

View File

@@ -4,6 +4,7 @@ using CodeBase.Repositories;
using CodeBase.Services;
using Microsoft.Build.Locator;
using Neo4j.Driver;
using System.Text.Json.Serialization;
if (!MSBuildLocator.IsRegistered)
{
@@ -28,12 +29,14 @@ builder.Services.AddTransient<ScipProcessingService>();
builder.Services.AddTransient<VectorizationService>();
builder.Services.AddTransient<LlmService>();
builder.Services.AddScoped<LlmPromptBuilder>();
builder.Services.AddTransient<ChunkService>();
builder.Services.AddTransient<CodeService>();
builder.Services.AddTransient<GraphRepository>();
builder.Services.AddTransient<ScipRepository>();
builder.Services.AddControllers();
builder.Services.AddControllers().AddJsonOptions(options =>
{
// Добавляем конвертер строковых енумов глобально
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
}); ;
builder.Services.AddSwaggerGen();
var app = builder.Build();
@@ -58,12 +61,4 @@ app.UseAuthorization();
app.MapControllers();
using (var scope = app.Services.CreateScope())
{
var graphRepo = scope.ServiceProvider.GetRequiredService<GraphRepository>();
Console.WriteLine("Проверяем и создаем векторный индекс в Neo4j...");
await graphRepo.InitializeDbAsync();
Console.WriteLine("Индекс готов!");
}
app.Run();