23 lines
779 B
C#
23 lines
779 B
C#
using Heimdall.Application.Common;
|
|||
|
|
using Heimdall.Application.DTOs;
|
||
|
|
using Heimdall.Application.Services;
|
||
|
|
using MediatR;
|
||
|
|
|
||
|
|
namespace Heimdall.Application.Discovery.Queries.GetTestSession;
|
||
|
|
|
||
|
|
public record GetTestSessionQuery(Guid SessionId) : IRequest<ServiceResult<StreamTestSession>>;
|
||
|
|
|
||
|
|
public class GetTestSessionQueryHandler : IRequestHandler<GetTestSessionQuery, ServiceResult<StreamTestSession>>
|
||
|
|
{
|
||
|
|
private readonly ICameraDiscoveryService _discovery;
|
||
|
|
|
||
|
|
public GetTestSessionQueryHandler(ICameraDiscoveryService discovery)
|
||
|
|
{
|
||
|
|
_discovery = discovery;
|
||
|
|
}
|
||
|
|
|
||
|
|
public async Task<ServiceResult<StreamTestSession>> Handle(GetTestSessionQuery request, CancellationToken ct)
|
||
|
|
{
|
||
|
|
return await _discovery.GetTestSessionAsync(request.SessionId, ct);
|
||
|
|
}
|
||
|
|
}
|