update 升级 hutool 5.7.1 适配工具类
| | |
| | | FilterRegistrationBean registration = new FilterRegistrationBean(); |
| | | registration.setDispatcherTypes(DispatcherType.REQUEST); |
| | | registration.setFilter(new XssFilter()); |
| | | registration.addUrlPatterns(StrUtil.split(xssProperties.getUrlPatterns(), ",")); |
| | | registration.addUrlPatterns(StrUtil.splitToArray(xssProperties.getUrlPatterns(), ",")); |
| | | registration.setName("xssFilter"); |
| | | registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); |
| | | Map<String, String> initParameters = new HashMap<String, String>(); |
| | |
| | | |
| | | /** |
| | | * 代码生成器 工具类 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class GenUtils |
| | |
| | | column.setHtmlType(GenConstants.HTML_INPUT); |
| | | |
| | | // 如果是浮点型 统一用BigDecimal |
| | | String[] str = StrUtil.split(StrUtil.subBetween(column.getColumnType(), "(", ")"), ","); |
| | | String[] str = StrUtil.splitToArray(StrUtil.subBetween(column.getColumnType(), "(", ")"), ","); |
| | | if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) |
| | | { |
| | | column.setJavaType(GenConstants.TYPE_BIGDECIMAL); |
| | |
| | | |
| | | /** |
| | | * 校验数组是否包含指定值 |
| | | * |
| | | * |
| | | * @param arr 数组 |
| | | * @param targetValue 值 |
| | | * @return 是否包含 |
| | |
| | | |
| | | /** |
| | | * 获取模块名 |
| | | * |
| | | * |
| | | * @param packageName 包名 |
| | | * @return 模块名 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取业务名 |
| | | * |
| | | * |
| | | * @param tableName 表名 |
| | | * @return 业务名 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 表名转换成Java类名 |
| | | * |
| | | * |
| | | * @param tableName 表名称 |
| | | * @return 类名 |
| | | */ |
| | |
| | | String tablePrefix = GenConfig.getTablePrefix(); |
| | | if (autoRemovePre && StrUtil.isNotEmpty(tablePrefix)) |
| | | { |
| | | String[] searchList = StrUtil.split(tablePrefix, ","); |
| | | String[] searchList = StrUtil.splitToArray(tablePrefix, ","); |
| | | tableName = replaceFirst(tableName, searchList); |
| | | } |
| | | return StrUtil.upperFirst(StrUtil.toCamelCase(tableName)); |
| | |
| | | |
| | | /** |
| | | * 批量替换前缀 |
| | | * |
| | | * |
| | | * @param replacementm 替换值 |
| | | * @param searchList 替换列表 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 关键字替换 |
| | | * |
| | | * |
| | | * @param text 需要被替换的名字 |
| | | * @return 替换后的名字 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取数据库类型字段 |
| | | * |
| | | * |
| | | * @param columnType 列类型 |
| | | * @return 截取后的列类型 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取字段长度 |
| | | * |
| | | * |
| | | * @param columnType 列类型 |
| | | * @return 截取后的列类型 |
| | | */ |