using FluentValidation; using TakeoutSaaS.Application.App.SystemParameters.Commands; namespace TakeoutSaaS.Application.App.SystemParameters.Validators; /// /// 更新系统参数命令验证器。 /// public sealed class UpdateSystemParameterCommandValidator : AbstractValidator { /// /// 初始化验证规则。 /// public UpdateSystemParameterCommandValidator() { RuleFor(x => x.ParameterId).GreaterThan(0); RuleFor(x => x.Key).NotEmpty().MaximumLength(128); RuleFor(x => x.Value).NotEmpty(); RuleFor(x => x.Description).MaximumLength(512); RuleFor(x => x.SortOrder).GreaterThanOrEqualTo(0); } }