package cn.cecep.talroad.controller.effective;

import cn.cecep.talroad.domain.dto.PollutantCharacterAnalysisDto;
import cn.cecep.talroad.service.effective.PollutionCharacterAnalysisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @ProjectName: szhpt-business
 * @Package: cn.cecep.talroad.controller
 * @ClassName: PollutionCharacterAnalysisController
 * @Author: wyg
 * @Description: 污染特征分析
 * @Date: 2023/6/13 15:10
 * @Version: 1.0
 */
@Api(tags = "污染特征分析")
@RestController
@RequestMapping(value = "/pollutionCharacter")
public class PollutionCharacterAnalysisController {
    @Autowired
    private PollutionCharacterAnalysisService pollutionCharacterAnalysisService;

    @ApiOperation(value = "特征比值")
    @PostMapping(value = "/ratioOf")
    public List<Map<String, Object>> ratioOf(@RequestBody PollutantCharacterAnalysisDto analysisDto) {
        return pollutionCharacterAnalysisService.ratioOf(analysisDto);
    }

    @ApiOperation(value = "皮尔逊相关系数")
    @PostMapping(value = "/plxValue")
    public double[][] plxValue(@RequestBody PollutantCharacterAnalysisDto analysisDto) {
        return pollutionCharacterAnalysisService.plxValue(analysisDto);
    }
}
