提取 ValidateEnum 和 ValidateNonNegative 函数,简化重复的验证逻辑。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>