using FluentValidation; namespace RAG.Application.Embedding.Validators; public class EmbedTextCommandValidator : AbstractValidator { public EmbedTextCommandValidator() { RuleFor(x => x.Text).NotEmpty().WithMessage("文本内容不能为空") .MaximumLength(10000).WithMessage("单条文本不能超过10000个字符"); } } public class EmbedBatchCommandValidator : AbstractValidator { public EmbedBatchCommandValidator() { RuleFor(x => x.Texts).NotEmpty().WithMessage("文本列表不能为空") .Must(t => t.Count <= 100).WithMessage("批量文本不能超过100条"); } }