package com.usky.vpp.controller.api;

import com.usky.vpp.RemoteVppTaskService;
import com.usky.vpp.service.VppSiteCompletionRateTaskService;
import com.usky.vpp.service.VppUnIntervalDataReportTaskService;
import com.usky.vpp.service.VppUnPollTaskService;
import com.usky.vpp.service.VppUnRegisterTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ServiceVppTaskApi implements RemoteVppTaskService {

    @Autowired
    private VppSiteCompletionRateTaskService siteCompletionRateTaskService;

    @Autowired
    private VppUnPollTaskService unPollTaskService;

    @Autowired
    private VppUnRegisterTaskService unRegisterTaskService;

    @Autowired
    private VppUnIntervalDataReportTaskService unIntervalDataReportTaskService;

    @Override
    public void refreshSiteAvgCompletionRate() {
        siteCompletionRateTaskService.refreshSiteAvgCompletionRate();
    }

    @Override
    public void pollUn(Integer tenantId) {
        unPollTaskService.pollUn(tenantId);
    }

    @Override
    public void registerUn(Integer tenantId) {
        unRegisterTaskService.registerUn(tenantId);
    }

    @Override
    public void intervalDataReportUn(Integer tenantId) {
        unIntervalDataReportTaskService.intervalDataReportUn(tenantId);
    }
}
