【代码评审】IOT:产品的管理

This commit is contained in:
YunaiV
2024-09-07 20:37:13 +08:00
parent c7b1cc9a43
commit 10334f3fb6
28 changed files with 135 additions and 281 deletions

View File

@ -1,4 +1,6 @@
/**
* iot API 包,定义暴露给其它模块的 API
* 占位
*
* TODO 芋艿:后续删除
*/
package cn.iocoder.yudao.module.iot.api;

View File

@ -8,7 +8,9 @@ import java.util.Arrays;
/**
* 产品数据格式枚举类
* 数据格式, 0: 标准数据格式JSON, 1: 透传/自定义
*
* @author ahh
* @see <a href="https://help.aliyun.com/zh/iot/user-guide/message-parsing">阿里云 - 什么是消息解析</a>
*/
@AllArgsConstructor
@Getter
@ -17,18 +19,17 @@ public enum IotDataFormatEnum implements IntArrayValuable {
JSON(0, "标准数据格式JSON"),
CUSTOMIZE(1, "透传/自定义");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotDataFormatEnum::getType).toArray();
/**
* 类型
*/
private final Integer type;
/**
* 描述
*/
private final String description;
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotDataFormatEnum::getType).toArray();
@Override
public int[] array() {
return ARRAYS;

View File

@ -8,7 +8,8 @@ import java.util.Arrays;
/**
* IOT 联网方式枚举类
* 联网方式, 0: Wi-Fi, 1: Cellular, 2: Ethernet, 3: 其他
*
* @author ahh
*/
@AllArgsConstructor
@Getter
@ -19,19 +20,17 @@ public enum IotNetTypeEnum implements IntArrayValuable {
ETHERNET(2, "Ethernet"),
OTHER(3, "其他");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotNetTypeEnum::getType).toArray();
/**
* 类型
*/
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;

View File

@ -7,8 +7,9 @@ import lombok.Getter;
import java.util.Arrays;
/**
* IOT 产品设备类型
* 设备类型, 0: 直连设备, 1: 网关子设备, 2: 网关设备
* IOT 产品设备类型
*
* @author ahh
*/
@AllArgsConstructor
@Getter

View File

@ -4,9 +4,12 @@ import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* IOT 产品状态枚举类
* 产品状态, 0: 开发中, 1: 已发布
* IOT 产品状态枚举类
*
* @author ahh
*/
@AllArgsConstructor
@Getter
@ -15,20 +18,20 @@ public enum IotProductStatusEnum implements IntArrayValuable {
UNPUBLISHED(0, "开发中"),
PUBLISHED(1, "已发布");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProductStatusEnum::getType).toArray();
/**
* 类型
*/
private final Integer type;
/**
* 描述
*/
private final String description;
public static final int[] ARRAYS = {1, 2};
@Override
public int[] array() {
return ARRAYS;
}
}

View File

@ -8,7 +8,8 @@ import java.util.Arrays;
/**
* IOT 接入网关协议枚举类
* 接入网关协议, 0: 自定义, 1: Modbus, 2: OPC UA, 3: ZigBee, 4: BLE
*
* @author ahh
*/
@AllArgsConstructor
@Getter
@ -20,19 +21,17 @@ public enum IotProtocolTypeEnum implements IntArrayValuable {
ZIGBEE(3, "ZigBee"),
BLE(4, "BLE");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProtocolTypeEnum::getType).toArray();
/**
* 类型
*/
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;

View File

@ -8,7 +8,8 @@ import java.util.Arrays;
/**
* IOT 数据校验级别枚举类
* 数据校验级别, 0: 弱校验, 1: 免校验
*
* @author ahh
*/
@AllArgsConstructor
@Getter
@ -17,19 +18,17 @@ public enum IotValidateTypeEnum implements IntArrayValuable {
WEAK(0, "弱校验"),
NONE(1, "免校验");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotValidateTypeEnum::getType).toArray();
/**
* 类型
*/
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;