mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 22:36:31 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -24,4 +24,7 @@ public class AnnotationMessage
|
|||||||
public class AnnotationBulkMessage
|
public class AnnotationBulkMessage
|
||||||
{
|
{
|
||||||
[Key(0)] public string[] AnnotationNames { get; set; } = null!;
|
[Key(0)] public string[] AnnotationNames { get; set; } = null!;
|
||||||
|
[Key(1)] public AnnotationStatus AnnotationStatus { get; set; }
|
||||||
|
[Key(2)] public string Email { get; set; } = null!;
|
||||||
|
[Key(3)] public DateTime CreatedDate { get; set; }
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ public class AnnotationService : IAnnotationService, INotificationHandler<Annota
|
|||||||
public async Task<Annotation> SaveAnnotation(AnnotationImage a, CancellationToken ct = default)
|
public async Task<Annotation> SaveAnnotation(AnnotationImage a, CancellationToken ct = default)
|
||||||
{
|
{
|
||||||
a.Time = TimeSpan.FromMilliseconds(a.Milliseconds);
|
a.Time = TimeSpan.FromMilliseconds(a.Milliseconds);
|
||||||
return await SaveAnnotationInner(DateTime.Now, a.OriginalMediaName, a.Time, a.Detections.ToList(),
|
return await SaveAnnotationInner(DateTime.UtcNow, a.OriginalMediaName, a.Time, a.Detections.ToList(),
|
||||||
SourceEnum.AI, new MemoryStream(a.Image), _api.CurrentUser.Role, _api.CurrentUser.Email, token: ct);
|
SourceEnum.AI, new MemoryStream(a.Image), _api.CurrentUser.Role, _api.CurrentUser.Email, token: ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,10 @@ public class FailsafeAnnotationsProducer
|
|||||||
{
|
{
|
||||||
var message = new Message(MessagePackSerializer.Serialize(new AnnotationBulkMessage
|
var message = new Message(MessagePackSerializer.Serialize(new AnnotationBulkMessage
|
||||||
{
|
{
|
||||||
AnnotationNames = record.AnnotationNames.ToArray()
|
AnnotationNames = record.AnnotationNames.ToArray(),
|
||||||
|
AnnotationStatus = record.Operation,
|
||||||
|
Email = _azaionApi.CurrentUser.Email,
|
||||||
|
CreatedDate = record.DateTime
|
||||||
})) { ApplicationProperties = appProperties };
|
})) { ApplicationProperties = appProperties };
|
||||||
|
|
||||||
messages.Add(message);
|
messages.Add(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user