using IStation.Untity;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel.DataAnnotations;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Application
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class ObjectIdsUnderCorpInput : IValidatableObject
|
{
|
/// <summary>
|
/// 客户标识
|
/// </summary>
|
[Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
|
public long CorpID { get; set; }
|
|
/// <summary>
|
/// 对象类型
|
/// </summary>
|
[Required, DataValidation(AllowEmptyStrings = false)]
|
public string ObjectType { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
[Required, DataValidation(AllowEmptyStrings = false)]
|
public string ObjectIds { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
{
|
var ids = LongListHelper.ToList(ObjectIds);
|
if (ids == null || ids.Count() < 1)
|
{
|
yield return new ValidationResult(
|
"ObjectIds 必须是用 , 隔开的ID列表"
|
, new[] { nameof(ObjectIds) }
|
);
|
|
}
|
}
|
}
|
}
|