src/main/java/com/ruoyi/basic/enums/ApplicationTypeEnum.java
@@ -11,4 +11,19 @@ private final String type; ApplicationTypeEnum(String type) { this.type = type; } public String getType() { return type; } /** * 根据 type 值获取对应的枚举实例 * @param type 应用类型字符串 * @return 对应的 ApplicationTypeEnum 枚举实例 * @throws RuntimeException 如果 type 无效 */ public static ApplicationTypeEnum getByType(String type) { for (ApplicationTypeEnum enumValue : ApplicationTypeEnum.values()) { if (enumValue.getType().equals(type)) { return enumValue; } } throw new RuntimeException("无效的应用类型: " + type); } }