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.RMpInfluenceParam;
import com.njcn.harmonic.pojo.vo.RMpInfluenceChartVO;
import com.njcn.harmonic.pojo.vo.RMpInfluenceVO;
import com.njcn.harmonic.service.specialanalysis.RMpInfluenceMService;
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-12-01 19:54
 * @Version V1.0
 */
@RestController
@Api(tags = "专项分析-影响特性")
@RequiredArgsConstructor
@RequestMapping("/rMpInfluence")
public class RMpInfluenceController extends BaseController {

    private final RMpInfluenceMService rMpInfluenceMService;

    @PostMapping("/getRMpInfluenceList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("影响特性分析")
    public HttpResult<List<RMpInfluenceVO>> getRMpInfluenceList(@RequestBody RMpInfluenceParam rMpInfluenceParam) {
        String methodDescribe = getMethodDescribe("getRMpInfluenceList");

        List<RMpInfluenceVO> resultList = rMpInfluenceMService.getRMpInfluenceList(rMpInfluenceParam);

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

    @PostMapping("/getRMpInfluenceChart")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("影响特性分析-折线图")
    public HttpResult<RMpInfluenceChartVO> getRMpInfluenceChart(@RequestBody RMpInfluenceParam rMpInfluenceParam) {
        String methodDescribe = getMethodDescribe("getRMpInfluenceChart");

        RMpInfluenceChartVO rMpInfluenceChartVO = rMpInfluenceMService.getRMpInfluenceChart(rMpInfluenceParam);

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