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/10/8
 */
@AllArgsConstructor
@Getter
public enum InTransitPositionTypeEnum {

    WECHAT("wechat", "小程序轨迹"),
    DEVICE("device", "设备轨迹"),

    DEVICE_LINK("deviceLink", "设备直连"),
    ;

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

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

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

}
