package com.sckw.fleet.model.enums;

import lombok.Getter;

/**
 * @author zk
 * @desc 车辆类型
 * @date 2024/3/8 0008
 */
@Getter
public enum TruckTypeEnum {
    /**
     * 货车
     */
    TRUCK(1, "货车"),

    /**
     * 牵引车
     */
    TRACTOR(2, "牵引车")

    ;


    private final Integer code;
    private final String name;

    TruckTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(Integer code) {
        for (TruckTypeEnum entity : TruckTypeEnum.values()) {
            if (entity.getCode().equals(code)) {
                return entity.getName();
            }
        }
        return null;
    }
}
