package com.njcn.device.pms.controller.majornetwork;


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.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pms.pojo.param.UniversalFrontEndParam;
import com.njcn.device.pms.pojo.vo.RStatBusbarHarmonicYVO;
import com.njcn.device.pms.service.majornetwork.RStatBusbarHarmonicService;
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 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/10/8
 */

@RestController
@RequestMapping("/rStatBusbarHarmonic")
@Api(tags = "变电站背景谐波")
@RequiredArgsConstructor
public class RStatBusbarHarmonicController extends BaseController {

    private final RStatBusbarHarmonicService statBusbarHarmonicService;

    /**
     * 获取变电站母线电压指标年报
     *
     * @param param 前端传入参数
     * @return 变电站母线电压指标年报
     */
    @PostMapping("/getRStatBusbarHarmonic")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("获取变电站母线电压指标年报")
    @ApiImplicitParam(name = "param", value = "条件参数", required = true)
    public HttpResult<List<RStatBusbarHarmonicYVO>> getRStatBusbarHarmonic(@RequestBody UniversalFrontEndParam param) {
        String methodDescribe = getMethodDescribe("getRStatBusbarHarmonic");
        List<RStatBusbarHarmonicYVO> list = statBusbarHarmonicService.getRStatBusbarHarmonic(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

}
