develop #27

Merged
gitadmin merged 3 commits from develop into master 2026-09-29 10:25:53 +09:00
Showing only changes of commit 15e8bcede8 - Show all commits

View File

@@ -4,13 +4,11 @@ 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;
@@ -66,30 +64,13 @@ 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();
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;
}
externalApiClient.post(url, headers(), body);
}
private String baseUrl(SurveyType surveyType) {