using FluentValidation; namespace RAG.Application.KnowledgeBase.Validators; public class CreateKnowledgeBaseCommandValidator : AbstractValidator { public CreateKnowledgeBaseCommandValidator() { RuleFor(x => x.Name).NotEmpty().WithMessage("知识库名称不能为空") .MaximumLength(200).WithMessage("名称不能超过200个字符"); RuleFor(x => x.Description).MaximumLength(1000).When(x => x.Description != null); } }