Adds S3-compatible snapshot storage (Alarik) with AWS Signature V4, upload, thumbnail, and delete operations. Backfills Phase 2 & 3 with 27 new tests covering camera assignment strategies, event CRUD with filtering, snapshot attachment, and API contract validation. - SnapshotService with S3 REST API via HttpClient + SigV4 signing - 10 unit tests for CameraAssignmentService (assign, release, failover, history) - 9 unit tests for CameraEventService (create, query, filter, delete, snapshot) - 8 integration tests for AssignmentsController + EventsController - SnapshotService registration with 5-min timeout HTTP client
22 lines
919 B
C#
22 lines
919 B
C#
namespace Heimdall.Application.Services;
|
|
|
|
/// <summary>
|
|
/// Snapshot storage service.
|
|
/// Uploads, retrieves, and deletes camera snapshots from S3-compatible
|
|
/// storage (Alarik). Snapshots are JPG images captured during events.
|
|
/// </summary>
|
|
public interface ISnapshotService
|
|
{
|
|
/// <summary>Upload a snapshot JPG. Returns the public URL.</summary>
|
|
Task<string> UploadAsync(Guid cameraId, Guid eventId, byte[] imageData, CancellationToken ct);
|
|
|
|
/// <summary>Upload a thumbnail JPG. Returns the public URL.</summary>
|
|
Task<string> UploadThumbnailAsync(Guid cameraId, Guid eventId, byte[] imageData, CancellationToken ct);
|
|
|
|
/// <summary>Delete a snapshot by its URL.</summary>
|
|
Task DeleteAsync(string snapshotUrl, CancellationToken ct);
|
|
|
|
/// <summary>Get a presigned download URL (temporary, 5 min).</summary>
|
|
Task<string?> GetDownloadUrlAsync(string snapshotUrl, CancellationToken ct);
|
|
}
|