package com.cico.nest.lcdp.boot.core.qxsd.domain.vehicle;

import lombok.Getter;

/**
 * 车辆类型 枚举类
 * @author zws
 * @date 2024/8/5
 */
@Getter
public enum VehicleType {
    hazardous_chemicals(0, "危化品车"),
    passenger(1, "客车"),
    sedan(2, "轿车"),
    truck(3,"货车"),
    other_car(4,"未知");

    public final int type;

    public final String desc;

    VehicleType(Integer type, String desc){
        this.desc = desc;
        this.type = type;
    }

    public static VehicleType findByType(Integer type){
        for (VehicleType vehicleType : VehicleType.values()) {
            if (vehicleType.type == type){
                return vehicleType;
            }
        }
        return other_car;
    }

}
