add MediaHash. Step1

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-11-17 07:46:05 +02:00
parent d355f81c63
commit fd95d2ba2c
27 changed files with 421 additions and 288 deletions
@@ -77,6 +77,7 @@ public class InferenceClient : IInferenceClient
{
case CommandType.InferenceData:
var annotationImage = MessagePackSerializer.Deserialize<AnnotationImage>(remoteCommand.Data, cancellationToken: ct);
_logger.LogInformation("Received command: {AnnotationImage}", annotationImage.ToString());
await _mediator.Publish(new InferenceDataEvent(annotationImage), ct);
break;
case CommandType.InferenceStatus:
@@ -1,18 +1,16 @@
using Azaion.Common.Database;
using Azaion.Common.DTO;
using Azaion.Common.Events;
using MediatR;
using MessagePack;
using Microsoft.Extensions.Logging;
namespace Azaion.Common.Services.Inference;
public class InferenceServiceEventHandler(IInferenceService inferenceService, IAnnotationService annotationService, IMediator mediator) :
public class InferenceServiceEventHandler(
IInferenceService inferenceService,
IAnnotationService annotationService,
IMediator mediator) :
INotificationHandler<InferenceDataEvent>,
INotificationHandler<InferenceStatusEvent>,
INotificationHandler<InferenceDoneEvent>
{
public async Task Handle(InferenceDataEvent e, CancellationToken ct)
{
var annotation = await annotationService.SaveAnnotation(e.AnnotationImage, ct);