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