using System.ComponentModel.DataAnnotations; using Kurisu.AspNetCore.CustomClass; using Kurisu.AspNetCore.DataAccess.Dto; namespace Dlhis.Basic.Common.ApiLog.Request; public class ApiLogRequest : PageDto, IValidatableObject { /// /// 日志级别 LogLevel /// [EnumDataType(typeof(LogLevel))] public LogLevel? Level { get; set; } public DateTimePeriod SearchDateTimePeriod { get; set; } public IEnumerable Validate(ValidationContext validationContext) { if (SearchDateTimePeriod is { End: not null }) { SearchDateTimePeriod.End = SearchDateTimePeriod.End.Value.AddDays(1).AddSeconds(-1); } yield break; } }