【代码评审】IOT:物模型

This commit is contained in:
YunaiV 2024-09-14 22:39:14 +08:00
parent 07b3ac20f6
commit 84bc5aec1e
4 changed files with 121 additions and 5 deletions

View File

@ -7,8 +7,19 @@ import java.util.List;
@Data @Data
public class ThingModelEvent { public class ThingModelEvent {
/**
* 事件标识符
*/
private String identifier; private String identifier;
/**
* 事件名称
*/
private String name; private String name;
/**
* 事件描述
*/
private String description;
/** /**
* 事件类型 * 事件类型
* *
@ -16,7 +27,6 @@ public class ThingModelEvent {
*/ */
private String type; private String type;
private List<ThingModelArgument> outputData; private List<ThingModelArgument> outputData;
private String description;
private String method; private String method;
} }

View File

@ -6,11 +6,22 @@ import lombok.Data;
@Data @Data
public class ThingModelProperty { public class ThingModelProperty {
/**
* 属性标识符
*/
private String identifier; private String identifier;
/**
* 属性名称
*/
private String name; private String name;
private String accessMode; // "rw""r""w" /**
private Boolean required; * 属性描述
private ThingModelDataType dataType; */
private String description; private String description;
private String accessMode; // "rw""r""w"
private Boolean required;
// TODO @haohao这个是不是 dataSpecs dataSpecsListhttps://help.aliyun.com/zh/iot/developer-reference/api-a99t11
private ThingModelDataType dataType;
} }

View File

@ -7,8 +7,19 @@ import java.util.List;
@Data @Data
public class ThingModelService { public class ThingModelService {
/**
* 服务标识符
*/
private String identifier; private String identifier;
/**
* 服务名称
*/
private String name; private String name;
/**
* 服务描述
*/
private String description;
/** /**
* 调用类型 * 调用类型
* *
@ -17,7 +28,6 @@ public class ThingModelService {
private String callType; private String callType;
private List<ThingModelArgument> inputData; private List<ThingModelArgument> inputData;
private List<ThingModelArgument> outputData; private List<ThingModelArgument> outputData;
private String description;
private String method; private String method;
} }

View File

@ -0,0 +1,85 @@
package cn.iocoder.yudao.module.iot.dal.dataobject.thinkmodelfunction;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.iot.controller.admin.thinkmodelfunction.thingModel.ThingModelEvent;
import cn.iocoder.yudao.module.iot.controller.admin.thinkmodelfunction.thingModel.ThingModelProperty;
import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* IoT 产品物模型功能 DO
*
* 每个 {@link IotProductDO} {@link IotThinkModelFunctionDO2} 一对多的关系它的每个属性事件服务都对应一条记录
*
* @author 芋道源码
*/
@TableName("iot_think_model_function")
@KeySequence("iot_think_model_function_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class IotThinkModelFunctionDO2 extends BaseDO {
/**
* 物模型功能编号
*/
@TableId
private Long id;
/**
* 功能标识
*/
private String identifier;
/**
* 功能名称
*/
private String name;
/**
* 功能描述
*/
private String description;
/**
* 产品标识
*
* 关联 {@link IotProductDO#getId()}
*/
private Long productId;
/**
* 产品标识
*
* 关联 {@link IotProductDO#getProductKey()}
*/
private String productKey;
/**
* 功能类型
*
* 1 - 属性
* 2 - 服务
* 3 - 事件
*/
// TODO @haohao枚举
private Integer type;
/**
* 属性
*/
private ThingModelProperty property;
/**
* 事件
*/
private ThingModelEvent event;
/**
* 服务
*/
private String service;
}