fix 获取部门权限分配
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
using Dlhis.Entity.Sys.Enums;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
|
||||
namespace Dlhis.Basic.Device.Request;
|
||||
|
||||
public class DeviceGetAssignmentsRequest
|
||||
public class DeviceGetAssignmentsRequest : IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// 权限分配类型 DeviceAssignmentTypeEnumType
|
||||
@@ -27,6 +28,22 @@ public class DeviceGetAssignmentsRequest
|
||||
/// 设备类型
|
||||
/// </summary>
|
||||
public DeviceTypeEnumType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// AssignType == AssignTypeEnumType.Department 需要传入
|
||||
/// </summary>
|
||||
public string TenantId { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (AssignType == AssignTypeEnumType.Department)
|
||||
{
|
||||
if (TenantId.IsEmpty())
|
||||
{
|
||||
yield return new ValidationResult("请明确具体的厂区", new[] { nameof(TenantId) });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DeviceGetAssignmentUniquesRequest
|
||||
|
||||
Reference in New Issue
Block a user