From 31772ca3e1aa6486592c7088c0f81970f938b106 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Thu, 20 Nov 2025 13:40:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=A9=94=EC=9D=BC=20=EB=B0=9C?= =?UTF-8?q?=EC=86=A1=20JSONObject=20->=20JSONArray=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/eactive/ext/kjb/ums/EmailJob.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eactive/ext/kjb/ums/EmailJob.java b/src/main/java/com/eactive/ext/kjb/ums/EmailJob.java index 2366639..1c83c55 100644 --- a/src/main/java/com/eactive/ext/kjb/ums/EmailJob.java +++ b/src/main/java/com/eactive/ext/kjb/ums/EmailJob.java @@ -11,6 +11,7 @@ import com.eactive.ext.kjb.eai.KjbEaiBatchModule; import com.eactive.ext.kjb.safedb.KjbSafedbWrapper; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonObject; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -242,12 +243,14 @@ public class EmailJob { Gson gson = new Gson(); String message = messageRequest.getMessage(); + JsonArray jsonArray = new JsonArray(); log.debug("Template string to json: {}", message); if (StringUtils.isNotEmpty(message)) { JsonObject contentJSon = gson.fromJson(message, JsonObject.class); contentJSon.entrySet().forEach(entry -> { jsonObject.add(entry.getKey(), entry.getValue()); }); + jsonArray.add(jsonObject); } // jsonObject.addProperty("SUBJECT", messageRequest.getSubject()); @@ -255,7 +258,7 @@ public class EmailJob { String jsonString; if (isPretty) { - jsonString = new GsonBuilder().setPrettyPrinting().create().toJson(jsonObject); + jsonString = new GsonBuilder().setPrettyPrinting().create().toJson(jsonArray); } else { jsonString = jsonObject.toString(); }