{
"event": "PostToolUse",
"tool_name": "Read",
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Controller\/Api\/ConfigController.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Controller\\Api;\n\n\/\/ @responsibility: JSON-API für Config-Operationen (Chat-Integration)\n\nuse Framework\\Controller;\nuse UseCases\\Config\\ManageConfigUseCase;\n\nclass ConfigController extends Controller\n{\n public function __construct(\n private ManageConfigUseCase $configUseCase\n ) {\n }\n\n \/**\n * GET \/api\/v1\/config\/{id}\n *\/\n public function show(string $id): void\n {\n $config = $this->configUseCase->getById((int) $id);\n\n if ($config === null) {\n $this->json(['error' => 'Config nicht gefunden'], 404);\n\n return;\n }\n\n $this->json([\n 'id' => $config->id,\n 'name' => $config->name,\n 'type' => $config->type,\n 'content' => $config->content,\n 'version' => $config->version,\n ]);\n }\n\n \/**\n * POST \/api\/v1\/config\/{id}\n *\/\n public function update(string $id): void\n {\n $this->requireCsrf();\n\n $config = $this->configUseCase->getById((int) $id);\n if ($config === null) {\n $this->json(['error' => 'Config nicht gefunden'], 404);\n\n return;\n }\n\n $newContent = $_POST['content'] ?? '';\n\n \/\/ Auto-increment Version\n $currentVersion = $config->version ?? '1.0';\n $versionParts = explode('.', $currentVersion);\n $newVersion = $versionParts[0] . '.' . ((int) ($versionParts[1] ?? 0) + 1);\n\n $result = $this->configUseCase->update(\n id: (int) $id,\n name: $config->name,\n slug: $config->slug ?? '',\n description: $config->description,\n content: $newContent,\n newVersion: $newVersion,\n changeDescription: 'Chat UI Update',\n status: $config->status ?? 'active',\n parentId: $config->parentId\n );\n\n if (!$result->success) {\n $this->json(['error' => $result->message], 400);\n\n return;\n }\n\n $this->json([\n 'success' => true,\n 'version' => $newVersion,\n 'message' => \"Version {$newVersion} gespeichert\",\n ]);\n }\n}\n",
"numLines": 87,
"startLine": 1,
"totalLines": 87
}
}
}