From cfcfbf068acf9b9d509a99498346dcbcf101cdf9 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 14 十一月 2024 16:37:46 +0800 Subject: [PATCH] 白名单基础增删改查 --- ycl-common/src/main/java/enumeration/ErrorType.java | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/ycl-common/src/main/java/enumeration/ErrorType.java b/ycl-common/src/main/java/enumeration/ErrorType.java index 43630c1..c8d83da 100644 --- a/ycl-common/src/main/java/enumeration/ErrorType.java +++ b/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(); + } + } + // 濡傛灉娌℃湁鎵惧埌鍖归厤鐨剉alue锛岃繑鍥瀗ull鎴栬�呮姏鍑轰竴涓紓甯� + // 杩欓噷杩斿洖null + return null; + } } -- Gitblit v1.8.0