Files
Hy2026/backend/Controllers/MatchmakingController.cs
T
Rafał Tyński 25ce901021 feat(backend): add semantic matchmaking with embedding pipeline
Add a pluggable embedding provider with an offline deterministic default, vector indexing for problems and innovations, cosine semantic ranking, similar cases and solution suggestions, area filtering and an admin reindex endpoint. Refresh the index when innovations or submissions change.
2026-10-04 02:44:03 +02:00

33 lines
941 B
C#

using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using TarninaHub.Application.Abstractions;
using TarninaHub.Application.Security;
namespace TarninaHub.Controllers;
[ApiController]
[ApiVersion("1.0")]
[Route("api/matchmaking")]
[Authorize]
public class MatchmakingController : ControllerBase
{
private readonly IMatchmakingService _matchmakingService;
public MatchmakingController(IMatchmakingService matchmakingService)
{
_matchmakingService = matchmakingService;
}
[HttpPost("reindex")]
[Authorize(Policy = Policies.AdminOnly)]
public async Task<ActionResult<MatchmakingReindexResponse>> Reindex(CancellationToken cancellationToken)
{
var indexed = await _matchmakingService.ReindexAsync(cancellationToken);
return Ok(new MatchmakingReindexResponse(indexed));
}
}
public sealed record MatchmakingReindexResponse(int Indexed);