package com.njcn.harmonic.controller.specialanalysis;

import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.harmonic.pojo.vo.WfOfOverviewVO;
import com.njcn.harmonic.pojo.vo.WfOfOverviewVoltageVO;
import com.njcn.harmonic.service.specialanalysis.WindFarmOverviewService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;

/**
 * 专项分析-风电场-概述
 *
 * @author yzh
 * @date 2022/11/30
 */

@RestController
@RequestMapping("/windFarmOverview")
@Slf4j
@Api(tags = "专项分析-风电场")
@RequiredArgsConstructor
public class WindFarmOverviewController extends BaseController {

    private final WindFarmOverviewService windFarmOverviewService;

    /**
     * 获取风电场概述地图
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO>>
     * @author yzh
     * @date 2022/11/30
     */
    @PostMapping("/getWindFarmOverviewMap")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取风电场概述地图")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<?>> getWindFarmOverviewMap(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getWindFarmOverviewMap");
        List<?> list = windFarmOverviewService.getWindFarmOverviewMap(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

    /**
     * 获取风电场概述数值
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO>>
     * @author yzh
     * @date 2022/12/5
     */
    @PostMapping("/getWindFarmOverviewValues")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取风电场概述数值")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<WfOfOverviewVO> getWindFarmOverviewValues(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getWindFarmOverviewValues");
        WfOfOverviewVO result = windFarmOverviewService.getWindFarmOverviewValues(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }

    /**
     * 获取风电场概述环形图
     *
     * @param param 条件参数
     * @return com.njcn.common.pojo.response.HttpResult<java.util.List < com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO>>
     * @author yzh
     * @date 2022/12/5
     */
    @PostMapping("/getWindFarmOverviewCircularGraph")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取风电场概述环形图")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<WfOfOverviewVoltageVO>> getWindFarmOverviewCircularGraph(@RequestBody StatisticsBizBaseParam param) {
        String methodDescribe = getMethodDescribe("getWindFarmOverviewCircularGraph");
        List<WfOfOverviewVoltageVO> list = windFarmOverviewService.getWindFarmOverviewCircularGraph(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }
}
