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

    MILEAGE("1", "里程上报"),
    POSITION("2", "位置校准"),
    ;

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

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

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

}
