45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using Dlhis.Entity.Device.Enums;
|
|
using Dlhis.Entity.Sys.Enums;
|
|
|
|
namespace Dlhis.Basic.Device.Request;
|
|
|
|
public class DevicePermissionsAssignToDeviceRequest : IValidatableObject
|
|
{
|
|
/// <summary>
|
|
/// 分配类型
|
|
/// </summary>
|
|
public DeviceAssignmentTypeEnumType UniqueType { get; set; }
|
|
|
|
/// <summary>
|
|
/// 分配值
|
|
/// </summary>
|
|
public Guid UniqueValue { get; set; }
|
|
|
|
/// <summary>
|
|
/// 来源
|
|
/// </summary>
|
|
public AssignTypeEnumType AssignType { get; set; }
|
|
|
|
/// <summary>
|
|
/// 来源值
|
|
/// </summary>
|
|
public List<string> Values { get; set; }
|
|
|
|
|
|
[EnumDataType(typeof(DeviceTypeEnumType))]
|
|
public DeviceTypeEnumType Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// 只删除权限
|
|
/// </summary>
|
|
public bool IsDelete { get; set; }
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
if (AssignType != AssignTypeEnumType.User)
|
|
{
|
|
yield return new ValidationResult("仅支持导入档案人员", new[] { nameof(AssignType) });
|
|
}
|
|
}
|
|
} |