This commit is contained in:
hashbro
2026-08-09 02:42:28 +08:00
parent 5c7600744e
commit 6489808fa5
8 changed files with 150 additions and 26 deletions
@@ -108,6 +108,7 @@ class ChannelController extends Controller
'channel_id' => ['required', 'string', 'size:32', 'regex:/^[a-z0-9]+$/', Rule::unique('channels', 'channel_id')],
'user_id' => ['nullable', 'integer', 'min:0'],
'domains' => ['nullable', 'string', 'max:4000'],
'support_template' => ['nullable', 'string', Rule::in(ChannelProjectService::SUPPORT_TEMPLATES)],
'remark' => ['nullable', 'string', 'max:255'],
'status' => ['nullable', 'integer', Rule::in([0, 1])],
]);
@@ -118,10 +119,11 @@ class ChannelController extends Controller
}
$domains = SettingsService::parseDomains($data['domains'] ?? null);
$supportTemplate = (string) ($data['support_template'] ?? ChannelProjectService::DEFAULT_SUPPORT_TEMPLATE);
$this->assertAgentChannelQuota($userId);
try {
$projects->generate($data['channel_id'], $domains);
$projects->generate($data['channel_id'], $domains, $supportTemplate);
} catch (\Throwable $e) {
return response()->json([
'code' => 1,