From ccfc0f1cc8aec703504fee8b8c47d2fd29dcb5a1 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Mon, 28 Sep 2026 11:03:38 +0900 Subject: [PATCH] =?UTF-8?q?260928=5F01=5FENH:=20kon,=20kiwi=20api=20?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=20=EB=B0=8F=20=EC=84=B1=EA=B3=B5,=20?= =?UTF-8?q?=EC=8B=A4=ED=8C=A8=20=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contactsurvey/ContactSurveyApiClient.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/kri/contact/server/common/external/contactsurvey/ContactSurveyApiClient.java b/src/main/java/com/kri/contact/server/common/external/contactsurvey/ContactSurveyApiClient.java index d5ae1ee..72915cd 100644 --- a/src/main/java/com/kri/contact/server/common/external/contactsurvey/ContactSurveyApiClient.java +++ b/src/main/java/com/kri/contact/server/common/external/contactsurvey/ContactSurveyApiClient.java @@ -4,11 +4,13 @@ import com.kri.common.feature.http.ExternalApiClient; import com.kri.common.feature.http.ExternalApiResponse; import com.kri.common.feature.web.BusinessException; import com.kri.contact.server.common.enums.SurveyType; +import java.net.URI; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Locale; import java.util.Map; +import java.util.concurrent.TimeUnit; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; @@ -64,13 +66,30 @@ public class ContactSurveyApiClient { validate(pkey, psidx); String url = baseUrl(surveyType) + CONTACT_SURVEY_PATH; + String target = target(); String body = "CRUD=" + crud + "&COMMAND=" + CONTACT_SURVEY_COMMAND + "&PKEY=" + encode(pkey) + "&PSIDX=" + psidx - + "&TARGET=" + target(); + + "&TARGET=" + target; - externalApiClient.post(url, headers(), body); + String host = URI.create(url).getHost(); + log.info("ContactSurvey API request surveyType={} crud={} target={} host={} path={}", + surveyType, crud, target, host, CONTACT_SURVEY_PATH); + long startedAt = System.nanoTime(); + try { + ExternalApiResponse response = externalApiClient.post(url, headers(), body); + log.info("ContactSurvey API response surveyType={} crud={} target={} host={} status={} elapsedMs={}", + surveyType, crud, target, host, response.getStatusCode(), + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startedAt)); + } catch (RuntimeException e) { + Throwable cause = e.getCause(); + log.warn("ContactSurvey API failure surveyType={} crud={} target={} host={} errorType={} causeType={} elapsedMs={}", + surveyType, crud, target, host, e.getClass().getSimpleName(), + cause == null ? "none" : cause.getClass().getSimpleName(), + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startedAt)); + throw e; + } } private String baseUrl(SurveyType surveyType) {