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

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

import java.util.Map;

/**
 * 智能调度类型枚举
 * @author hongbo.pan
 * @date 2023/8/23
 */
@AllArgsConstructor
@Getter
public enum IntelligentDispatchTypeEnum {

    VEHICLE_TYPE("truckType", "按车型调度"),
    VEHICLE("truck", "按车辆调度"),
    ;

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

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

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

}
