常量位置修改

This commit is contained in:
2025-11-10 10:52:17 +08:00
parent 0a2d47b7d7
commit 544b83899b
18 changed files with 212 additions and 211 deletions

View File

@@ -1,146 +0,0 @@
package com.sdm.common.common;
import io.swagger.v3.oas.annotations.media.Schema;
public class Constants {
public enum DataType {
DIRECTORY(1),
FILE(2);
int value;
DataType(int i) {
value = i;
}
public int getValue() {
return value;
}
}
public enum FileIsLast {
YES(true),
NO(false);
Boolean value;
FileIsLast(boolean i) {
value = i;
}
public boolean getValue() {
return value;
}
}
public enum FilePermission {
READ((byte) 0x01),
WRITE((byte) 0x02),
DELETE((byte) 0x04),
DOWNLOAD((byte) 0x08),
UPLOAD((byte) 0x10),
NONE((byte) -1),
ZERO((byte) 0),
ALL((byte) (READ.value | WRITE.value | DELETE.value | DOWNLOAD.value | UPLOAD.value));
byte value;
FilePermission(byte i) {
}
public byte getValue() {
return value;
}
}
@Schema(description = "文件夹类型枚举")
public enum DirType {
/**
* 知识库文件夹
*/
@Schema(description = "知识库文件夹", example = "1")
KNOWLEDGE_BASE_DIR("knowledge", 1),
/**
* 项目节点文件夹
*/
@Schema(description = "项目节点文件夹", example = "2")
PROJECT_NODE_DIR("projectNode", 2),
/**
* 头像库文件夹
*/
@Schema(description = "头像库文件夹", example = "3")
AVATAR_DIR("avatar", 3),
/**
* 仿真参数库文件夹
*/
@Schema(description = "仿真参数库文件夹", example = "4")
SIMULATION_PARAMETER_DIR("simulationParameter", 4),
/**
* 训练模型文件夹
*/
@Schema(description = "训练模型文件", example = "5")
TRAIN_MODEL_DIR("trainModel", 5);
String dirName;
int value;
DirType(String dirName, int value) {
this.dirName = dirName;
this.value = value;
}
public int getValue() {
return value;
}
public String getDirName() {
return dirName;
}
// 根据value获取对应的枚举
public static DirType getDirTypeByValue(int value) {
for (DirType dirType : values()) {
if (dirType.value == value) {
return dirType;
}
}
return null;
}
}
// 仿真参数库数据类型
public enum SimulationParameterDataType {
//库类型
LIBRARY(1),
// 分类类型
CATEGORY(2),
// 对象类型
OBJECT(3);
int value;
SimulationParameterDataType(int i) {
value = i;
}
public int getValue() {
return value;
}
}
public enum NodeTypeEnum {
NODE("node"),
TASK("task"),
RUN("run"),
PERFORMANCE("performance");
String value;
NodeTypeEnum(String i) {
value = i;
}
public String getValue() {
return value;
}
}
}

View File

@@ -0,0 +1,15 @@
package com.sdm.common.entity.enums;
public enum DataTypeEnum {
DIRECTORY(1),
FILE(2);
int value;
DataTypeEnum(int i) {
value = i;
}
public int getValue() {
return value;
}
}

View File

@@ -0,0 +1,62 @@
package com.sdm.common.entity.enums;
import io.swagger.v3.oas.annotations.media.Schema;
@Schema(description = "文件夹类型枚举")
public enum DirTypeEnum {
/**
* 知识库文件夹
*/
@Schema(description = "知识库文件夹", example = "1")
KNOWLEDGE_BASE_DIR("knowledge", 1),
/**
* 项目节点文件夹
*/
@Schema(description = "项目节点文件夹", example = "2")
PROJECT_NODE_DIR("projectNode", 2),
/**
* 头像库文件夹
*/
@Schema(description = "头像库文件夹", example = "3")
AVATAR_DIR("avatar", 3),
/**
* 仿真参数库文件夹
*/
@Schema(description = "仿真参数库文件夹", example = "4")
SIMULATION_PARAMETER_DIR("simulationParameter", 4),
/**
* 训练模型文件夹
*/
@Schema(description = "训练模型文件", example = "5")
TRAIN_MODEL_DIR("trainModel", 5);
String dirName;
int value;
DirTypeEnum(String dirName, int value) {
this.dirName = dirName;
this.value = value;
}
public int getValue() {
return value;
}
public String getDirName() {
return dirName;
}
// 根据value获取对应的枚举
public static DirTypeEnum getDirTypeByValue(int value) {
for (DirTypeEnum dirTypeEnum : values()) {
if (dirTypeEnum.value == value) {
return dirTypeEnum;
}
}
return null;
}
}

View File

@@ -0,0 +1,15 @@
package com.sdm.common.entity.enums;
public enum FileIsLastEnum {
YES(true),
NO(false);
Boolean value;
FileIsLastEnum(boolean i) {
value = i;
}
public boolean getValue() {
return value;
}
}

View File

@@ -0,0 +1,20 @@
package com.sdm.common.entity.enums;
public enum FilePermissionEnum {
READ((byte) 0x01),
WRITE((byte) 0x02),
DELETE((byte) 0x04),
DOWNLOAD((byte) 0x08),
UPLOAD((byte) 0x10),
NONE((byte) -1),
ZERO((byte) 0),
ALL((byte) (READ.value | WRITE.value | DELETE.value | DOWNLOAD.value | UPLOAD.value));
byte value;
FilePermissionEnum(byte i) {
}
public byte getValue() {
return value;
}
}

View File

@@ -0,0 +1,18 @@
package com.sdm.common.entity.enums;
public enum NodeTypeEnum {
NODE("node"),
TASK("task"),
RUN("run"),
PERFORMANCE("performance");
String value;
NodeTypeEnum(String i) {
value = i;
}
public String getValue() {
return value;
}
}

View File

@@ -0,0 +1,20 @@
package com.sdm.common.entity.enums;
// 仿真参数库数据类型
public enum SimulationParameterDataTypeEnum {
//库类型
LIBRARY(1),
// 分类类型
CATEGORY(2),
// 对象类型
OBJECT(3);
int value;
SimulationParameterDataTypeEnum(int i) {
value = i;
}
public int getValue() {
return value;
}
}