2023-02-22 11:35:35 +05:00
|
|
|
|
using System.Collections;
|
2022-10-11 17:04:26 +05:00
|
|
|
|
|
|
|
|
|
namespace AsbCloudApp.Data
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Состояние фоновой задачи
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum JobState
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Ожидает в очереди на выполнение
|
|
|
|
|
/// </summary>
|
|
|
|
|
Waiting,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// выполняется
|
|
|
|
|
/// </summary>
|
|
|
|
|
Working,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// успешно выполнена
|
|
|
|
|
/// </summary>
|
|
|
|
|
Done,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// завершена с ошибкой
|
|
|
|
|
/// </summary>
|
|
|
|
|
Fail
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// работа фоновой задачи
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class JobDto
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// идентификатор
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Состояние
|
|
|
|
|
/// </summary>
|
|
|
|
|
public JobState State { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// результат выполнения
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Hashtable? Results { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Исключение, если возникла ошибка
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string? Error { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|