using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IStation.Application { /// /// 请求客户登录分页列表输入Model /// public class QueryCorpLoginLogPageListInput : IValidatableObject { /// /// 客户标识 (必须大于0) /// [Required, Range(1, long.MaxValue, ErrorMessage = "UserID 必须大于0")] public long CorpID { get; set; } /// /// 开始时间 (应小于结束时间) /// [Required] public DateTime StartTime { get; set; } /// /// 结束时间(应大于开始时间) /// [Required] public DateTime EndTime { get; set; } /// /// 页索引 (必须大于0) /// [Required, Range(1, long.MaxValue, ErrorMessage = "PageIndex 必须大于0")] public int PageIndex { get; set; } /// /// 页尺寸(必须大于0) /// [Required, Range(1, long.MaxValue, ErrorMessage = "PageSize 必须大于0")] public int PageSize { get; set; } /// /// /// public IEnumerable Validate(ValidationContext validationContext) { if (StartTime >= EndTime) { yield return new ValidationResult( "StartTime 必须小于 EndTime" , new[] { nameof(StartTime) } ); } } } }