mirror of
https://github.com/ctripcorp/zeus.git
synced 2024-11-11 01:24:27 +08:00
fix validation
This commit is contained in:
parent
de81049b00
commit
ff751b3a66
1 changed files with 2 additions and 4 deletions
|
@ -93,18 +93,16 @@ public class DefaultGroupValidator implements GroupValidator {
|
|||
else
|
||||
virtualServerIds.add(vs.getId());
|
||||
}
|
||||
if (groupPaths.contains(vs.getId() + vs.getVersion() + groupVirtualServer.getPath()))
|
||||
if (groupPaths.contains(vs.getId() + groupVirtualServer.getPath()))
|
||||
throw new ValidationException("Duplicate path \"" + groupVirtualServer.getPath() + "\" is found on virtual server " + vs.getId() + " from post entity.");
|
||||
else
|
||||
groupPaths.add(vs.getId() + vs.getVersion() + groupVirtualServer.getPath());
|
||||
groupPaths.add(vs.getId() + groupVirtualServer.getPath());
|
||||
}
|
||||
for (RelGroupVsDo relGroupVsDo : rGroupVsDao.findAllByVses(virtualServerIds.toArray(new Long[virtualServerIds.size()]), RGroupVsEntity.READSET_FULL)) {
|
||||
if (groupId.equals(relGroupVsDo.getGroupId()))
|
||||
continue;
|
||||
if (groupPaths.contains(relGroupVsDo.getVsId() + relGroupVsDo.getPath()))
|
||||
throw new ValidationException("Duplicate path \"" + relGroupVsDo.getPath() + "\" is found on virtual server " + relGroupVsDo.getVsId() + " from existing entities.");
|
||||
else
|
||||
groupPaths.add(relGroupVsDo.getVsId() + relGroupVsDo.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue