package com.prolog.rdc.tms.config.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 MessageConfigNoticeToTypeEnum {

    ROLE("R", "角色"),
    USER("U", "用户"),
    ;
    private static Map<String, MessageConfigNoticeToTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

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

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

}
