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

    WEB("1", "web消息", "webChannel"),
    WECHAT("2", "微信公众号", ""),
    EMAIL("3", "邮件", ""),
    MESSAGE("4", "短信消息", ""),
    QW("5", "企业微信", "qwChannel"),
    DINGDING("6", "钉钉消息", ""),

    ;
    public static final String MESSAGE_SEND_TYPE = "MESSAGE_SEND_TYPE";
    private static Map<String, MessageConfigSendTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;
    private String channel;

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

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

}
