package com.njcn.harmonic.controller.specialanalysis;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.PowerQualityParam;
import com.njcn.harmonic.pojo.vo.RMpRailwayTractionDetailVO;
import com.njcn.harmonic.pojo.vo.RMpWpPowerDetailVO;
import com.njcn.harmonic.service.specialanalysis.RMpWpPowerDetailMService;
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;


/**
 * <p>
 * 专项分析-风电站-详细数据
 * </p>
 *
 * @author wr
 * @since 2022-11-30
 */
@RestController
@Api(tags = "专项分析-风电场")
@RequiredArgsConstructor
@RequestMapping("/windFarm")
public class WindFarmController extends BaseController {

    private final RMpWpPowerDetailMService rMpWpPowerDetailMService;

    /**
     * 详细数据表分页查询
     *
     */
    @PostMapping("/getWindFarmDetailInfo")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("详细数据表分页查询")
    @ApiImplicitParam(name = "param", value = "分页查询参数", required = true)
    public HttpResult<Page<RMpWpPowerDetailVO>> getWindFarmDetailInfo(@RequestBody PowerQualityParam.PowerQualityInfoParam param) {
        String methodDescribe = getMethodDescribe("getWindFarmDetailInfo");
        Page<RMpWpPowerDetailVO> powerQualityInfo = rMpWpPowerDetailMService.getWindFarmDetailInfo(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, powerQualityInfo, methodDescribe);
    }

    /**
     * 详细数据表分页查询
     *
     */
    @PostMapping("/getRailwayDetailInfo")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("电气化铁路详细数据表分页查询")
    @ApiImplicitParam(name = "param", value = "分页查询参数", required = true)
    public HttpResult<Page<RMpRailwayTractionDetailVO>> getRailwayDetailInfo(@RequestBody PowerQualityParam param) {
        String methodDescribe = getMethodDescribe("getRailwayDetailInfo");
        Page<RMpRailwayTractionDetailVO> powerQualityInfo = rMpWpPowerDetailMService.getRailwayDetailInfo(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, powerQualityInfo, methodDescribe);
    }
}

