feat 数据权限支持用户组
This commit is contained in:
@@ -9,20 +9,24 @@ public class DataPermissionSaveRequest : IValidatableObject
|
||||
[Required]
|
||||
public string AssignValue { get; set; }
|
||||
|
||||
[EnumDataType(typeof(DeviceAssignmentTypeEnumType))]
|
||||
public DeviceAssignmentTypeEnumType UniqueType { get; set; }
|
||||
[EnumDataType(typeof(DataPermissionAssignmentEnumType))]
|
||||
public DataPermissionAssignmentEnumType UniqueType { get; set; }
|
||||
|
||||
public List<Guid> Codes { get; set; }
|
||||
|
||||
public List<Guid> Codes { get; set; } = new();
|
||||
|
||||
[EnumDataType(typeof(DeviceTypeEnumType))]
|
||||
public DeviceTypeEnumType Type { get; set; }
|
||||
|
||||
public DeviceTypeEnumType? Type { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (UniqueType == DeviceAssignmentTypeEnumType.BusinessPlace)
|
||||
if (UniqueType is DataPermissionAssignmentEnumType.Device or DataPermissionAssignmentEnumType.Group)
|
||||
{
|
||||
yield return new ValidationResult("不支持营业点分配", new[] { nameof(UniqueType) });
|
||||
if (!Type.HasValue)
|
||||
{
|
||||
yield return new ValidationResult("类型" + UniqueType + "需要传入Type");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user