2, 'max' => 100], ['url', 'required'], ['events', 'required'], ['timeout', 'integer', 'min' => 1, 'max' => 300], ['retry_count', 'integer', 'min' => 0, 'max' => 10], // 业务验证(按顺序执行) [ 'url', new WebhookUrlValidator($this), 'msg' => 'Webhook URL无效' ], [ 'events', new WebhookEventsValidator($this, ['processedEvents']), 'msg' => '事件类型配置无效' ], ]; } /** * 默认值 */ public function default(): array { return [ 'timeout' => 30, 'retry_count' => 3, 'status' => 'ACTIVE', ]; } }