package com.sckw.transport.model.enuma;

import lombok.Getter;

/**
 * @author zk
 * @desc 装卸货类型
 * @date 2024/3/8 0008
 */
@Getter
public enum WeighbridgeTypeEnum {

    /**
     * 装货
     */
    LOADING(1, "装货"),

    /**
     * 卸货
     */
    UNLOADING(2, "卸货");


    private final Integer code;
    private final String name;

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

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