mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-17 20:45:06 +08:00
修改:新增产品枚举
This commit is contained in:
@ -1,13 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.enums;
|
||||
|
||||
/**
|
||||
* 产品设备类型常量
|
||||
*/
|
||||
public interface ProductDeviceTypeConstants {
|
||||
|
||||
// ========== 产品设备类型 ============
|
||||
String DEVICE = "device"; // 直连设备
|
||||
String GATEWAY = "gateway"; // 网关设备
|
||||
String GATEWAY_SUB = "gateway_sub"; // 网关子设备
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package cn.iocoder.yudao.module.iot.enums;
|
||||
|
||||
/**
|
||||
* 产品传输协议类型常量
|
||||
*/
|
||||
public interface ProductProtocolTypeConstants {
|
||||
|
||||
// ========== 产品传输协议类型 ============
|
||||
String MQTT = "mqtt"; // MQTT
|
||||
String COAP = "coap"; // COAP
|
||||
String HTTP = "http"; // HTTP
|
||||
String HTTPS = "https"; // HTTPS
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.iot.enums;
|
||||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -8,14 +8,14 @@ import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 产品数据格式枚举类
|
||||
* 1. 标准数据格式(JSON)2. 透传/自定义
|
||||
* 数据格式, 0: 标准数据格式(JSON), 1: 透传/自定义
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ProductDataFormatEnum implements IntArrayValuable {
|
||||
public enum IotDataFormatEnum implements IntArrayValuable {
|
||||
|
||||
JSON(1, "标准数据格式(JSON)"),
|
||||
SCRIPT(2, "透传/自定义");
|
||||
JSON(0, "标准数据格式(JSON)"),
|
||||
CUSTOMIZE(1, "透传/自定义");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
@ -27,7 +27,7 @@ public enum ProductDataFormatEnum implements IntArrayValuable {
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductDataFormatEnum::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotDataFormatEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 联网方式枚举类
|
||||
* 联网方式, 0: Wi-Fi, 1: Cellular, 2: Ethernet, 3: 其他
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotNetTypeEnum implements IntArrayValuable {
|
||||
|
||||
WIFI(0, "Wi-Fi"),
|
||||
CELLULAR(1, "Cellular"),
|
||||
ETHERNET(2, "Ethernet"),
|
||||
OTHER(3, "其他");
|
||||
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotNetTypeEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品设备类型
|
||||
* 设备类型, 0: 直连设备, 1: 网关子设备, 2: 网关设备
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProductDeviceTypeEnum implements IntArrayValuable {
|
||||
|
||||
DIRECT(0, "直连设备"),
|
||||
GATEWAY_CHILD(1, "网关子设备"),
|
||||
GATEWAY(2, "网关设备");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProductDeviceTypeEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +1,19 @@
|
||||
package cn.iocoder.yudao.module.iot.enums;
|
||||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 产品状态枚举类
|
||||
* 禁用 启用
|
||||
* IOT 产品状态枚举类
|
||||
* 产品状态, 0: 未发布, 1: 已发布
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ProductStatusEnum implements IntArrayValuable {
|
||||
public enum IotProductStatusEnum implements IntArrayValuable {
|
||||
|
||||
DISABLE(0, "禁用"),
|
||||
ENABLE(1, "启用");
|
||||
UNPUBLISHED(0, "未发布"),
|
||||
PUBLISHED(1, "已发布");
|
||||
|
||||
/**
|
||||
* 类型
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 接入网关协议枚举类
|
||||
* 接入网关协议, 0: 自定义, 1: Modbus, 2: OPC UA, 3: ZigBee, 4: BLE
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProtocolTypeEnum implements IntArrayValuable {
|
||||
|
||||
CUSTOM(0, "自定义"),
|
||||
MODBUS(1, "Modbus"),
|
||||
OPC_UA(2, "OPC UA"),
|
||||
ZIGBEE(3, "ZigBee"),
|
||||
BLE(4, "BLE");
|
||||
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProtocolTypeEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.iot.enums.product;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 数据校验级别枚举类
|
||||
* 数据校验级别, 0: 弱校验, 1: 免校验
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotValidateTypeEnum implements IntArrayValuable {
|
||||
|
||||
WEAK(0, "弱校验"),
|
||||
NONE(1, "免校验");
|
||||
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotValidateTypeEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user