update 统一格式化代码结构

This commit is contained in:
疯狂的狮子li
2021-10-22 10:04:15 +08:00
parent 32bfe334c0
commit 336adbd056
54 changed files with 806 additions and 987 deletions

View File

@ -8,8 +8,7 @@ import com.ruoyi.common.utils.StringUtils;
*
* @author ruoyi
*/
public class SqlUtil
{
public class SqlUtil {
/**
* 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序)
*/
@ -18,10 +17,8 @@ public class SqlUtil
/**
* 检查字符,防止注入绕过
*/
public static String escapeOrderBySql(String value)
{
if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value))
{
public static String escapeOrderBySql(String value) {
if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) {
throw new UtilException("参数不符合规范,不能进行查询");
}
return value;
@ -30,8 +27,7 @@ public class SqlUtil
/**
* 验证 order by 语法是否符合规范
*/
public static boolean isValidOrderBySql(String value)
{
public static boolean isValidOrderBySql(String value) {
return value.matches(SQL_PATTERN);
}
}