|
@@ -1,5 +1,6 @@
|
|
|
package com.fjhx.enums;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import lombok.Getter;
|
|
|
|
|
|
import java.util.HashMap;
|
|
@@ -12,8 +13,16 @@ public enum SendEventEnum {
|
|
|
*/
|
|
|
MESSAGE_NEW("messageNew"),
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除邮件
|
|
|
+ */
|
|
|
+ MESSAGE_DELETED("messageDeleted"),
|
|
|
+
|
|
|
|
|
|
- ;
|
|
|
+ /**
|
|
|
+ * 未知事件
|
|
|
+ */
|
|
|
+ UNKNOWN_EVENT("unknownEvent");
|
|
|
|
|
|
private final String type;
|
|
|
|
|
@@ -33,7 +42,7 @@ public enum SendEventEnum {
|
|
|
* 根据type获取枚举
|
|
|
*/
|
|
|
public static SendEventEnum get(String type) {
|
|
|
- return map.get(type);
|
|
|
+ return ObjectUtil.defaultIfNull(map.get(type), UNKNOWN_EVENT);
|
|
|
}
|
|
|
|
|
|
}
|