优化创建节点同时创建文件夹
This commit is contained in:
@@ -195,8 +195,10 @@ public class Constants {
|
||||
}
|
||||
|
||||
public enum NodeTypeEnum {
|
||||
NODE("node"),
|
||||
TASK("task"),
|
||||
RUN("run");
|
||||
RUN("run"),
|
||||
PERFORMANCE("performance");
|
||||
String value;
|
||||
|
||||
NodeTypeEnum(String i) {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.sdm.common.entity.req.data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "删除文件夹请求参数")
|
||||
public class DelDirReq {
|
||||
@Schema(description = "删除的文件夹id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long delDirId;
|
||||
|
||||
@Schema(description = "删除的项目节点id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String delUuid;
|
||||
|
||||
@Schema(description = "当前待删除节点uuid所属类型:node,task,run,performance")
|
||||
private String delUuIdOwnType;
|
||||
|
||||
@Schema(description = "父路径")
|
||||
private String parentPath;
|
||||
|
||||
@Schema(description = "文件夹名称")
|
||||
private String dirName;
|
||||
|
||||
// 0相对路径,1绝对路径
|
||||
@Schema(description = "路径类型: 0相对路径,1绝对路径", defaultValue = "0")
|
||||
private Integer type = 0;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.sdm.common.entity.req.data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "重命名文件夹请求参数")
|
||||
public class RenameDirReq {
|
||||
@Schema(description = "待重命名文件夹id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long dirId;
|
||||
|
||||
@Schema(description = "待重命名节点id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String uuid;
|
||||
|
||||
@Schema(description = "当前待重命名节点uuid所属类型:node,task,run,performance")
|
||||
private String uuIdOwnType;
|
||||
|
||||
@Schema(description = "父路径", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String parentPath;
|
||||
|
||||
@Schema(description = "原文件名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String oldName;
|
||||
|
||||
@NotBlank(message = "newName不能为空")
|
||||
@Schema(description = "新文件名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String newName;
|
||||
|
||||
// 0相对路径,1绝对路径
|
||||
@Schema(description = "路径类型: 0相对路径, 1绝对路径", defaultValue = "0")
|
||||
private Integer type = 0;
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.sdm.common.feign.impl.data;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.CreateDirReq;
|
||||
import com.sdm.common.entity.req.data.DelDirReq;
|
||||
import com.sdm.common.entity.req.data.RenameDirReq;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.feign.inter.data.IDataFeignClient;
|
||||
@@ -45,6 +47,36 @@ public class DataClientFeignClientImpl implements IDataFeignClient {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse renameDirNew(RenameDirReq req) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = dataClient.renameDirNew(req);
|
||||
if (!response.isSuccess()) {
|
||||
return SdmResponse.failed("重命名文件夹失败");
|
||||
}
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("重命名文件夹失败", e);
|
||||
return SdmResponse.failed("重命名文件夹失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse delDir(DelDirReq req) {
|
||||
SdmResponse response;
|
||||
try {
|
||||
response = dataClient.delDir(req);
|
||||
if (!response.isSuccess()) {
|
||||
return SdmResponse.failed("删除文件夹失败");
|
||||
}
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
log.error("删除文件夹失败", e);
|
||||
return SdmResponse.failed("删除文件夹失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse approveDataFile(LaunchApproveReq req) {
|
||||
SdmResponse response;
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.sdm.common.feign.inter.data;
|
||||
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.CreateDirReq;
|
||||
import com.sdm.common.entity.req.data.DelDirReq;
|
||||
import com.sdm.common.entity.req.data.RenameDirReq;
|
||||
import com.sdm.common.entity.req.system.LaunchApproveReq;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
@@ -21,6 +23,13 @@ public interface IDataFeignClient {
|
||||
@PostMapping("/data/createDir")
|
||||
SdmResponse createDir(@RequestBody @Validated CreateDirReq req);
|
||||
|
||||
@PostMapping("/data/renameDirNew")
|
||||
public SdmResponse renameDirNew(@RequestBody @Validated RenameDirReq req);
|
||||
|
||||
|
||||
@PostMapping("/data/delDir")
|
||||
public SdmResponse delDir(@RequestBody @Validated DelDirReq req);
|
||||
|
||||
@PostMapping("/data/approveDataFile")
|
||||
SdmResponse approveDataFile(@RequestBody LaunchApproveReq req);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user