Files
OrpaonVision/OrpaonVision.Core/Training/Contracts/RuntimeDeploymentSnapshotResultDto.cs
2026-04-06 22:04:05 +08:00

136 lines
3.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace OrpaonVision.Core.Training.Contracts;
/// <summary>
/// 创建运行时部署快照结果。
/// </summary>
public sealed class CreateRuntimeDeploymentSnapshotResultDto
{
/// <summary>
/// 快照ID。
/// </summary>
public Guid SnapshotId { get; init; }
/// <summary>
/// 快照名称。
/// </summary>
public string Name { get; init; } = string.Empty;
/// <summary>
/// 创建状态。
/// </summary>
public RuntimeDeploymentSnapshotOperationStatus Status { get; init; }
/// <summary>
/// 操作消息。
/// </summary>
public string Message { get; init; } = string.Empty;
/// <summary>
/// 创建时间UTC
/// </summary>
public DateTime CreatedAtUtc { get; init; }
/// <summary>
/// 创建者。
/// </summary>
public string CreatedBy { get; init; } = string.Empty;
}
/// <summary>
/// 激活运行时部署快照结果。
/// </summary>
public sealed class ActivateRuntimeDeploymentSnapshotResultDto
{
/// <summary>
/// 快照ID。
/// </summary>
public Guid SnapshotId { get; init; }
/// <summary>
/// 激活状态。
/// </summary>
public RuntimeDeploymentSnapshotOperationStatus Status { get; init; }
/// <summary>
/// 操作消息。
/// </summary>
public string Message { get; init; } = string.Empty;
/// <summary>
/// 前一个激活的快照ID。
/// </summary>
public Guid? PreviousSnapshotId { get; init; }
/// <summary>
/// 激活时间UTC
/// </summary>
public DateTime ActivatedAtUtc { get; init; }
/// <summary>
/// 激活者。
/// </summary>
public string ActivatedBy { get; init; } = string.Empty;
}
/// <summary>
/// 回滚到运行时部署快照结果。
/// </summary>
public sealed class RollbackToRuntimeDeploymentSnapshotResultDto
{
/// <summary>
/// 目标快照ID。
/// </summary>
public Guid TargetSnapshotId { get; init; }
/// <summary>
/// 回滚前快照ID。
/// </summary>
public Guid? PreviousSnapshotId { get; init; }
/// <summary>
/// 回滚状态。
/// </summary>
public RuntimeDeploymentSnapshotOperationStatus Status { get; init; }
/// <summary>
/// 操作消息。
/// </summary>
public string Message { get; init; } = string.Empty;
/// <summary>
/// 回滚时间UTC
/// </summary>
public DateTime RolledBackAtUtc { get; init; }
/// <summary>
/// 回滚者。
/// </summary>
public string RolledBackBy { get; init; } = string.Empty;
}
/// <summary>
/// 运行时部署快照操作状态。
/// </summary>
public enum RuntimeDeploymentSnapshotOperationStatus
{
/// <summary>
/// 操作中。
/// </summary>
InProgress,
/// <summary>
/// 成功。
/// </summary>
Succeeded,
/// <summary>
/// 失败。
/// </summary>
Failed,
/// <summary>
/// 部分成功。
/// </summary>
PartiallySucceeded
}