rain
2024-07-29 86384846e317381e7bb9e31ee76760e4ecb3ee67
src/main/java/com/dji/sample/wayline/service/impl/WaylineFileServiceImpl.java
@@ -153,23 +153,6 @@
        return insertId > 0 ? file.getId() : insertId;
    }
    public Integer updateWaylineFile(String workspaceId, String newName, String id) {
        String objectKey = "/" + newName;
        LambdaUpdateWrapper<WaylineFileEntity> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(WaylineFileEntity::getWaylineId, id)
                .eq(WaylineFileEntity::getWorkspaceId, workspaceId)
                .set(WaylineFileEntity::getObjectKey, objectKey);
        // 使用 mapper 执行更新操作
        boolean updated = mapper.update(null, updateWrapper) > 0;
        if (!updated) {
            throw new RuntimeException("更新 objectKey 失败");
        }
        return updated ? 1 : 0; // 返回更新结果
    }
    @Override
    public Integer saveWaylineFiles(String workspaceId, WaylineFileDTO metadata, String patchesId,String isTemp) {
        metadata.setPatchesId(patchesId);
@@ -290,7 +273,6 @@
            waylineFile.setWaylineId(workspaceId);
            waylineFile.setUsername(creator);
            ossService.putObject(OssConfiguration.bucket, waylineFile.getObjectKey(), file.getInputStream());
            this.updateWaylineFile(workspaceId,newName,id);
        } catch (IOException e) {
            e.printStackTrace();
        }