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 NetTriggerModeEnum {
    DEVICE_ONLINE(1, "设备上线","deviceStatus"),
    DEVICE_OFFLINE(2, "设备离线","deviceStatus"),
    PROPERTIES(3, "属性上报","property"),
    EVENT(4, "事件上报","event"),
//    DEVICE_FAULT(5, "设备故障"),
//    BUSINESS_NOTICE(6, "业务提醒"),

    ;

    private Integer value;
    private String desc;
    private String triggerMode;

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