(improvement)(Headless) Check subDomain when deleting a domain (#852)

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2024-03-21 15:47:28 +08:00
committed by GitHub
parent dfba275811
commit 30db8b70b7

View File

@@ -77,6 +77,12 @@ public class DomainServiceImpl implements DomainService {
if (!CollectionUtils.isEmpty(modelResps)) { if (!CollectionUtils.isEmpty(modelResps)) {
throw new RuntimeException("该主题域下还存在模型, 暂不能删除, 请确认"); throw new RuntimeException("该主题域下还存在模型, 暂不能删除, 请确认");
} }
List<DomainResp> domainList = getDomainList();
for (DomainResp domainResp : domainList) {
if (id.equals(domainResp.getParentId())) {
throw new RuntimeException("该主题域下还存在子主题域, 暂不能删除, 请确认");
}
}
domainRepository.deleteDomain(id); domainRepository.deleteDomain(id);
} }