package cn.cecep.talroad.controller.effective;

import cn.cecep.talroad.common.core.web.domain.AjaxResults;
import cn.cecep.talroad.service.effective.IPCodAreaInfoService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * @Author: wyg
 * @Description: 监测地图-公共查询-数据查询
 * @Date: 2023/6/13 09:54
 * @Version: 1.0
 */
@AllArgsConstructor
@RestController
@RequestMapping("/pCodAreaInfo")
@Api(tags = "监测地图-公共查询-数据查询")
public class PCodAreaInfoController {

    private IPCodAreaInfoService pCodAreaInfoService;

    /**
     * 站点公共信息
     *
     * @Author wyg
     * @Version 1.0
     * @Date 2023/6/14 09:18
     */
    @GetMapping("/findStationPullData")
    @ApiOperation(value = "公共查询-查询站点下拉框数据-级联选择器")
    public AjaxResults findStationPullData() {
        return AjaxResults.success(pCodAreaInfoService.findStationPullDataList());
    }

    /**
     * 区域-公共信息
     *
     * @Author wyg
     * @Version 1.0
     * @Date 2023/6/14 09:18
     */
    @GetMapping("/findJurisdictionData")
    @ApiOperation(value = "公共查询-查询选择本级+所辖下级")
    public AjaxResults findJurisdictionData() {
        return AjaxResults.success(pCodAreaInfoService.findJurisdictionData());
    }

  /**
   * @Method 查询AQI+六因子
   * @Author wyg
   * @Version  1.0
   * @Date 2023/6/14 10:36
   */
    @GetMapping("/findSixApiParam")
    @ApiOperation(value = "公共查询-查询AQI+六因子动态下拉数据")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "type", value = "类型 1：区域 2：站点", required = true, dataType = "String"),
            @ApiImplicitParam(name = "property", value = "1小时 2日均 3月均", required = true, dataType = "String"),
    })
    public AjaxResults selectBySixApiParam(String type, String property) {
        return AjaxResults.success(pCodAreaInfoService.selectBySixApiParam(type,property));
    }

    /**
     * @Method 分布特征 传入开始时间和结束时间处理
     * @Author wyg
     * @Date 2023/6/14 10:31
     */
    @PostMapping("/findTimeDataList")
    @ApiOperation(value = "公共查询-传入开始时间和结束时间处理")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = true, dataType = "String"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = true, dataType = "String"),
            @ApiImplicitParam(name = "type", value = "结束时间", required = true, dataType = "String"),
            @ApiImplicitParam(name = "factorCode", value = "因子", required = true, dataType = "String"),
            @ApiImplicitParam(name = "regionCode", value = "区域", required = true, dataType = "String"),
    })
    public AjaxResults findTimeDataList(String startTime,String endTime,String type,String factorCode,String regionCode) {
        return AjaxResults.success(pCodAreaInfoService.findTimeDataList(startTime,endTime,type, factorCode,regionCode));
    }

   /**
    * @Method 时间分布特征-插值图/渲染图-区域范围
    * @Author wyg
    * @Date 2023/6/14 10:31
    */
    @GetMapping("/findCoverageData")
    @ApiOperation(value = "时间分布特征-插值图/渲染图-区域范围")
    public  AjaxResults findCoverageData()   {
        return AjaxResults.success(pCodAreaInfoService.findCoverageData());
    }


}
