package com.gyee.runeconomy.controller.goodness;

import com.gyee.runeconomy.dto.R;
import com.gyee.runeconomy.dto.ResultMsg;
import com.gyee.runeconomy.service.WpwindDayInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * 风场风资源图表
 */
@Controller
@RequestMapping("/goodness")
@Api(value = "风场风资源图表", tags = "风场风资源图表")
public class WindpowerDetailChartController {

    @Resource
    private WpwindDayInfoService wpwindDayInfoService;


    /*
     * 风场日最大风速
     */
    @GetMapping("/wprzdfs")
    @ResponseBody
    @ApiOperation(value = "风场日最大风速", notes = "风场日最大风速")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public R wprzdfs(String wpId, String recorddate) {

        Map<String, Object> map = new HashMap<String, Object>();

        map = wpwindDayInfoService.wprzdfs(wpId, recorddate);


        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }

    /*
     * 风场月最大风速
     */
    @GetMapping("/wpyzdfs")
    @ResponseBody
    @ApiOperation(value = "风场月最大风速", notes = "风场月最大风速")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public R wpyzdfs(String wpId, String recorddate) {

        Map<String, Object> map = new HashMap<String, Object>();

        map = wpwindDayInfoService.wpyzdfs(wpId, recorddate);


        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }


    /*
     * 风场年最大风速
     */
    @GetMapping("/wpnzdfs")
    @ResponseBody
    @ApiOperation(value = "风场年最大风速", notes = "风场年最大风速")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public R wpnzdfs(String wpId, String recorddate) {

        Map<String, Object> map = new HashMap<String, Object>();

        map = wpwindDayInfoService.wpnzdfs(wpId, recorddate);


        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }


    /*
     * 风场日风向频率
     */
    @GetMapping("/wprfxpl")
    @ResponseBody
    @ApiOperation(value = "风场日风向频率", notes = "风场日风向频率")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public R wprfxpl(String wpId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();

        map = wpwindDayInfoService.wprfxpl(wpId, recorddate);


        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }


    /*
     * 风场月风向频率
     */
    @GetMapping("/wpyfxpl")
    @ResponseBody
    @ApiOperation(value = "风场月风向频率", notes = "风场月风向频率")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public R wpyfxpl(String wpId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();


        map = wpwindDayInfoService.wpyfxpl(wpId, recorddate);


        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }

    /*
     * 风场年风向频率
     */
    @GetMapping("/wpnfxpl")
    @ResponseBody
    @ApiOperation(value = "风场年风向频率", notes = "风场年风向频率")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "recorddate", value = "日期", required = true, dataType = "string", paramType = "query")})

    public R wpnfxpl(String wpId, String recorddate) {
        Map<String, Object> map = new HashMap<String, Object>();


        map = wpwindDayInfoService.wpnfxpl(wpId, recorddate);


        if (null != map) {
            return R.data(ResultMsg.ok(map));
        } else {
            return R.data(ResultMsg.error());
        }
    }


}
