v1
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using OrpaonVision.Core.Enums;
|
||||
|
||||
namespace OrpaonVision.Core.Annotation.Contracts;
|
||||
|
||||
/// <summary>
|
||||
/// 标注同步状态 DTO。
|
||||
/// </summary>
|
||||
public sealed class AnnotationSyncStatusDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 本地项目标识。
|
||||
/// </summary>
|
||||
public Guid ProjectId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 本地标注任务标识。
|
||||
/// </summary>
|
||||
public Guid AnnotationTaskId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 平台类型(当前固定为 Cvat)。
|
||||
/// </summary>
|
||||
public AnnotationPlatformEnum Platform { get; init; } = AnnotationPlatformEnum.Cvat;
|
||||
|
||||
/// <summary>
|
||||
/// 同步状态。
|
||||
/// </summary>
|
||||
public AnnotationSyncStatusEnum SyncStatus { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 同步进度(0~100)。
|
||||
/// </summary>
|
||||
public decimal ProgressPercent { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近一次同步时间(UTC)。
|
||||
/// </summary>
|
||||
public DateTime? LastSyncedAtUtc { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近错误信息。
|
||||
/// </summary>
|
||||
public string? LastErrorMessage { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using OrpaonVision.Core.Enums;
|
||||
|
||||
namespace OrpaonVision.Core.Annotation.Contracts;
|
||||
|
||||
/// <summary>
|
||||
/// 同步标注项目命令。
|
||||
///
|
||||
/// 当前版本约束:仅支持 CVAT。
|
||||
/// </summary>
|
||||
public sealed class SyncAnnotationProjectCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// 平台类型(当前固定为 Cvat)。
|
||||
/// </summary>
|
||||
public AnnotationPlatformEnum Platform { get; init; } = AnnotationPlatformEnum.Cvat;
|
||||
|
||||
/// <summary>
|
||||
/// 本地项目标识。
|
||||
/// </summary>
|
||||
public Guid ProjectId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 本地标注任务标识。
|
||||
/// </summary>
|
||||
public Guid AnnotationTaskId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// CVAT 服务地址,例如 http://127.0.0.1:8080。
|
||||
/// </summary>
|
||||
public string CvatServerEndpoint { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// CVAT 项目 ID。
|
||||
/// </summary>
|
||||
public long CvatProjectId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// CVAT 任务 ID。
|
||||
/// </summary>
|
||||
public long CvatTaskId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 发起同步的用户。
|
||||
/// </summary>
|
||||
public string RequestedBy { get; init; } = string.Empty;
|
||||
}
|
||||
24
OrpaonVision.Core/Annotation/IAnnotationSyncAppService.cs
Normal file
24
OrpaonVision.Core/Annotation/IAnnotationSyncAppService.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using OrpaonVision.Core.Annotation.Contracts;
|
||||
using OrpaonVision.Core.Results;
|
||||
|
||||
namespace OrpaonVision.Core.Annotation;
|
||||
|
||||
/// <summary>
|
||||
/// 标注同步应用服务接口。
|
||||
///
|
||||
/// 职责:
|
||||
/// - 发起本地标注任务与 CVAT 任务的同步;
|
||||
/// - 查询任务同步状态,供配置端界面展示。
|
||||
/// </summary>
|
||||
public interface IAnnotationSyncAppService
|
||||
{
|
||||
/// <summary>
|
||||
/// 发起同步。
|
||||
/// </summary>
|
||||
Task<Result> SyncProjectAsync(SyncAnnotationProjectCommand command, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询同步状态。
|
||||
/// </summary>
|
||||
Task<Result<AnnotationSyncStatusDto>> GetSyncStatusAsync(Guid projectId, CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user