MonitorController.java
1.09 KB
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
package vion.controller.mqtt;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import vion.model.monitor.Agent;
import vion.model.monitor.AgentRecord;
import vion.model.monitor.ServiceRecord;
import vion.model.monitor.Upgrade;
import vion.service.monitor.IAgentService;
import java.util.List;
/**
 * @author vion
 * @date 2024/10/16
 */
@RestController
@RequestMapping("/api/monitor")
@RequiredArgsConstructor
public class MonitorController {
    private final IAgentService agentService;
    @PostMapping("/reg")
    public String reg(@RequestBody Agent agent) {
        return agentService.reg(agent);
    }
    @GetMapping("/upgrade")
    public Upgrade getUpgradeInfo(Short type) {
        return agentService.getUpgradeInfo(type);
    }
    @PostMapping("/server")
    public String recServerInfo(@RequestBody AgentRecord agentRecord) {
        return agentService.recAgentRecord(agentRecord);
    }
    @PostMapping("/service")
    public String recServiceInfo(@RequestBody List<ServiceRecord> recList) {
        return agentService.recServiceInfo(recList);
    }
}