package validators import ( "rag/file-system/internal/api/requests" "rag/file-system/internal/common" ) type ShareValidator struct{} func NewShareValidator() *ShareValidator { return &ShareValidator{} } func (v *ShareValidator) ValidateCreate(req *requests.CreateShareRequest) error { if req.ResourceType != "file" && req.ResourceType != "folder" { return common.NewBusinessException("resource_type 必须是 file 或 folder") } if req.ResourceID == "" { return common.NewBusinessException("resource_id 不能为空") } return nil }