HealthController.java
1.21 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
package com.iot.scheduler.controller;
import com.iot.scheduler.service.GhDevicePullService;
import com.iot.scheduler.service.HnDeviceReportService;
import com.iot.scheduler.service.ShDevicePullService;
import com.iot.scheduler.service.SlDevicePullService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HealthController {
@Resource
private HnDeviceReportService hnDeviceReportService;
@Resource
private ShDevicePullService shDevicePullService;
@Resource
private SlDevicePullService slDevicePullService;
@Resource
private GhDevicePullService ghDevicePullService;
@GetMapping("/health")
public String health() {
return "IoT Scheduler is running...";
}
@GetMapping("/manualSynchronization")
public void manualSynchronization() {
hnDeviceReportService.deviceReport();
}
@GetMapping("/pullSynchronization")
public void pullSynchronization() {
// shDevicePullService.pullDeviceAndPushToIot();
// slDevicePullService.pullDeviceAndPushToIot();
ghDevicePullService.pullDeviceAndPushToIot();
}
}