|
@@ -5,10 +5,8 @@ import com.qizhen.healsphere.repository.neo4j.BaseNodeRepository;
|
|
|
import com.qizhen.healsphere.repository.neo4j.param.MergeNodeParam;
|
|
|
import com.qizhen.healsphere.repository.neo4j.entity.BaseEntity;
|
|
|
import com.qizhen.healsphere.service.EntityService;
|
|
|
-import com.qizhen.healsphere.web.vo.CreateEntityVO;
|
|
|
-import com.qizhen.healsphere.web.vo.EntityVO;
|
|
|
-import com.qizhen.healsphere.web.vo.MergeEntityVO;
|
|
|
-import com.qizhen.healsphere.web.vo.UpdateEntityVO;
|
|
|
+import com.qizhen.healsphere.web.EntityController;
|
|
|
+import com.qizhen.healsphere.web.vo.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -47,17 +45,18 @@ public class EntityServiceImpl implements EntityService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Boolean deleteEntity(List<Long> ids) {
|
|
|
+ public Boolean deleteEntity(DeleteEntityVO ids) {
|
|
|
|
|
|
+ List<Long> entityIds = ids.getIds();
|
|
|
//查询是否存在删除实体
|
|
|
- boolean allExist = ids.stream()
|
|
|
+ boolean allExist = entityIds.stream()
|
|
|
.allMatch(id -> nodeRepository.findNodeById(id) != null);
|
|
|
if (!allExist) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// 删除单个实体
|
|
|
- ids.forEach(id -> nodeRepository.deleteNode(id));
|
|
|
+ entityIds.forEach(id -> nodeRepository.deleteNode(id));
|
|
|
|
|
|
return true;
|
|
|
}
|
|
@@ -92,9 +91,9 @@ public class EntityServiceImpl implements EntityService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object>findEntityById(Long id) {
|
|
|
+ public Map<String, Object>findEntityById(FindEntityVO id) {
|
|
|
|
|
|
- Map<String, Object> entityById = nodeRepository.findNodeById(id);
|
|
|
+ Map<String, Object> entityById = nodeRepository.findNodeById(id.getId());
|
|
|
return entityById;
|
|
|
}
|
|
|
|