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