parent
33ad8ea857
commit
b11893bb4f
@ -31,6 +31,7 @@ import cn.axzo.nanopart.doc.dao.DocLockDao;
|
||||
import cn.axzo.nanopart.doc.dao.IndexNodeDao;
|
||||
import cn.axzo.nanopart.doc.entity.IndexNode;
|
||||
import cn.axzo.nanopart.doc.entity.domain.Path;
|
||||
import cn.axzo.nanopart.doc.file.index.domain.NameUsedException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -131,7 +132,8 @@ public class IndexSupport {
|
||||
|
||||
void ensureChildNameNotUsed(IndexNodeParentScope parentScope, IndexNodeType nodeType, String childName) {
|
||||
IndexNode child = indexNodeDao.findValidChildByName(parentScope, nodeType, childName);
|
||||
BizAssertions.assertNull(child, "名称已被使用");
|
||||
if (child != null)
|
||||
throw new NameUsedException("名称已被使用");
|
||||
}
|
||||
|
||||
void lockParentAndReleaseOnCommit(IndexNodeParentScope parentScope) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user