feat: .NET 운영 리포트 렌더러와 CI 경로 전환
- operational_report.json/md와 final_decision_packet_v4 생성 경로를 .NET으로 전환했습니다. - CI, 운영 게이트, 릴리스 DAG, 대시보드의 운영 진입점을 새 경로로 정렬했습니다. - legacy Python 렌더러는 비운영으로 명시했습니다.
This commit is contained in:
@@ -2,6 +2,8 @@ using QuantEngine.Web.Components;
|
||||
using QuantEngine.Infrastructure.Data;
|
||||
using QuantEngine.Infrastructure.Repositories;
|
||||
using QuantEngine.Core.Interfaces;
|
||||
using QuantEngine.Application.Services;
|
||||
using System.Text.Json;
|
||||
using MudBlazor.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -18,6 +20,9 @@ var connectionString = builder.Configuration.GetConnectionString("DefaultConnect
|
||||
?? "Host=127.0.0.1;Database=giteadb;Username=gitea;Password=C8RFlZ9fdQrBA1vyLhLDS4v70I8dJfRS2ERJW4+zsS4=;Search Path=quantengine;";
|
||||
builder.Services.AddSingleton<IDbConnectionFactory>(new DbConnectionFactory(connectionString));
|
||||
builder.Services.AddScoped<IWorkspaceRepository, WorkspaceRepository>();
|
||||
builder.Services.AddScoped<IPostgresqlHistoryStore, PostgresqlHistoryStore>();
|
||||
builder.Services.AddScoped<IPostgresqlHistorySnapshotReader, PostgresqlHistorySnapshotReader>();
|
||||
builder.Services.AddScoped<HistoryIngestionService>();
|
||||
builder.Services.AddHttpClient();
|
||||
|
||||
var app = builder.Build();
|
||||
@@ -40,5 +45,48 @@ app.MapStaticAssets();
|
||||
app.MapRazorComponents<App>()
|
||||
.AddInteractiveServerRenderMode();
|
||||
|
||||
app.MapGet("/api/history/{domain}", async (string domain, int? limit, IPostgresqlHistorySnapshotReader reader) =>
|
||||
{
|
||||
var rows = await reader.ReadAsync(domain, limit ?? 500);
|
||||
return Results.Ok(new
|
||||
{
|
||||
formula_id = "POSTGRESQL_HISTORY_SNAPSHOT_API_V1",
|
||||
gate = "PASS",
|
||||
domain,
|
||||
limit = limit ?? 500,
|
||||
rows
|
||||
});
|
||||
});
|
||||
|
||||
app.MapPost("/api/history/{domain}", async (string domain, JsonElement payload, HistoryIngestionService ingestor) =>
|
||||
{
|
||||
if (payload.ValueKind != JsonValueKind.Object)
|
||||
{
|
||||
return Results.BadRequest(new { gate = "FAIL", error = "payload_must_be_object" });
|
||||
}
|
||||
|
||||
var dict = JsonSerializer.Deserialize<Dictionary<string, object?>>(payload.GetRawText())
|
||||
?? new Dictionary<string, object?>();
|
||||
var affected = domain switch
|
||||
{
|
||||
"decision_result_history" => await ingestor.AppendDecisionAsync(dict),
|
||||
"factor_output_history" => await ingestor.AppendFactorOutputAsync(dict),
|
||||
"market_raw_history" => await ingestor.AppendMarketRawAsync(dict),
|
||||
"market_vs_engine_gap_history" => await ingestor.AppendGapAsync(dict),
|
||||
_ => -1
|
||||
};
|
||||
if (affected < 0)
|
||||
{
|
||||
return Results.BadRequest(new { gate = "FAIL", error = "unsupported_domain" });
|
||||
}
|
||||
return Results.Ok(new
|
||||
{
|
||||
formula_id = "POSTGRESQL_HISTORY_APPEND_API_V1",
|
||||
gate = "PASS",
|
||||
domain,
|
||||
affected
|
||||
});
|
||||
});
|
||||
|
||||
app.Run();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user