修改bug

This commit is contained in:
hzj
2024-12-11 15:05:09 +08:00
parent 9bc072ec8b
commit eb54a13226
6 changed files with 13 additions and 3 deletions

View File

@@ -23,7 +23,6 @@ public class CarryCapacityDeviceParam {
/**
* 设备名称
*/
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.DATA_TOO_LONG)
private String devName;
private String devScale;

View File

@@ -31,7 +31,6 @@ public class CarryCapacityUserParam {
/**
* 用户名称
*/
@Pattern(regexp = PatternRegex.DES32_REGEX, message = ValidMessage.DATA_TOO_LONG)
private String userName;
/**

View File

@@ -16,10 +16,14 @@ import java.util.regex.Pattern;
*/
public class CheckStringUtil {
public static void checkName(String name) {
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
Pattern pattern = Pattern.compile(PatternRegex.SPECIALCHARACTER);
if(pattern.matcher(name).find()){
throw new BusinessException(ValidMessage.NAME_SPECIAL_REGEX);
}
}
// public static void main(String[] args) {
// checkName("100迈岭站2djvjva13ad");
// }
}