package cn.cecep.talroad.task;

import cn.cecep.talroad.common.core.web.domain.AjaxResults;
import cn.cecep.talroad.data.analyse.task.service.ContrastiveAnalysisGasTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "在线监测行业对比分析")
@RestController
@RequestMapping("/data/contrastive/analysis")
public class ContrastiveAnalysisController {

    @Autowired
    private ContrastiveAnalysisGasTaskService contrastiveAnalysisGasTaskService;

    @ApiOperation(value = "废气，废水，在线监测行业对比分析", notes = "废气，废水，在线监测行业对比分析")
    @GetMapping("/realData")
    public AjaxResults<Void> realData() {

        try {
            log.info("执行任务 在线监测行业对比分析 start：className：{}",contrastiveAnalysisGasTaskService.getClass().getName());
            contrastiveAnalysisGasTaskService.mainProcess();
        }catch (Exception e){
            log.error("执行 在线监测行业对比分析 任务失败！className:{}",contrastiveAnalysisGasTaskService.getClass().getName());
        }
        return AjaxResults.success();
    }

}
