package com.gyee.alarm.model.vo;

public enum AlarmType {

    FJBJ("alertrule_category", "风机部件"),
    GFBJ("alertrule_category_GF", "光伏部件"),
    YJ("early_category", "预警"),
    SD("userset", "用户设定");

    private String code;
    private String name;

    AlarmType(String code) {
        this.code = code;
    }

    AlarmType(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 根据code获取message
     *
     * @param code
     * @return
     */
    public static String getNmaeByCode(String code) {
        for (AlarmType ele : values()) {
            if (ele.getCode().equals(code)) {
                return ele.getName();
            }
        }
        return null;
    }


}
