Browse Source

移除bootstrap.yml中不注册到注册中心的配置

lixing 3 years ago
parent
commit
242726207a

+ 57 - 0
src/main/java/com/persagy/apm/alarmservice/common/enums/JmsTypeEnum.java

@@ -0,0 +1,57 @@
+package com.persagy.apm.alarmservice.common.enums;
+
+import com.persagy.apm.common.model.annotation.SwaggerDisplayEnum;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * 消息类型
+ *
+ * @author lixing
+ * @version V1.0 2021/9/13 10:01 上午
+ **/
+@SwaggerDisplayEnum
+@AllArgsConstructor
+public enum JmsTypeEnum {
+    /**
+     * 字典类型
+     */
+    NEW_CONDITION("new_condition", "新增报警条件"),
+    UPDATE_CONDITION("update_condition", "更新报警条件"),
+    DELETE_CONDITION("delete_condition", "删除报警条件"),
+    NEW_OBJ_CONDITION_REL("new_obj_condition_rel", "新增条件和设备的关联关系"),
+    DELETE_OBJ_CONDITION_REL("delete_obj_condition_rel", "删除条件和设备的关联关系");
+
+
+    @Setter
+    @Getter
+    private String type;
+    @Setter
+    @Getter
+    private String desc;
+
+    /**
+     * 根据type获取到枚举对象
+     *
+     * @param type 报告状态编码
+     * @return 报告状态枚举对象
+     * @author lixing
+     * @version V1.0 2021/5/31 4:06 下午
+     */
+    public static JmsTypeEnum getByType(String type) {
+        if (StringUtils.isBlank(type)) {
+            return null;
+        }
+        JmsTypeEnum[] enums = JmsTypeEnum.values();
+        for (JmsTypeEnum item : enums) {
+            if (type.equals(item.getType())) {
+                return item;
+            }
+        }
+        return null;
+    }
+}
+
+