IAgentService.java 1.77 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.monitor.AgentDTO;
import vion.dto.monitor.MqttAuthDTO;
import vion.dto.monitor.OrgDTO;
import vion.model.monitor.*;
import vion.vo.monitor.AgentVO;

import java.time.LocalDateTime;
import java.util.List;

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

    // region Agent 页面
    Page<AgentVO> list(AgentDTO dto);

    AgentVO getVOById(Long id);

    String update(AgentDTO dto);

    String upgradeCommand(String uid, Long upgradeId);

    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);

    List<AgentRecord> getForm(String uid, LocalDateTime startTime, LocalDateTime endTime);
    // endregion

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

    Upgrade getUpgradeInfo(Long id);

    String recAgentRecord(AgentRecord agentRecord);

    String recServiceInfo(List<ServiceRecord> recList);

    String recOrgInfo(OrgDTO orgDTO);
    // endregion

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

    void connected(JsonNode connectedInfo);

    void disconnect(JsonNode disconnectInfo);
    // endregion

    // region 系统级别事件监控
    void checkLicense();
    // endregion
}