using System.ComponentModel.DataAnnotations;
using Dlhis.Entity.Device.Enums;
using Kurisu.AspNetCore.Utils.Extensions;
using Kurisu.Core.DataAccess.Dto;
namespace Dlhis.ScheduledTask.TaskAssignment.Request;
public class DeviceTaskGetRequest : PageDto, IValidatableObject
{
///
/// 品牌
///
public string Brand { get; set; }
///
/// 设备号
///
public string DeviceUniqueNo { get; set; }
///
/// 任务类型
///
public List Types { get; set; }
///
/// 获取处理中的任务
///
public bool IsProcess { get; set; } = false;
public IEnumerable Validate(ValidationContext validationContext)
{
if (Brand.IsEmpty() && DeviceUniqueNo.IsEmpty())
{
yield return new ValidationResult("设备品牌和设备唯一号不能都为空", new[] { nameof(Brand), nameof(DeviceUniqueNo) });
}
}
}