package com.njcn.device.pq.controller;


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.pq.pojo.param.DeviceInfoParam;
import com.njcn.device.pq.pojo.vo.CommunicateVO;
import com.njcn.device.pq.service.ISubstationExpendService;
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 com.njcn.web.controller.BaseController;

import java.util.List;

/**
 *
 */
@Slf4j
@Api(tags = "冀北变电站地图信息")
@RestController
@RequestMapping("/substationExpend")
@RequiredArgsConstructor
public class SubstationExpendController extends BaseController {

    private final ISubstationExpendService substationExpendService;


    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getPVCommunicationStatus")
    @ApiOperation("冀北主网监测点pq:通讯状态统计")
    @ApiImplicitParam(name = "param", value = "冀北主网监测点台账统计参数", required = true)
    public HttpResult<List<CommunicateVO.PVCommunicateVO>> getPVCommunicationStatus(@RequestBody DeviceInfoParam.CompareLimitParam param) {
        String methodDescribe = getMethodDescribe("getPVCommunicationStatus");
        List<CommunicateVO.PVCommunicateVO> communicationStatus = substationExpendService.getCommunicationStatus(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, communicationStatus, methodDescribe);
    }
}

