vrfcReqModel 수정
This commit is contained in:
@@ -43,6 +43,16 @@ class NaverService
|
|||||||
private function getModel($property, $class) {
|
private function getModel($property, $class) {
|
||||||
return $this->$property ??= new $class();
|
return $this->$property ??= new $class();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* NaverApiClient 지연 로딩
|
||||||
|
*/
|
||||||
|
private function getNaverClient()
|
||||||
|
{
|
||||||
|
if ($this->naverClient === null) {
|
||||||
|
$this->naverClient = new \App\Libraries\NaverApiClient();
|
||||||
|
}
|
||||||
|
return $this->naverClient;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 메인 프로세스: 요청 타입에 따른 분기 처리
|
* 메인 프로세스: 요청 타입에 따른 분기 처리
|
||||||
@@ -54,7 +64,7 @@ class NaverService
|
|||||||
|
|
||||||
CLI::write(CLI::color('🟢 getArticleInfo Start :: ' . $articleNumber , 'green'));
|
CLI::write(CLI::color('🟢 getArticleInfo Start :: ' . $articleNumber , 'green'));
|
||||||
// 1. 네이버 API 호출
|
// 1. 네이버 API 호출
|
||||||
$response = $this->naverClient->getArticleInfo($articleNumber);
|
$response = $this->getNaverClient()->getArticleInfo($articleNumber);
|
||||||
if (!$response || $response['code'] !== 'success') {
|
if (!$response || $response['code'] !== 'success') {
|
||||||
throw new \Exception("네이버 API 응답 에러: $articleNumber");
|
throw new \Exception("네이버 API 응답 에러: $articleNumber");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user