71 lines
1.4 KiB
C#
71 lines
1.4 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.Text.Json;
|
|
|
|
namespace ScrapperAPI.Dtos;
|
|
|
|
public sealed record StartExtractionRequest(
|
|
[Required] int SessionId,
|
|
[Required] long ModelId,
|
|
bool OnlyDone = true
|
|
);
|
|
|
|
public sealed record BulkStartExtractionRequest(
|
|
[Required] long ModelId,
|
|
/// <summary>
|
|
/// Se vazio/nulo, roda para todas as sessions existentes.
|
|
/// </summary>
|
|
int[]? SessionIds = null,
|
|
bool OnlyDone = true
|
|
);
|
|
|
|
public sealed record CreateExtractionRunDto(
|
|
long ModelId,
|
|
int SessionId
|
|
);
|
|
|
|
public sealed record ExtractionRunRow(
|
|
long Id,
|
|
long ModelId,
|
|
int SessionId,
|
|
short Status,
|
|
DateTimeOffset CreatedAt,
|
|
DateTimeOffset? StartedAt,
|
|
DateTimeOffset? FinishedAt,
|
|
int Total,
|
|
int Succeeded,
|
|
int Failed,
|
|
string? Error
|
|
);
|
|
|
|
public sealed record ExtractionRuntimeStatus(
|
|
long RunId,
|
|
bool IsRunning,
|
|
int Processed,
|
|
int Total,
|
|
int Succeeded,
|
|
int Failed,
|
|
int? CurrentQueueId
|
|
);
|
|
|
|
public sealed record UpsertExtractedDataDto(
|
|
long RunId,
|
|
long ModelId,
|
|
int SessionId,
|
|
int QueueId,
|
|
JsonDocument ExtractedJson,
|
|
bool Success,
|
|
string? Error
|
|
);
|
|
|
|
public sealed record ExtractedDataRow(
|
|
long Id,
|
|
long RunId,
|
|
long ModelId,
|
|
int SessionId,
|
|
int QueueId,
|
|
JsonDocument ExtractedJson,
|
|
bool Success,
|
|
string? Error,
|
|
DateTimeOffset ExtractedAt
|
|
);
|