package com.prolog.rdc.tms.app.constant.enums;

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

import java.util.Map;

/**
 * 语音播报业务类型枚举
 * @author hongbo.pan
 * @date 2023/1/12
 */
@AllArgsConstructor
@Getter
public enum VoiceBusinessTypeEnum {

    SHIP("S", "启运播报"),
    DELIVERY("D", "送达播报"),
    ;

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

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

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

}
