From 2a87a2498089ef3ca471c1e57ccf571907df8e8c Mon Sep 17 00:00:00 2001 From: tjq Date: Fri, 17 Mar 2023 23:06:08 +0800 Subject: [PATCH] fix: workflow append string will have quotes #307 --- .../main/java/tech/powerjob/common/serialize/JsonUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/powerjob-common/src/main/java/tech/powerjob/common/serialize/JsonUtils.java b/powerjob-common/src/main/java/tech/powerjob/common/serialize/JsonUtils.java index 985b8df9..085da18c 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/serialize/JsonUtils.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/serialize/JsonUtils.java @@ -32,6 +32,9 @@ public class JsonUtils { } public static String toJSONString(Object obj) { + if (obj instanceof String) { + return (String) obj; + } try { return JSON_MAPPER.writeValueAsString(obj); }catch (Exception e) { @@ -41,6 +44,9 @@ public class JsonUtils { } public static String toJSONStringUnsafe(Object obj) { + if (obj instanceof String) { + return (String) obj; + } try { return JSON_MAPPER.writeValueAsString(obj); }catch (Exception e) {