【代码优化】IoT: 数据桥梁 config 优化
This commit is contained in:
@@ -15,5 +15,8 @@ public class DictTypeConstants {
|
||||
public static final String VALIDATE_TYPE = "iot_validate_type";
|
||||
|
||||
public static final String DEVICE_STATE = "iot_device_state";
|
||||
public static final String IOT_DATA_BRIDGE_DIRECTION_ENUM = "iot_data_bridge_direction_enum";
|
||||
public static final String IOT_DATA_BRIDGE_TYPE_ENUM = "iot_data_bridge_type_enum";
|
||||
|
||||
|
||||
}
|
||||
|
@@ -13,14 +13,14 @@ import java.util.Arrays;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum IotDataBridgDirectionEnum implements ArrayValuable<Integer> {
|
||||
public enum IotDataBridgeDirectionEnum 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);
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDataBridgeDirectionEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
@@ -13,25 +13,26 @@ import java.util.Arrays;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum IotDataBridgTypeEnum implements ArrayValuable<Integer> {
|
||||
public enum IotDataBridgeTypeEnum implements ArrayValuable<Integer> {
|
||||
|
||||
HTTP(1),
|
||||
TCP(2),
|
||||
WEBSOCKET(3),
|
||||
HTTP(1, "HTTP"),
|
||||
TCP(2, "TCP"),
|
||||
WEBSOCKET(3, "WEBSOCKET"),
|
||||
|
||||
MQTT(10),
|
||||
MQTT(10, "MQTT"),
|
||||
|
||||
DATABASE(20),
|
||||
REDIS_STREAM(21),
|
||||
DATABASE(20, "DATABASE"),
|
||||
REDIS_STREAM(21, "REDIS_STREAM"),
|
||||
|
||||
ROCKETMQ(30),
|
||||
RABBITMQ(31),
|
||||
KAFKA(32)
|
||||
;
|
||||
ROCKETMQ(30, "ROCKETMQ"),
|
||||
RABBITMQ(31, "RABBITMQ"),
|
||||
KAFKA(32, "KAFKA");
|
||||
|
||||
private final Integer type;
|
||||
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDataBridgTypeEnum::getType).toArray(Integer[]::new);
|
||||
private final String name;
|
||||
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDataBridgeTypeEnum::getType).toArray(Integer[]::new);
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
Reference in New Issue
Block a user