feat(cqrs): update controllers, add AutoMapper profiles, SignalR notifications, Hangfire config
- 13 controllers migrated from service DI to IMediator dispatch - 11 AutoMapper mapping profiles (Sites, Cameras, Auth, Users, Agents, Events, Assignments, Settings, Groups, Persons, Discovery) - SignalR notifications bridged via MediatR INotificationHandler - Hangfire config moved from Program.cs to Infrastructure/BackgroundJobs - 0 build errors, 0 warnings
This commit is contained in:
1 parent
c1b3b3d3b4
commit
1d1ac8387e
33 files changed
+611
-195
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using Heimdall.Application.Audit.Queries.GetAuditLogs;
|
||||
using Heimdall.Application.DTOs;
|
||||
using Heimdall.Application.Services;
|
||||
using Heimdall.Infrastructure.Security;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.RateLimiting;
|
||||
@@ -13,9 +14,9 @@ namespace Heimdall.Api.Controllers;
|
||||
[EnableRateLimiting("Api")]
|
||||
public class AuditLogsController : ControllerBase
|
||||
{
|
||||
private readonly IAuditLogService _auditLogService;
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public AuditLogsController(IAuditLogService auditLogService) => _auditLogService = auditLogService;
|
||||
public AuditLogsController(IMediator mediator) => _mediator = mediator;
|
||||
|
||||
/// <summary>List audit log entries with optional filtering.</summary>
|
||||
[HttpGet]
|
||||
@@ -28,7 +29,7 @@ public class AuditLogsController : ControllerBase
|
||||
[FromQuery] int pageSize = 20,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
var result = await _auditLogService.ListAsync(resourceType, action, page, pageSize, ct);
|
||||
var result = await _mediator.Send(new GetAuditLogsQuery(resourceType, action, page, pageSize), ct);
|
||||
if (!result.IsSuccess)
|
||||
return StatusCode(result.StatusCode ?? 400, new { error = result.Error });
|
||||
return Ok(result.Data);
|
||||
|
||||
Reference in new issue
Block a user