- Events: CRUD commands/queries + EventCreatedNotification for SignalR - Agents: Register (with API key gen), Heartbeat, queries - Assignments: Assign, Failover, Release commands + queries - Discovery: 10 handlers delegating to existing probes/services - Groups/Persons/Settings/Audit/Stats: full CQRS for remaining domains - Extend IApplicationDbContext with all DbSets
22 lines
678 B
C#
22 lines
678 B
C#
using Heimdall.Application.Common;
|
|
using Heimdall.Application.Services;
|
|
using MediatR;
|
|
|
|
namespace Heimdall.Application.Assignments.Commands.AssignSite;
|
|
|
|
public sealed class AssignSiteHandler : IRequestHandler<AssignSiteCommand, ServiceResult<int>>
|
|
{
|
|
private readonly ICameraAssignmentService _assignmentService;
|
|
|
|
public AssignSiteHandler(ICameraAssignmentService assignmentService)
|
|
{
|
|
_assignmentService = assignmentService;
|
|
}
|
|
|
|
public async Task<ServiceResult<int>> Handle(AssignSiteCommand command, CancellationToken ct)
|
|
{
|
|
return await _assignmentService.AssignSiteCamerasAsync(
|
|
command.SiteId, command.Strategy, ct);
|
|
}
|
|
}
|