package com.sckw.core.model.enums;

/**
 * @author lfdc
 * @description 设备状态
 * @date 2023-11-01 10:07:23
 */
public enum DeviceEnum {

    /**
     * 识别失败
     */
    RECOGNITION_FAILURE(0, "0", "识别失败"),
    /**
     * 识别中
     */
    IDENTIFYING(1, "1", "识别中"),
    /**
     * 未使用
     */
    NOT_IN_USE(2, "2", "未使用"),

    /**
     * 校验中
     */
    BE_CHECKING(3, "3", "校验中"),

    /**
     * 已基准
     */
    ALREADY_REFERRED_TO(4, "4", "已基准"),
    ;

    public Integer getCode() {
        return code;
    }

    public String getStatus() {
        return status;
    }

    public String getDestination() {
        return destination;
    }

    private final Integer code;
    private final String status;
    private final String destination;

    DeviceEnum(Integer code, String status, String destination) {
        this.code = code;
        this.status = status;
        this.destination = destination;
    }
    public static String getName(Integer code) {
        for (DeviceEnum deviceEnum : DeviceEnum.values()) {
            if (deviceEnum.getCode().equals(code)) {
                return deviceEnum.getDestination();
            }
        }
        return null;
    }
}
