package com.yuchen.saas.device.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.nest.springwrap.core.log.exception.ServiceException;

@Getter
@AllArgsConstructor
public enum NetAlarmRecordStatusEnum {
    PENDING(1, "待处理"),
    CLOSE(2, "已关闭"),
    DISPATCHED(3, "已派工"),

    ;

    private Integer value;
    private String desc;

    public static NetAlarmRecordStatusEnum convert(int intValue) {
        NetAlarmRecordStatusEnum[] allValues = NetAlarmRecordStatusEnum.values();
        for (NetAlarmRecordStatusEnum allValue : allValues) {
            if (allValue.value == intValue) {
                return allValue;
            }
        }
        throw new ServiceException("NetAlarmRecordStatusEnum 非法枚举参数值");
    }
}
