package com.prolog.rdc.tms.model.enums;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * 通知类型枚举
 * @author hongbo.pan
 * @date 2022/11/16
 */
@AllArgsConstructor
@Getter
public enum MessageNoticeTypeEnum {

    BUSINESS("B", "业务消息"),
    ALARM("A", "预警消息"),
    ;

    private static Map<String, MessageNoticeTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

    static {
        for(MessageNoticeTypeEnum as : MessageNoticeTypeEnum.values()) {
            enumMap.put(as.code, as);
        }
    }

    public static MessageNoticeTypeEnum getByCode(String code) {
        return  enumMap.get(code);
    }

}
