Revert "如果数据库表的字段是首字母大写的,并且没有用下划线分割(比如字段PrjID),会导致直接用大写首字母作为自动生成的domain的属性名。 而这种情况下默认的controller接口返回json数据时,会对首字母自动转小写(返回的json中属性是prjID), 而自动生成的前端页面绑定字段用的还是大写首字母的名字(PrjID),于是前端页面就不会显示这些字段了。 在ruoyi-fast 4.3.1中,因为还没有“if (s.indexOf(SEPARATOR) == -1) return s” 这句话,转出来的属性名是全小写的(prjid),所以前后端生成的都是一样的,未产生实际问题。"
This reverts commit 1f0d4abe
This commit is contained in:
parent
4f2a32e733
commit
dff48b64ec
|
|
@ -6,7 +6,7 @@ import com.ruoyi.common.core.text.StrFormatter;
|
|||
|
||||
/**
|
||||
* 字符串工具类
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class StringUtils extends org.apache.commons.lang3.StringUtils
|
||||
|
|
@ -19,7 +19,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* 获取参数不为空值
|
||||
*
|
||||
*
|
||||
* @param value defaultValue 要判断的value
|
||||
* @return value 返回值
|
||||
*/
|
||||
|
|
@ -30,7 +30,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个Collection是否为空, 包含List,Set,Queue
|
||||
*
|
||||
*
|
||||
* @param coll 要判断的Collection
|
||||
* @return true:为空 false:非空
|
||||
*/
|
||||
|
|
@ -41,7 +41,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个Collection是否非空,包含List,Set,Queue
|
||||
*
|
||||
*
|
||||
* @param coll 要判断的Collection
|
||||
* @return true:非空 false:空
|
||||
*/
|
||||
|
|
@ -52,7 +52,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个对象数组是否为空
|
||||
*
|
||||
*
|
||||
* @param objects 要判断的对象数组
|
||||
** @return true:为空 false:非空
|
||||
*/
|
||||
|
|
@ -63,7 +63,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个对象数组是否非空
|
||||
*
|
||||
*
|
||||
* @param objects 要判断的对象数组
|
||||
* @return true:非空 false:空
|
||||
*/
|
||||
|
|
@ -74,7 +74,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个Map是否为空
|
||||
*
|
||||
*
|
||||
* @param map 要判断的Map
|
||||
* @return true:为空 false:非空
|
||||
*/
|
||||
|
|
@ -85,7 +85,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个Map是否为空
|
||||
*
|
||||
*
|
||||
* @param map 要判断的Map
|
||||
* @return true:非空 false:空
|
||||
*/
|
||||
|
|
@ -96,7 +96,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个字符串是否为空串
|
||||
*
|
||||
*
|
||||
* @param str String
|
||||
* @return true:为空 false:非空
|
||||
*/
|
||||
|
|
@ -107,7 +107,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个字符串是否为非空串
|
||||
*
|
||||
*
|
||||
* @param str String
|
||||
* @return true:非空串 false:空串
|
||||
*/
|
||||
|
|
@ -118,7 +118,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个对象是否为空
|
||||
*
|
||||
*
|
||||
* @param object Object
|
||||
* @return true:为空 false:非空
|
||||
*/
|
||||
|
|
@ -129,7 +129,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个对象是否非空
|
||||
*
|
||||
*
|
||||
* @param object Object
|
||||
* @return true:非空 false:空
|
||||
*/
|
||||
|
|
@ -140,7 +140,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* * 判断一个对象是否是数组类型(Java基本型别的数组)
|
||||
*
|
||||
*
|
||||
* @param object 对象
|
||||
* @return true:是数组 false:不是数组
|
||||
*/
|
||||
|
|
@ -159,7 +159,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* 截取字符串
|
||||
*
|
||||
*
|
||||
* @param str 字符串
|
||||
* @param start 开始
|
||||
* @return 结果
|
||||
|
|
@ -190,7 +190,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* 截取字符串
|
||||
*
|
||||
*
|
||||
* @param str 字符串
|
||||
* @param start 开始
|
||||
* @param end 结束
|
||||
|
|
@ -242,7 +242,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
* 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
|
||||
* 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
|
||||
* 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
|
||||
*
|
||||
*
|
||||
* @param template 文本模板,被替换的部分用 {} 表示
|
||||
* @param params 参数值
|
||||
* @return 格式化后的文本
|
||||
|
|
@ -306,7 +306,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* 是否包含字符串
|
||||
*
|
||||
*
|
||||
* @param str 验证字符串
|
||||
* @param strs 字符串组
|
||||
* @return 包含返回true
|
||||
|
|
@ -328,7 +328,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
|
||||
/**
|
||||
* 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
|
||||
*
|
||||
*
|
||||
* @param name 转换前的下划线大写方式命名的字符串
|
||||
* @return 转换后的驼峰式命名的字符串
|
||||
*/
|
||||
|
|
@ -374,12 +374,6 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
}
|
||||
if (s.indexOf(SEPARATOR) == -1)
|
||||
{
|
||||
if (s.length()>0 && Character.isUpperCase(s.charAt(0))) {
|
||||
StringBuilder sb = new StringBuilder(s.length());
|
||||
sb.append(Character.toLowerCase(s.charAt(0)));
|
||||
sb.append(s.substring(1));
|
||||
return sb.toString();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
s = s.toLowerCase();
|
||||
|
|
|
|||
Loading…
Reference in New Issue