refactor: [notion] API 키를 DB(ai_configs)에서 .env로 전환

- NotionService: AiConfig::getActiveNotion() → config('services.notion')
- config/services.php에 notion 섹션 추가
- .env에 NOTION_API_KEY, NOTION_VERSION 추가
This commit is contained in:
김보곤
2026-02-23 09:48:40 +09:00
parent 0d8d5aa8ef
commit 1b73fd1cf2
2 changed files with 12 additions and 6 deletions

View File

@@ -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');
}
/**

View File

@@ -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'),