This commit is contained in:
2026-03-10 19:38:13 +09:00
parent 9650707caf
commit 141f526f91
3 changed files with 30 additions and 8 deletions

View File

@@ -59,19 +59,33 @@ class NaverService
$vType = $rawData['verificationTypeCode'] ?? '';
// 2. 원본 데이터 Staging 저장
$this->rawStagingModel->insert([
$insertResult = $this->rawStagingModel->insert([
'atcl_no' => $articleNumber,
'verification_type' => $vType,
'request_type' => $requestType,
'raw_json' => $rawData
]);
if (!$insertResult) {
$dbError = $this->db->error();
write_custom_log("naver_raw_staging Insert 실패 | Atcl: $articleNumber | Error: " . json_encode($dbError), 'ERROR', 'service');
throw new Exception("naver_raw_staging 저장 실패: " . json_encode($dbError));
}
CLI::write(CLI::color('🟢 임시테이블 저장 완료', 'green'));
// 3. 타입별 분기 처리
CLI::write(CLI::color("🔵 검증타입 확인: vType = $vType", 'cyan'));
write_custom_log("타입별 분기 | Atcl: $articleNumber | vType: $vType | requestType: $requestType", 'INFO', 'service');
if ($vType === 'S' || $vType === 'S_VR') {
CLI::write(CLI::color('🟢 Type S Handler 호출', 'green'));
return $this->typeSHandler->handle($articleNumber, $rawData, $payload);
} else {
return $this->typeV2Handler->handle($articleNumber, $rawData, $payload);
CLI::write(CLI::color('🟢 Type V2 Handler 호출', 'green'));
$result = $this->typeV2Handler->handle($articleNumber, $rawData, $payload);
write_custom_log("TypeV2Handler 완료 | Atcl: $articleNumber | Result: $result", 'INFO', 'service');
return $result;
}
} catch (Exception $e) {