【代码优化】IOT: ThingModel

This commit is contained in:
puhui999
2024-12-27 10:37:16 +08:00
parent fae17e9125
commit 8b7f329183
25 changed files with 308 additions and 315 deletions

View File

@@ -10,7 +10,7 @@ import lombok.Getter;
*/
@AllArgsConstructor
@Getter
public enum IotProductThingModelAccessModeEnum {
public enum IotThingModelAccessModeEnum {
READ_ONLY("r"),
READ_WRITE("rw");

View File

@@ -10,7 +10,7 @@ import lombok.Getter;
*/
@AllArgsConstructor
@Getter
public enum IotProductThingModelParamDirectionEnum {
public enum IotThingModelParamDirectionEnum {
INPUT("input"), // 输入参数
OUTPUT("output"); // 输出参数

View File

@@ -10,7 +10,7 @@ import lombok.Getter;
*/
@AllArgsConstructor
@Getter
public enum IotProductThingModelServiceCallTypeEnum {
public enum IotThingModelServiceCallTypeEnum {
ASYNC("async"), // 异步调用
SYNC("sync"); // 同步调用

View File

@@ -10,7 +10,7 @@ import lombok.Getter;
*/
@AllArgsConstructor
@Getter
public enum IotProductThingModelServiceEventTypeEnum {
public enum IotThingModelServiceEventTypeEnum {
INFO("info"), // 信息
ALERT("alert"), // 告警

View File

@@ -13,13 +13,13 @@ import java.util.Arrays;
*/
@AllArgsConstructor
@Getter
public enum IotProductThingModelTypeEnum implements IntArrayValuable {
public enum IotThingModelTypeEnum implements IntArrayValuable {
PROPERTY(1, "属性"),
SERVICE(2, "服务"),
EVENT(3, "事件");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProductThingModelTypeEnum::getType).toArray();
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotThingModelTypeEnum::getType).toArray();
/**
* 类型
@@ -30,8 +30,8 @@ public enum IotProductThingModelTypeEnum implements IntArrayValuable {
*/
private final String description;
public static IotProductThingModelTypeEnum valueOfType(Integer type) {
for (IotProductThingModelTypeEnum value : values()) {
public static IotThingModelTypeEnum valueOfType(Integer type) {
for (IotThingModelTypeEnum value : values()) {
if (value.getType().equals(type)) {
return value;
}