【代码优化】IoT:增加 IotDataBridgeDO 数据桥梁的定义

This commit is contained in:
YunaiV
2025-02-03 13:25:47 +08:00
parent 48cfcdadc1
commit 5e71d1fc85
4 changed files with 244 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.iot.enums.rule;
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import java.util.Arrays;
/**
* Iot 数据桥接的方向枚举
*
* @author 芋道源码
*/
@RequiredArgsConstructor
@Getter
public enum IotDataBridgDirectionEnum implements ArrayValuable<Integer> {
INPUT(1), // 输入
OUTPUT(2); // 输出
private final Integer type;
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDataBridgDirectionEnum::getType).toArray(Integer[]::new);
@Override
public Integer[] array() {
return ARRAYS;
}
}

View File

@@ -0,0 +1,41 @@
package cn.iocoder.yudao.module.iot.enums.rule;
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import java.util.Arrays;
/**
* Iot 数据桥接的类型枚举
*
* @author 芋道源码
*/
@RequiredArgsConstructor
@Getter
public enum IotDataBridgTypeEnum implements ArrayValuable<Integer> {
HTTP(1),
TCP(2),
WEBSOCKET(3),
MQTT(10),
DATABASE(20),
REDIS(21),
ROCKETMQ(30),
RABBITMQ(31),
KAFKA(32)
;
private final Integer type;
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDataBridgTypeEnum::getType).toArray(Integer[]::new);
@Override
public Integer[] array() {
return ARRAYS;
}
}