Changes
parent
a17332f64f
commit
b5e845efb6
5
pom.xml
5
pom.xml
|
@ -180,6 +180,11 @@
|
|||
<artifactId>forest-spring-boot3-starter</artifactId>
|
||||
<version>1.5.36</version>
|
||||
</dependency>
|
||||
<!-- oss -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
package com.muyu.common.core.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @Author: 胡杨
|
||||
* @Name: SysApiState
|
||||
* @Description: 字段类型字典
|
||||
* @CreatedDate: 2024/8/20 下午7:56
|
||||
* @FilePath: com.muyu.common.core.enums
|
||||
*/
|
||||
|
||||
@Getter
|
||||
public enum SysFieldsType {
|
||||
BYTE("Byte",Byte.class, "字节型"),
|
||||
SHORT("Short",Short.class, "短整型"),
|
||||
INTEGER("Integer",Integer.class, "整型"),
|
||||
FLOAT("Float",Float.class, "单精度浮点型"),
|
||||
DOUBLE("Double",Double.class, "双精度浮点型"),
|
||||
LONG("Long",Long.class, "长整型"),
|
||||
CHAR("char",char.class, "字符型"),
|
||||
BOOLEAN("Boolean",Boolean.class, "布尔型"),
|
||||
STRING("String",String.class, "字符串"),
|
||||
LIST("List", List.class, "List集合"),
|
||||
SET("Set", Set.class, "Set集合"),
|
||||
MAP("Map", Map.class, "map集合"),
|
||||
OBJECT("Object",Object.class, "其他");
|
||||
|
||||
private final String code;
|
||||
private final Class type;
|
||||
private final String name;
|
||||
|
||||
SysFieldsType(String code, Class type, String name) {
|
||||
this.code = code;
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 鉴别参数是否是启用状态
|
||||
* @param code 需鉴别参数
|
||||
* @return 如果存在返回结果turn,否则返回false
|
||||
*/
|
||||
public static boolean isCode(String code){
|
||||
return Arrays.stream(values())
|
||||
.map(SysFieldsType::getCode)
|
||||
.anyMatch(c -> c.equals(code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数转换,从编码转换为名称
|
||||
* @param code 编码
|
||||
* @return 名称
|
||||
*/
|
||||
public static Class<?> getTypeByCode(String code){
|
||||
return Arrays.stream(values())
|
||||
.filter(c -> c.getCode().equals(code))
|
||||
.findFirst()
|
||||
.map(SysFieldsType::getType)
|
||||
.orElse(Object.class);
|
||||
}
|
||||
|
||||
public static String getNameByCode(String code){
|
||||
return Arrays.stream(values())
|
||||
.filter(c -> c.getCode().equals(code))
|
||||
.findFirst()
|
||||
.map(SysFieldsType::getName)
|
||||
.orElse("-");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.muyu.common.core.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Author: 胡杨
|
||||
* @Name: SysNodeType
|
||||
* @Description: 节点类型枚举
|
||||
* @CreatedDate: 2024/8/29 下午4:46
|
||||
* @FilePath: com.muyu.common.core.enums
|
||||
*/
|
||||
|
||||
@Getter
|
||||
public enum SysNodeType {
|
||||
START("start", "开始"),
|
||||
TABLE("table", "表结构"),
|
||||
UNITE("unite", "联合查询"),
|
||||
EXPORTATION("exportation", "数据输出"),
|
||||
END("end", "结束");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
SysNodeType(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 鉴别参数是否是枚举的值
|
||||
*
|
||||
* @param code 需鉴别参数
|
||||
* @return 如果存在返回结果turn, 否则返回false
|
||||
*/
|
||||
public static boolean isCode(String code) {
|
||||
return Arrays.stream(values())
|
||||
.map(SysNodeType::getCode)
|
||||
.anyMatch(c -> c.equals(code));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.common.core.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Data 2024/8/1
|
||||
* @Description 系统是否枚举
|
||||
* @Version 1.0.0
|
||||
*/
|
||||
public enum SystemYesNo {
|
||||
|
||||
YES("Y","是"),
|
||||
NO("N","否");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
SystemYesNo(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode () {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo () {
|
||||
return info;
|
||||
}
|
||||
|
||||
public static Boolean isCode (String code) {
|
||||
return Arrays.stream(values())
|
||||
.map(SystemYesNo::getCode)
|
||||
.anyMatch(c -> c.equals(code));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue