yeg
2026-09-05 07d3e4aa6478fe61edb271d80cbc61d037e6f409
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
package com.ruoyi.system.service;
 
import java.util.List;
import com.ruoyi.system.domain.TDetectionChannel;
import com.ruoyi.system.domain.TDeviceAdapter;
import com.ruoyi.system.domain.vo.AdapterDiscoveryResult;
 
public interface IDeviceAdapterService
{
    /** 按管理端筛选条件查询设备适配器实例。 */
    List<TDeviceAdapter> selectList(TDeviceAdapter query);
 
    /** 查询设备适配器详情;实例不存在时返回稳定业务错误。 */
    TDeviceAdapter selectById(Long adapterId);
 
    /** 幂等注册并启用由应用装配层托管的适配器配置。 */
    TDeviceAdapter ensureManagedAdapter(TDeviceAdapter adapter);
 
    /** 新增默认禁用的只读设备适配器配置。 */
    int insert(TDeviceAdapter adapter);
 
    /** 更新设备适配器配置,并同步已启用的运行时实例。 */
    int update(TDeviceAdapter adapter);
 
    /** 启用或停用设备适配器,并同步运行时生命周期。 */
    int changeStatus(Long adapterId, boolean enabled, String updateBy);
 
    /** 执行一次发现和实时观测,并将本轮设备事实写入 Redis 候选。 */
    AdapterDiscoveryResult discover(Long adapterId);
 
    /** 查询指定适配器当前未过期的发现通道。 */
    List<TDetectionChannel> selectChannels(Long adapterId);
 
    /** 启动时恢复所有已启用适配器的运行时实例。 */
    void synchronizeEnabledAdapters();
 
    /** 对达到轮询周期的已启用适配器执行发现。 */
    void pollDueAdapters();
}