From 9cc6d4951520fca2a33d05d116d6272b8ef87cf9 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Thu, 18 Jul 2024 10:15:05 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20WebClient=20=ED=98=B8=EC=B6=9C=20paramet?= =?UTF-8?q?er=EC=9D=98=20List=ED=98=95=20=EC=B2=98=EB=A6=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/adds/core/util/ApiUtil.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/cokr/xit/adds/core/util/ApiUtil.java b/src/main/java/cokr/xit/adds/core/util/ApiUtil.java index 8833923..f1ab24c 100644 --- a/src/main/java/cokr/xit/adds/core/util/ApiUtil.java +++ b/src/main/java/cokr/xit/adds/core/util/ApiUtil.java @@ -143,9 +143,17 @@ public class ApiUtil { JSONObject jsonObj = toObjByObj(obj, JSONObject.class); for (Object key : jsonObj.keySet()) { - // API 호출 시 필요없는 파라메터 제외 - if("userId".equals(key) || "dbSkipYn".equals(key)) continue; - request.data((String) key, ObjectUtils.isEmpty(jsonObj.get(key))? StringUtils.EMPTY: jsonObj.get(key)); + Object value = jsonObj.get(key); + + if (value instanceof List) { + // List를 쉼표로 구분된 문자열로 변환 + String listAsString = String.join(",", (List) value); + request.data((String) key, listAsString); + } else { + // NIMS API 호출 시 필요없는 파라메터 제외 + if("userId".equals(key) || "dbSkipYn".equals(key)) continue; + request.data((String) key, ObjectUtils.isEmpty(value) ? StringUtils.EMPTY : jsonObj.get(key)); + } } }