diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/JsonUtil.java b/platform-common/src/main/java/com/lyms/platform/common/utils/JsonUtil.java index 16bcb2c..e75fe52 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/utils/JsonUtil.java +++ b/platform-common/src/main/java/com/lyms/platform/common/utils/JsonUtil.java @@ -18,16 +18,6 @@ import java.util.*; public class JsonUtil { - static JsonConfig config = new JsonConfig(); - - static { - config.registerJsonValueProcessor(Date.class, - new DateJsonValueProcessor("yyyy-MM-dd hh:mm:ss")); - config.registerJsonValueProcessor(Timestamp.class, - new DateJsonValueProcessor("yyyy-MM-dd hh:mm:ss")); - } - - public static T jkstr2Obj(String content, Class cls) { ObjectMapper objectMapper = new ObjectMapper(); @@ -63,7 +53,7 @@ public class JsonUtil { public static JSONObject getObj(String content) { if (StringUtils.isNotBlank(content)) - return JSONObject.fromObject(content, config); + return JSONObject.fromObject(content); return null; } @@ -77,7 +67,7 @@ public class JsonUtil { public static String obj2JsonString(Object obj) { try { - return JSONObject.fromObject(obj, config).toString(); + return JSONObject.fromObject(obj).toString(); } catch (Exception e) { ExceptionUtils.catchException(e, "obj2 json string error ." + e.getMessage()); } @@ -85,13 +75,13 @@ public class JsonUtil { } public static String array2JsonString(Object obj) { - return JSONArray.fromObject(obj, config).toString(); + return JSONArray.fromObject(obj).toString(); } @SuppressWarnings("unchecked") public static List toList(String content, Class cls) { - return (List) JSONArray.toCollection(JSONArray.fromObject(content, config), cls); + return (List) JSONArray.toCollection(JSONArray.fromObject(content), cls); } public static void main(String[] args) {