修改:IOT 物模型接口优化

This commit is contained in:
安浩浩
2024-09-15 20:09:18 +08:00
parent 84bc5aec1e
commit 2932314ee0
12 changed files with 409 additions and 578 deletions

View File

@ -17,4 +17,5 @@ public interface ErrorCodeConstants {
// ========== IoT 产品物模型 1-050-002-000 ============
ErrorCode THINK_MODEL_FUNCTION_NOT_EXISTS = new ErrorCode(1_050_002_000, "产品物模型不存在");
ErrorCode THINK_MODEL_FUNCTION_EXISTS_BY_PRODUCT_KEY = new ErrorCode(1_050_002_001, "ProductKey 对应的产品物模型已存在");
ErrorCode THINK_MODEL_FUNCTION_EXISTS_BY_IDENTIFIER = new ErrorCode(1_050_002_002, "产品物模型标识已存在");
}

View File

@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.iot.enums.product;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* IOT 物模型功能类型枚举类
*
* @author ahh
*/
@AllArgsConstructor
@Getter
public enum IotThingModelTypeEnum implements IntArrayValuable {
/**
* 属性
*/
PROPERTY(1, "属性"),
/**
* 服务
*/
SERVICE(2, "服务"),
/**
* 事件
*/
EVENT(3, "事件");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotThingModelTypeEnum::getType).toArray();
/**
* 类型
*/
private final Integer type;
/**
* 描述
*/
private final String description;
@Override
public int[] array() {
return ARRAYS;
}
}