package org.springblade.modules.business.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 设备状态编码
 */

@Getter
@AllArgsConstructor
public enum FacilityFaultStatusEnum {

    FAULT("fault", "故障"),
    OFF_LINE("offLine", "离线"),
    ON_LINE("onLine", "在线");

    /**
     * 编码
     */
    private String code;

    /**
     * 描述
     */
    private String desc;

    public static String getDesc(String code) {
        for (FacilityFaultStatusEnum facilityFaultStatusEnum : FacilityFaultStatusEnum.values()) {
            if (facilityFaultStatusEnum.getCode().equals(code)) {
                return facilityFaultStatusEnum.getDesc();
            }
        }
        return "";
    }

}
