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