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.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.harmonic.pojo.param.RMpEmissionParam;
import com.njcn.harmonic.pojo.vo.RMpEmissionChartVO;
import com.njcn.harmonic.pojo.vo.RMpEmissionVO;
import com.njcn.harmonic.service.specialanalysis.RMpEmissionMService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
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 jianghaifei
 * @Date 2022-11-30 19:11
 * @Version V1.0
 */

@RestController
@Api(tags = "专项分析-发射特性")
@RequiredArgsConstructor
@RequestMapping("/rMpEmission")
public class RMpEmissionController extends BaseController {

    private final RMpEmissionMService rMpEmissionMService;


    @PostMapping("/getRMpEmissionList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("发射特性分析-表格")
    public HttpResult<List<RMpEmissionVO>> getRMpEmissionList(@RequestBody RMpEmissionParam rMpEmissionParam) {
        String methodDescribe = getMethodDescribe("getRMpEmissionList");

        List<RMpEmissionVO> resultList = rMpEmissionMService.getRMpEmissionList(rMpEmissionParam);

        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resultList, methodDescribe);
    }

    @PostMapping("/getRMpEmissionChart")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("发射特性分析-折线图")
    public HttpResult<RMpEmissionChartVO> getRMpEmissionChart(@RequestBody RMpEmissionParam rMpEmissionParam) {
        String methodDescribe = getMethodDescribe("getRMpEmissionChart");

        RMpEmissionChartVO rMpEmissionChartVO = rMpEmissionMService.getRMpEmissionChart(rMpEmissionParam);

        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rMpEmissionChartVO, methodDescribe);
    }
}
