src/main/java/com/zy/common/web/BaseController.java
@@ -142,4 +142,29 @@ wrapper.like(columns.get(i), condition); } } public static boolean isJSON(String str) { if (Cools.isEmpty(str)) { return false; } else { str = str.trim(); if (str.startsWith("{") && str.endsWith("}")) { return true; } else if (str.startsWith("[") && str.endsWith("]")) { return true; } else { return false; } } } public static boolean isNumber(String str){ for (int i = str.length();--i>=0;){ if (!Character.isDigit(str.charAt(i))){ return false; } } return true; } }