mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 12:18:42 +08:00 
			
		
		
		
	【代码评审】IOT:物模型
This commit is contained in:
		@@ -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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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 和 dataSpecsList?https://help.aliyun.com/zh/iot/developer-reference/api-a99t11
 | 
				
			||||||
 | 
					    private ThingModelDataType dataType;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user