|
@@ -1,25 +1,34 @@
|
|
|
package org.fouram.core.util;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
|
|
|
public class JsonNodeUtil {
|
|
|
-
|
|
|
+
|
|
|
public static String getValue(JsonNode userNode, String key) {
|
|
|
String value = userNode.get(key).asText().trim();
|
|
|
- if(Tools.isEmpty(value)) {
|
|
|
+ if (Tools.isEmpty(value)) {
|
|
|
return "";
|
|
|
}
|
|
|
+ if (value.contains("/Date(")) {
|
|
|
+ return DateUtil.getDay(new Date(Long.valueOf(value.replace("/Date(", "").replace(")/", ""))));
|
|
|
+ }
|
|
|
return value;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static String getValue(JsonNode userNode, String key1, String key2) {
|
|
|
String value = null;
|
|
|
if (userNode.get(key1) != null && userNode.get(key1).get(key2) != null) {
|
|
|
value = userNode.get(key1).get(key2).asText().trim();
|
|
|
}
|
|
|
- if(Tools.isEmpty(value)) {
|
|
|
+ if (Tools.isEmpty(value)) {
|
|
|
return "";
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ System.out.println(DateUtil.getDay(new Date(1577923200000L)));
|
|
|
+ }
|
|
|
}
|