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 MessageConfigStatusEnum {

    DISABLE("0", "停用"),
    ENABLE("1", "启用"),
    ;
    public static final String MESSAGE_CONFIG_STATUS = "MESSAGE_CONFIG_STATUS";
    private static Map<String, MessageConfigStatusEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

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

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

}
