master
chentaisen 2024-09-09 16:00:26 +08:00
parent a17332f64f
commit b5e845efb6
4 changed files with 158 additions and 0 deletions

View File

@ -180,6 +180,11 @@
<artifactId>forest-spring-boot3-starter</artifactId> <artifactId>forest-spring-boot3-starter</artifactId>
<version>1.5.36</version> <version>1.5.36</version>
</dependency> </dependency>
<!-- oss -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
</dependency>
</dependencies> </dependencies>

View File

@ -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("-");
}
}

View File

@ -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));
}
}

View File

@ -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));
}
}