规则通过id查询

master
Qin Dong Ming 2024-08-27 19:24:15 +08:00
parent f6c6e8a1e0
commit 6714d1099d
1 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,9 @@ public class TypeServiceImpl implements TypeService {
if (StringUtils.isNotEmpty(typseMapper.selectByName(type.getName()))){
return Result.error("类型名称不能重复");
}
if (type.getName().length()<1||type.getName().length()>20){
return Result.error("类型名称长度必须在2-10之间");
}
Integer res = typseMapper.add(type);
return Result.success(res);
}