Add ProfileController with MediatR GET endpoint

Introduced ProfileController to the API, implementing a GET endpoint that uses MediatR to handle ReadProfileViewQuery requests and return profile data. This supports CQRS and structured profile retrieval.
This commit is contained in:
2026-01-14 16:23:00 +01:00
parent bd2b5ff62f
commit 453b6d1813

View File

@@ -0,0 +1,16 @@
using MediatR;
using Microsoft.AspNetCore.Mvc;
using ReC.Application.Profile.Queries;
namespace ReC.API.Controllers;
[Route("api/[controller]")]
[ApiController]
public class ProfileController(IMediator mediator) : ControllerBase
{
[HttpGet]
public async Task<IActionResult> GetProfile([FromQuery] ReadProfileViewQuery query, CancellationToken cancel)
{
return Ok(await mediator.Send(query, cancel));
}
}