package cn.cecep.talroad.task;

import cn.cecep.talroad.common.core.web.domain.AjaxResults;
import cn.cecep.talroad.data.analyse.task.service.ConcentrationTaskService;
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;

/***
 *
 * @Title:
 * @Author: xuxin
 * @CreateTime: 2023-07-04 13:25
 * @Description
 *
 **/
@Slf4j
@Api(tags = "监测差异分析")
@RestController
@RequestMapping("/data/concentration")
public class ConcentrationTaskController {


    @Autowired
    private ConcentrationTaskService concentrationTaskService;

    @ApiOperation(value = "废气，废水，监测差异分析", notes = "废气，废水，监测差异分析")
    @GetMapping("/realData")
    public AjaxResults<Void> realData() {

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

}
