IAgentService.java 1.45 KB
package vion.service.monitor;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.github.yulichang.base.MPJBaseService;
import org.springframework.web.bind.annotation.RequestBody;
import vion.dto.AgentDTO;
import vion.dto.MqttAuthDTO;
import vion.model.monitor.*;
import vion.vo.AgentVO;

import java.util.List;

/**
 * @author vion
 * @date 2024/10/16
 */
public interface IAgentService extends MPJBaseService<Agent> {

    Page<AgentVO> list(AgentDTO dto);

    AgentVO getVOById(Long id);

    String update(AgentDTO dto);

    List<ServiceInfo> getServicesByUid(String uid);

    String saveServicesByUid(String uid, @RequestBody List<ServiceInfo> ServiceInfoList);

    String updateAgent2ServiceById(Long id, RAgentService rAgentService);

    String removeAgent2ServiceById(Long id);

    String assign(String uid, List<ServiceInfo> serviceInfoList);

    // region Agent 主动发送信息
    String reg(Agent agent);

    Upgrade getUpgradeInfo(Short type);

    String recAgentRecord(AgentRecord agentRecord);

    String recServiceInfo(List<ServiceRecord> recList);
    // endregion

    // region Mqtt Server 回调接口
    ObjectNode auth(MqttAuthDTO dto);

    void connected(JsonNode connectedInfo);

    void disconnect(JsonNode disconnectInfo);
    // endregion


    String getAgentEventTopic(String agentUid);

    void stopEvent();
}