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
package cn.iocoder.yudao.module.iot.service.device;
 
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.iot.controller.admin.device.vo.group.IotDeviceGroupPageReqVO;
import cn.iocoder.yudao.module.iot.controller.admin.device.vo.group.IotDeviceGroupSaveReqVO;
import cn.iocoder.yudao.module.iot.dal.dataobject.device.IotDeviceGroupDO;
import jakarta.validation.Valid;
 
import java.util.Collection;
import java.util.List;
 
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
 
/**
 * IoT 设备分组 Service 接口
 *
 * @author 芋道源码
 */
public interface IotDeviceGroupService {
 
    /**
     * 创建设备分组
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createDeviceGroup(@Valid IotDeviceGroupSaveReqVO createReqVO);
 
    /**
     * 更新设备分组
     *
     * @param updateReqVO 更新信息
     */
    void updateDeviceGroup(@Valid IotDeviceGroupSaveReqVO updateReqVO);
 
    /**
     * 删除设备分组
     *
     * @param id 编号
     */
    void deleteDeviceGroup(Long id);
 
    /**
     * 校验设备分组是否存在
     *
     * @param ids 设备分组 ID 数组
     */
    default List<IotDeviceGroupDO> validateDeviceGroupExists(Collection<Long> ids) {
        if (CollUtil.isEmpty(ids)) {
            return ListUtil.empty();
        }
        return convertList(ids, this::validateDeviceGroupExists);
    }
 
    /**
     * 校验设备分组是否存在
     *
     * @param id 设备分组 ID
     * @return 设备分组
     */
    IotDeviceGroupDO validateDeviceGroupExists(Long id);
 
    /**
     * 获得设备分组
     *
     * @param id 编号
     * @return 设备分组
     */
    IotDeviceGroupDO getDeviceGroup(Long id);
 
    /**
     * 获得设备分组
     *
     * @param name 名称
     * @return 设备分组
     */
    IotDeviceGroupDO getDeviceGroupByName(String name);
 
    /**
     * 获得设备分组分页
     *
     * @param pageReqVO 分页查询
     * @return 设备分组分页
     */
    PageResult<IotDeviceGroupDO> getDeviceGroupPage(IotDeviceGroupPageReqVO pageReqVO);
 
    /**
     * 获得设备分组列表
     *
     * @param status 状态
     * @return 设备分组列表
     */
    List<IotDeviceGroupDO> getDeviceGroupListByStatus(Integer status);
 
}