fix(项目设置): 创建项目时未检查TCP Mock Port有效性

--bug=1010034 --user=lyh 创建项目TCP Mock Port不报错,但是修改报错
https://www.tapd.cn/55049933/s/1103233
This commit is contained in:
shiziyuan9527 2022-02-11 17:01:00 +08:00 committed by 刘瑞斌
parent 3e89e84bd2
commit 4ed013d455
1 changed files with 5 additions and 0 deletions

View File

@ -120,6 +120,11 @@ public class ProjectService {
if (projectMapper.countByExample(example) > 0) { if (projectMapper.countByExample(example) > 0) {
MSException.throwException(Translator.get("project_name_already_exists")); MSException.throwException(Translator.get("project_name_already_exists"));
} }
if (project.getMockTcpPort() != null && project.getMockTcpPort().intValue() > 0) {
this.checkMockTcpPort(project.getMockTcpPort().intValue());
}
if (StringUtils.isBlank(project.getPlatform())) { if (StringUtils.isBlank(project.getPlatform())) {
project.setPlatform(IssuesManagePlatform.Local.name()); project.setPlatform(IssuesManagePlatform.Local.name());
} }