规则通过id查询
parent
f6c6e8a1e0
commit
6714d1099d
|
@ -36,6 +36,9 @@ public class TypeServiceImpl implements TypeService {
|
||||||
if (StringUtils.isNotEmpty(typseMapper.selectByName(type.getName()))){
|
if (StringUtils.isNotEmpty(typseMapper.selectByName(type.getName()))){
|
||||||
return Result.error("类型名称不能重复");
|
return Result.error("类型名称不能重复");
|
||||||
}
|
}
|
||||||
|
if (type.getName().length()<1||type.getName().length()>20){
|
||||||
|
return Result.error("类型名称长度必须在2-10之间");
|
||||||
|
}
|
||||||
Integer res = typseMapper.add(type);
|
Integer res = typseMapper.add(type);
|
||||||
return Result.success(res);
|
return Result.success(res);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue