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

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

import java.util.Map;

/**
 * 事件类型枚举
 * @author hongbo.pan
 * @date 2023/1/17
 */
@AllArgsConstructor
@Getter
public enum EventTypeEnum {

    SHIP("S", "启运事件"),
    DELIVERY("D", "送达事件"),
    ;

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

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

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

}
