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 NetGroupingTypeEnum {
    OPERATE_DEVICE(1, "运营端设备分组"),
    CLIENT_DEVICE(2, "客户端设备分组"),

    ;

    private Integer value;
    private String desc;

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