diff --git a/app/Libraries/NaverApiClient.php b/app/Libraries/NaverApiClient.php index 2598afd..c183343 100644 --- a/app/Libraries/NaverApiClient.php +++ b/app/Libraries/NaverApiClient.php @@ -435,16 +435,42 @@ class NaverApiClient return $this->request('POST', $url, $postData); } + /** + * 현장확인 슬롯 동기화 + * API (가) - /kiso/center/site-slot + * 신규/변경 일자별 데이터 전송 + * @syncData array + * @param string $baseDate 기준일자(ISO 8601 형식: YYYY-MM-DD 예: 2024-01-31) + * @param string $legalDivisionNumber 구역번호 "1111000000" + * @param object slots 오전/오후/ 슬롯 정보 + [ + { + "baseDate": "2025-04-30", + "legalDivisionNumber": "1111000000", + "slots": { + "am": { "max": 10, "reserved": 0 }, + "pm": { "max": 100, "reserved": 0 } + } + } + ] + */ + public function syncSiteSlot($syncData){ + $url = $this->baseUrl . "/kiso/center/site-verification/slots"; + return $this->request('POST', $url, $syncData); + } + /** * CURL 공통 실행 함수 */ private function request(string $method, string $url, ?array $data = null): ?array { - /** - * curl --location 'https://test-b2b.land.naver.com/kiso/center/verification-article/2500000001?charger=admin' \ ---header 'X-Naver-Client-Id: yqBbvQZ123_hjH3b3Df9' \ - */ + // 요청 데이터 로깅 + if ($data) { + log_message('info', "[Naver API $method REQUEST] URL: $url | Data: " . json_encode($data, JSON_UNESCAPED_UNICODE)); + } else { + log_message('info', "[Naver API $method REQUEST] URL: $url"); + } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url);