HealthController.java
885 Bytes
package com.iot.scheduler.controller;
import com.iot.scheduler.service.HnDeviceReportService;
import com.iot.scheduler.service.ShDevicePullService;
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;
@GetMapping("/health")
public String health() {
return "IoT Scheduler is running...";
}
@GetMapping("/manualSynchronization")
public void manualSynchronization() {
hnDeviceReportService.deviceReport();
}
@GetMapping("/pullSynchronization")
public void pullSynchronization() {
shDevicePullService.pullDeviceAndPushToIot();
}
}