修改bug

This commit is contained in:
hzj
2024-12-17 20:36:54 +08:00
parent d1aefa92d8
commit 6f38ddf068
6 changed files with 138 additions and 32 deletions

View File

@@ -86,4 +86,6 @@ public class CsEquipmentDeliveryVO extends BaseEntity {
@ApiModelProperty(value="装置使用状态(0:停用 1:启用)")
private Integer usageStatus ;
private Integer sort;
}

View File

@@ -0,0 +1,30 @@
package com.njcn.csdevice.utils;
import com.njcn.common.pojo.exception.BusinessException;
import java.util.regex.Pattern;
/**
* Description:
* Date: 2024/12/17 14:29【需求编号】
*
* @author clam
* @version V1.0.0
*/
public class StringUtil {
public static void containsSpecialCharacters(String str) {
// 定义包含特殊字符的正则表达式
String specialChars = "[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html";
// 创建Pattern对象
Pattern pattern = Pattern.compile(specialChars);
// 使用Pattern对象的matcher方法检查字符串
if(pattern.matcher(str).find()){
throw new BusinessException("存在特殊字符[<>\"'%;()&+//\\-———|@*_?#$!,.html]");
}
}
public static void main(String[] args) {
StringUtil.containsSpecialCharacters("*");
}
}