package cn.iocoder.yudao.module.mes.controller.admin.dvrepair.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 维修结果状态枚举
 */
@Getter
@AllArgsConstructor
public enum RepairResultEnum {
    PENDING(0, "待维修"),
    PASS(1, "OK"),
    FAIL(2, "NG");

    private final Integer code;
    private final String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescByCode(Integer code) {
        if (code == null) {
            return "";
        }
        for (RepairResultEnum value : values()) {
            if (value.code.equals(code)) {
                return value.desc;
            }
        }
        return "未知";
    }
}
