mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:16:30 +00:00
add MediaHash. Step1
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user