track/src/SJZY.Track.Application/Validations/Forewarning/RuleTrackStateDtoValidator.cs
2024-08-05 09:57:15 +08:00

14 lines
562 B
C#

using FluentValidation;
using SJZY.Track.Domain.Dtos.Forewarning;
namespace SJZY.Track.Application.Validations.Forewarning;
public class RuleTrackStateDtoValidator : AbstractValidator<WarningNitifyDto>
{
public RuleTrackStateDtoValidator()
{
RuleFor(x => x.StartTrackStatusId).GreaterThan(0).WithMessage("起始轨迹状态id必须大于0");
RuleFor(x => x.EndTrackStatusId).GreaterThan(0).WithMessage("终止轨迹状态id必须大于0");
RuleFor(x => x.NotifyUserId).NotEmpty().WithMessage("通知对象不能为空");
}
}