package com.cf.imes.module.executor.enums;

/**
 * 板材开门类型枚举
 *
 * @author Gqr
 * @since 2024/7/29 9:58
 */
public enum OrderPlateOpenDoorTypeEnum {
    NO(0, "无"),
    LEFT(1, "左"),
    RIGHT(2, "右"),
    UP(3, "上"),
    DOWN(4, "下");

    private final int code;
    private final String desc;

    OrderPlateOpenDoorTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescFromCode(int code) {
        for (OrderPlateOpenDoorTypeEnum orderPlateOpenDoorTypeEnum : OrderPlateOpenDoorTypeEnum.values()) {
            if (orderPlateOpenDoorTypeEnum.getCode() == code) {
                return orderPlateOpenDoorTypeEnum.getDesc();
            }
        }
        return null;
    }
}
