From 206f601b1f2a2e3cb0bf4f5dead01bec9077d8e9 Mon Sep 17 00:00:00 2001
From: 彭雪彬 <1724387007@qq.com>
Date: Thu, 04 Sep 2025 15:28:52 +0800
Subject: [PATCH] Merge branch 'xin' into pxb

---
 oying-system/src/main/java/com/oying/modules/message/common/MesTypeEnum.java |   65 ++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/oying-system/src/main/java/com/oying/modules/message/common/MesTypeEnum.java b/oying-system/src/main/java/com/oying/modules/message/common/MesTypeEnum.java
new file mode 100644
index 0000000..04328c5
--- /dev/null
+++ b/oying-system/src/main/java/com/oying/modules/message/common/MesTypeEnum.java
@@ -0,0 +1,65 @@
+package com.oying.modules.message.common;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum MesTypeEnum {
+    //1=系统 2=订单 3=评价/留言 4=骑手 5=商户 6=买家
+    //2=订单 订单包含 4 5 6
+    SYSTEM(1, "系统"),
+    ORDER(2, "订单"),
+    COMMENT(3, "评价/留言"),
+    RIDER(4, "骑手"),     // 补充骑手类型
+    MERCHANT(5, "商户"),  // 补充商户类型
+    BUYER(6, "买家");     // 补充买家类型
+
+    private final Integer key;
+    private final String value;
+
+    /**
+     * 根据key获取枚举实例
+     *
+     * @param key key值
+     * @return 对应的枚举实例,未找到返回null
+     */
+    public static MesTypeEnum getByKey(Integer key) {
+        if (key == null) {
+            return null;
+        }
+        for (MesTypeEnum typeEnum : MesTypeEnum.values()) {
+            if (typeEnum.key.equals(key)) {
+                return typeEnum;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 根据value获取枚举实例
+     *
+     * @param value value值
+     * @return 对应的枚举实例,未找到返回null
+     */
+    public static MesTypeEnum getByValue(String value) {
+        if (value == null) {
+            return null;
+        }
+        for (MesTypeEnum typeEnum : MesTypeEnum.values()) {
+            if (typeEnum.value.equals(value)) {
+                return typeEnum;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public String toString() {
+        return "MesTypeEnum{" +
+                "key=" + key +
+                ", value='" + value + '\'' +
+                ", name='" + this.name() + '\'' +
+                '}';
+    }
+}

--
Gitblit v1.9.3