id数据类型调整

This commit is contained in:
2025-10-31 13:48:13 +08:00
parent d259059620
commit e606a85203
13 changed files with 124 additions and 50 deletions

View File

@@ -55,48 +55,50 @@ public class Constants {
/**
* 模型文件
*/
@Schema(description = "模型文件",example = "1")
@Schema(description = "模型文件", example = "1")
MODEL_FILE(1),
/**
* 仿真报告
*/
@Schema(description = "仿真报告",example = "2")
@Schema(description = "仿真报告", example = "2")
REPORT_FILE(2),
/**
* 计算文件
*/
@Schema(description = "计算文件",example = "3")
@Schema(description = "计算文件", example = "3")
COMPUTE_FILE(3),
/**
* 曲线文件
*/
@Schema(description = "曲线文件",example = "4")
@Schema(description = "曲线文件", example = "4")
CURVE_FILE(4),
/**
* 云图文件
*/
@Schema(description = "云图文件",example = "5")
@Schema(description = "云图文件", example = "5")
CLOUD_FILE(5),
/**
* 项目文件
*/
@Schema(description = "项目 文件",example = "6")
@Schema(description = "项目 文件", example = "6")
PROJECT_FILE(6),
/**
* 学科文件
*/
@Schema(description = "学科 文件",example = "7")
@Schema(description = "学科 文件", example = "7")
DISCIPLINE_MAJOR_FILE(7);
int value;
FileType(int i) {
value = i;
}
public int getValue() {
return value;
}
@@ -107,39 +109,41 @@ public class Constants {
/**
* 知识库文件夹
*/
@Schema(description = "知识库文件夹",example = "1")
KNOWLEDGE_BASE_DIR("knowledge",1),
@Schema(description = "知识库文件夹", example = "1")
KNOWLEDGE_BASE_DIR("knowledge", 1),
/**
* 项目节点文件夹
*/
@Schema(description = "项目节点文件夹",example = "2")
PROJECT_NODE_DIR("projectNode",2),
@Schema(description = "项目节点文件夹", example = "2")
PROJECT_NODE_DIR("projectNode", 2),
/**
* 头像库文件夹
*/
@Schema(description = "头像库文件夹",example = "3")
AVATAR_DIR("avatar",3),
@Schema(description = "头像库文件夹", example = "3")
AVATAR_DIR("avatar", 3),
/**
* 仿真参数库文件夹
*/
@Schema(description = "仿真参数库文件夹",example = "4")
SIMULATION_PARAMETER_DIR("simulationParameter",4),
@Schema(description = "仿真参数库文件夹", example = "4")
SIMULATION_PARAMETER_DIR("simulationParameter", 4),
/**
* 训练模型文件夹
*/
@Schema(description = "训练模型文件",example = "5")
TRAIN_MODEL_DIR("trainModel",5);
@Schema(description = "训练模型文件", example = "5")
TRAIN_MODEL_DIR("trainModel", 5);
String dirName;
int value;
DirType(String dirName,int value) {
DirType(String dirName, int value) {
this.dirName = dirName;
this.value = value;
}
public int getValue() {
return value;
}
@@ -147,6 +151,16 @@ public class Constants {
public String getDirName() {
return dirName;
}
// 根据value获取对应的枚举
public static DirType getDirTypeByValue(int value) {
for (DirType dirType : values()) {
if (dirType.value == value) {
return dirType;
}
}
return null;
}
}
// 仿真参数库数据类型

View File

@@ -16,7 +16,7 @@ public class CreateDirReq {
@Schema(description = "文件夹名称")
private String dirName;
@Schema(description = "文件夹类型1 知识库文件夹2 项目节点文件夹3 头像库文件夹4 仿真参数库文件夹")
@Schema(description = "文件夹类型DirType1 知识库文件夹2 项目节点文件夹3 头像库文件夹4 仿真参数库文件夹,5 训练模型文件夹")
private Integer dirType;
// 0相对路径1绝对路径

View File

@@ -16,13 +16,13 @@ public class FileMetadataInfoResp implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "主键ID")
private Integer id;
private Long id;
@Schema(description = "逻辑文件组ID同一文件的所有版本共享一个ID")
private Integer fileGroupId;
private Long fileGroupId;
@Schema(description = "版本号从1开始递增")
private Integer versionNo;
private Long versionNo;
@Schema(description = "是否最新版本1-是0-否")
private Boolean isLatest;
@@ -46,16 +46,16 @@ public class FileMetadataInfoResp implements Serializable {
private Boolean isRoot;
@Schema(description = "父文件ID")
private Integer parentId;
private Long parentId;
@Schema(description = "创建者ID")
private String creatorId;
private Long creatorId;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "更新者ID")
private String updaterId;
private Long updaterId;
@Schema(description = "更新时间")
private LocalDateTime updateTime;

View File

@@ -16,10 +16,10 @@ public class DataClientFeignClientImpl implements IDataFeignClient {
@Autowired
private IDataFeignClient dataClient;
public SdmResponse<List<FileMetadataInfoResp>> listDir(Long parentDirId) {
public SdmResponse<List<FileMetadataInfoResp>> listDir(Integer dirType,Long parentDirId) {
SdmResponse<List<FileMetadataInfoResp> > response;
try {
response = dataClient.listDir(parentDirId);
response = dataClient.listDir(dirType,parentDirId);
if (!response.isSuccess()) {
return SdmResponse.failed("创建文件夹失败");
}

View File

@@ -15,7 +15,7 @@ import java.util.List;
@FeignClient(name = "data")
public interface IDataFeignClient {
@GetMapping("/data/listDir")
SdmResponse<List<FileMetadataInfoResp>> listDir(@RequestParam(value = "parentDirId", required = false) Long parentDirId);
SdmResponse<List<FileMetadataInfoResp>> listDir( @RequestParam(value = "dirType") Integer dirType,@RequestParam(value = "parentDirId", required = false) Long parentDirId);
@PostMapping("/data/createDir")
SdmResponse createDir(@RequestBody @Validated CreateDirReq req);