2026-06-30 24681c81c09022f584a57006f2534b5f74723414
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package cn.iocoder.yudao.module.iot.service.thingmodel;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.iot.controller.admin.thingmodel.vo.IotThingModelListReqVO;
import cn.iocoder.yudao.module.iot.controller.admin.thingmodel.vo.IotThingModelPageReqVO;
import cn.iocoder.yudao.module.iot.controller.admin.thingmodel.vo.IotThingModelSaveReqVO;
import cn.iocoder.yudao.module.iot.dal.dataobject.thingmodel.IotThingModelDO;
import jakarta.validation.Valid;
 
import java.util.Collection;
import java.util.List;
import java.util.Set;
 
/**
 * IoT 产品物模型 Service 接口
 *
 * @author 芋道源码
 */
public interface IotThingModelService {
 
    /**
     * 创建产品物模型
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createThingModel(@Valid IotThingModelSaveReqVO createReqVO);
 
    /**
     * 更新产品物模型
     *
     * @param updateReqVO 更新信息
     */
    void updateThingModel(@Valid IotThingModelSaveReqVO updateReqVO);
 
    /**
     * 删除产品物模型
     *
     * @param id 编号
     */
    void deleteThingModel(Long id);
 
    /**
     * 获得产品物模型
     *
     * @param id 编号
     * @return 产品物模型
     */
    IotThingModelDO getThingModel(Long id);
 
    /**
     * 获得产品物模型列表
     *
     * @param productId 产品编号
     * @return 产品物模型列表
     */
    List<IotThingModelDO> getThingModelListByProductId(Long productId);
 
    /**
     * 获得产品物模型列表
     *
     * @param productId 产品编号
     * @param identifiers 功能标识列表
     * @return 产品物模型列表
     */
    List<IotThingModelDO> getThingModelListByProductIdAndIdentifiers(Long productId, Collection<String> identifiers);
 
    /**
     * 获得产品物模型列表
     *
     * @param productId 产品编号
     * @param type 物模型类型
     * @return 产品物模型列表
     */
    List<IotThingModelDO> getThingModelListByProductIdAndType(Long productId, Integer type);
 
    /**
     * 【缓存】获得产品物模型列表
     *
     * 注意:该方法会忽略租户信息,所以调用时,需要确认会不会有跨租户访问的风险!!!
     *
     * @param productId 产品编号
     * @return 产品物模型列表
     */
    List<IotThingModelDO> getThingModelListByProductIdFromCache(Long productId);
 
    /**
     * 获得产品物模型分页
     *
     * @param pageReqVO 分页查询
     * @return 产品物模型分页
     */
    PageResult<IotThingModelDO> getProductThingModelPage(IotThingModelPageReqVO pageReqVO);
 
    /**
     * 获得产品物模型列表
     *
     * @param reqVO 列表查询
     * @return 产品物模型列表
     */
    List<IotThingModelDO> getThingModelList(IotThingModelListReqVO reqVO);
 
    /**
     * 批量校验物模型存在
     *
     * @param productId 产品编号
     * @param identifiers 标识符集合
     */
    void validateThingModelListExists(Long productId, Set<String> identifiers);
 
    /**
     * 按物模型属性的数据类型转换设备上报值
     *
     * @param thingModel 物模型
     * @param value 设备上报值
     * @return 转换后的值;无法转换时返回 null
     */
    Object convertThingModelPropertyValue(IotThingModelDO thingModel, Object value);
 
}