rain
2024-03-23 d2108ee735894d73bf655bda1651ecaefbc4c09d
src/main/java/com/dji/sample/map/service/impl/WorkspaceElementServiceImpl.java
@@ -47,7 +47,7 @@
    public ResponseResult saveElement(String groupId, ElementCreateDTO elementCreate) {
        boolean saveElement = groupElementService.saveElement(groupId, elementCreate);
        if (!saveElement) {
            return ResponseResult.error("Failed to save the element.");
            return ResponseResult.error("保存元素失败");
        }
        // save coordinate
@@ -55,7 +55,7 @@
                        elementCreate.getResource().getContent().getGeometry().convertToList(), elementCreate.getId());
        return saveCoordinate ?
                ResponseResult.success() : ResponseResult.error("Failed to save the coordinate.");
                ResponseResult.success() : ResponseResult.error("保存坐标失败");
    }
@@ -63,7 +63,7 @@
    public ResponseResult updateElement(String elementId, ElementUpdateDTO elementUpdate, String username) {
        boolean updElement = groupElementService.updateElement(elementId, elementUpdate, username);
        if (!updElement) {
            return ResponseResult.error("Failed to update the element.");
            return ResponseResult.error("更新元素失败");
        }
        // delete all coordinates according to element id.
@@ -73,21 +73,21 @@
                elementUpdate.getContent().getGeometry().convertToList(), elementId);
        return delCoordinate && saveCoordinate ?
                ResponseResult.success() : ResponseResult.error("Failed to update the coordinate.");
                ResponseResult.success() : ResponseResult.error("更新坐标失败");
    }
    @Override
    public ResponseResult deleteElement(String elementId) {
        boolean delElement = groupElementService.deleteElement(elementId);
        if (!delElement) {
            return ResponseResult.error("Failed to delete the element.");
            return ResponseResult.error("删除元素失败");
        }
        // delete all coordinates according to element id.
        boolean delCoordinate = elementCoordinateService.deleteCoordinateByElementId(elementId);
        return delCoordinate ?
                ResponseResult.success() : ResponseResult.error("Failed to delete the coordinate.");
                ResponseResult.success() : ResponseResult.error("删除坐标失败");
    }
    @Override