From e403747d53db86c9de3986e9b281d35279446567 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期四, 26 六月 2025 13:54:39 +0800
Subject: [PATCH] art: 枚举代码优化

---
 src/main/java/org/jeecg/common/system/query/MatchTypeEnum.java |   15 +++------------
 src/main/java/org/jeecg/common/system/query/QueryRuleEnum.java |   26 ++------------------------
 2 files changed, 5 insertions(+), 36 deletions(-)

diff --git a/src/main/java/org/jeecg/common/system/query/MatchTypeEnum.java b/src/main/java/org/jeecg/common/system/query/MatchTypeEnum.java
index d19342d..6ec9a46 100644
--- a/src/main/java/org/jeecg/common/system/query/MatchTypeEnum.java
+++ b/src/main/java/org/jeecg/common/system/query/MatchTypeEnum.java
@@ -1,5 +1,6 @@
 package org.jeecg.common.system.query;
 
+import lombok.Getter;
 import org.jeecg.common.util.oConvertUtils;
 
 /**
@@ -7,6 +8,7 @@
  *
  * @Author Sunjianlei
  */
+@Getter
 public enum MatchTypeEnum {
 
     /**鏌ヨ閾炬帴瑙勫垯 AND*/
@@ -20,23 +22,12 @@
         this.value = value;
     }
 
-    public String getValue() {
-        return value;
-    }
-
-    public static MatchTypeEnum getByValue(Object value) {
-        if (oConvertUtils.isEmpty(value)) {
-            return null;
-        }
-        return getByValue(value.toString());
-    }
-
     public static MatchTypeEnum getByValue(String value) {
         if (oConvertUtils.isEmpty(value)) {
             return null;
         }
         for (MatchTypeEnum val : values()) {
-            if (val.getValue().toLowerCase().equals(value.toLowerCase())) {
+            if (val.getValue().equalsIgnoreCase(value)) {
                 return val;
             }
         }
diff --git a/src/main/java/org/jeecg/common/system/query/QueryRuleEnum.java b/src/main/java/org/jeecg/common/system/query/QueryRuleEnum.java
index c31bf2b..9fdf54e 100644
--- a/src/main/java/org/jeecg/common/system/query/QueryRuleEnum.java
+++ b/src/main/java/org/jeecg/common/system/query/QueryRuleEnum.java
@@ -1,5 +1,6 @@
 package org.jeecg.common.system.query;
 
+import lombok.Getter;
 import org.jeecg.common.util.oConvertUtils;
 
 /**
@@ -7,6 +8,7 @@
  * @Author Scott
  * @Date 2019骞�02鏈�14鏃�
  */
+@Getter
 public enum QueryRuleEnum {
 
     /**鏌ヨ瑙勫垯 澶т簬*/
@@ -47,30 +49,6 @@
         this.condition = condition;
         this.msg = msg;
     }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public String getMsg() {
-        return msg;
-    }
-
-    public void setMsg(String msg) {
-        this.msg = msg;
-    }
-
-    public String getCondition() {
-		return condition;
-	}
-
-	public void setCondition(String condition) {
-		this.condition = condition;
-	}
 
 	public static QueryRuleEnum getByValue(String value){
     	if(oConvertUtils.isEmpty(value)) {

--
Gitblit v1.9.3