From 3cd6b238d2cf4ba39ee5832c64bf441b2c1f3bbd Mon Sep 17 00:00:00 2001 From: jjstyle Date: Wed, 11 Feb 2026 18:26:48 +0900 Subject: [PATCH] =?UTF-8?q?=ED=98=84=EC=9E=A5=ED=99=95=EC=9D=B8=20?= =?UTF-8?q?=EB=8F=99=EA=B8=B0=ED=99=94=20=EC=8A=AC=EB=A1=AF=20api=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Libraries/NaverApiClient.php | 34 ++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) 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);