fuliqi
2024-11-14 cfcfbf068acf9b9d509a99498346dcbcf101cdf9
ycl-common/src/main/java/enumeration/ErrorType.java
@@ -69,4 +69,16 @@
                .filter(errorType -> errorType.getCategory() == category)
                .collect(Collectors.toList());
    }
    // 根据value获取desc
    public static String getDescriptionByValue(String value) {
        for (ErrorType errorType : ErrorType.values()) {
            if (errorType.getValue().equals(value)) {
                return errorType.getDesc();
            }
        }
        // 如果没有找到匹配的value,返回null或者抛出一个异常
        // 这里返回null
        return null;
    }
}