diff --git a/app/Services/NotionService.php b/app/Services/NotionService.php index 2a13bdee..1ce0f9c4 100644 --- a/app/Services/NotionService.php +++ b/app/Services/NotionService.php @@ -17,14 +17,14 @@ class NotionService public function __construct() { - $config = AiConfig::getActiveNotion(); - if (! $config) { - throw new \RuntimeException('Notion API 설정이 없거나 비활성화 상태입니다.'); + $apiKey = config('services.notion.api_key'); + if (! $apiKey) { + throw new \RuntimeException('Notion API 키가 설정되지 않았습니다. .env 파일의 NOTION_API_KEY를 확인하세요.'); } - $this->apiKey = $config->api_key; - $this->version = $config->model ?: '2025-09-03'; - $this->baseUrl = $config->base_url ?: 'https://api.notion.com/v1'; + $this->apiKey = $apiKey; + $this->version = config('services.notion.version', '2025-09-03'); + $this->baseUrl = config('services.notion.base_url', 'https://api.notion.com/v1'); } /** diff --git a/config/services.php b/config/services.php index f11a24fe..00e73855 100644 --- a/config/services.php +++ b/config/services.php @@ -44,6 +44,12 @@ 'api_key' => env('CLAUDE_API_KEY'), ], + 'notion' => [ + 'api_key' => env('NOTION_API_KEY'), + 'version' => env('NOTION_VERSION', '2025-09-03'), + 'base_url' => env('NOTION_BASE_URL', 'https://api.notion.com/v1'), + ], + 'google' => [ 'credentials_path' => env('GOOGLE_APPLICATION_CREDENTIALS'), 'storage_bucket' => env('GOOGLE_STORAGE_BUCKET'),