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

    OPEN_SHIP_EVENT("1", "开启启运事件反馈"),
    CLOSE_SHIP_EVENT("2", "关闭启运事件反馈"),
    OPEN_DELIVERY_EVENT("3", "开启送达事件反馈"),
    CLOSE_DELIVERY_EVENT("4", "关闭送达事件反馈"),
    ;

    public static final String ENUM_NAME = "EVENT_FEEDBACK_MODE";
    private static Map<String, EventFeedbackModeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

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

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

}
