【功能优化】IoT:同步最新代码

This commit is contained in:
YunaiV 2025-01-28 03:58:24 +08:00
parent 8236154ae8
commit eb2d4fdbc0
4 changed files with 13 additions and 13 deletions

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.iot.enums.plugin; package cn.iocoder.yudao.module.iot.enums.plugin;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.Getter; import lombok.Getter;
import java.util.Arrays; import java.util.Arrays;
@ -11,12 +11,12 @@ import java.util.Arrays;
* @author haohao * @author haohao
*/ */
@Getter @Getter
public enum IotPluginDeployTypeEnum implements IntArrayValuable { public enum IotPluginDeployTypeEnum implements ArrayValuable<Integer> {
JAR(0, "JAR 部署"), JAR(0, "JAR 部署"),
STANDALONE(1, "独立部署"); STANDALONE(1, "独立部署");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotPluginDeployTypeEnum::getDeployType).toArray(); public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotPluginDeployTypeEnum::getDeployType).toArray(Integer[]::new);
/** /**
* 部署方式 * 部署方式
@ -45,7 +45,7 @@ public enum IotPluginDeployTypeEnum implements IntArrayValuable {
} }
@Override @Override
public int[] array() { public Integer[] array() {
return ARRAYS; return ARRAYS;
} }

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.iot.enums.plugin; package cn.iocoder.yudao.module.iot.enums.plugin;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.Getter; import lombok.Getter;
import java.util.Arrays; import java.util.Arrays;
@ -11,12 +11,12 @@ import java.util.Arrays;
* @author haohao * @author haohao
*/ */
@Getter @Getter
public enum IotPluginStatusEnum implements IntArrayValuable { public enum IotPluginStatusEnum implements ArrayValuable<Integer> {
STOPPED(0, "停止"), STOPPED(0, "停止"),
RUNNING(1, "运行"); RUNNING(1, "运行");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotPluginStatusEnum::getStatus).toArray(); public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotPluginStatusEnum::getStatus).toArray(Integer[]::new);
/** /**
* 状态 * 状态
@ -41,7 +41,7 @@ public enum IotPluginStatusEnum implements IntArrayValuable {
} }
@Override @Override
public int[] array() { public Integer[] array() {
return ARRAYS; return ARRAYS;
} }

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.iot.enums.plugin; package cn.iocoder.yudao.module.iot.enums.plugin;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable; import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@ -13,12 +13,12 @@ import java.util.Arrays;
*/ */
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
public enum IotPluginTypeEnum implements IntArrayValuable { public enum IotPluginTypeEnum implements ArrayValuable<Integer> {
NORMAL(0, "普通插件"), NORMAL(0, "普通插件"),
DEVICE(1, "设备插件"); DEVICE(1, "设备插件");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotPluginTypeEnum::getType).toArray(); public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotPluginTypeEnum::getType).toArray(Integer[]::new);
/** /**
* 类型 * 类型
@ -31,7 +31,7 @@ public enum IotPluginTypeEnum implements IntArrayValuable {
private final String name; private final String name;
@Override @Override
public int[] array() { public Integer[] array() {
return ARRAYS; return ARRAYS;
} }

View File

@ -18,7 +18,7 @@ public enum IotProductStatusEnum implements ArrayValuable<Integer> {
UNPUBLISHED(0, "开发中"), UNPUBLISHED(0, "开发中"),
PUBLISHED(1, "已发布"); PUBLISHED(1, "已发布");
public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotProductStatusEnum::getType).toArray(Integer[]::new); public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotProductStatusEnum::getStatus).toArray(Integer[]::new);
/** /**
* 类型 * 类型