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

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.device.pms.pojo.param.RMpMonitorAlarmCountMParam;
import com.njcn.device.pms.pojo.vo.PwRMpMonitorAlarmCountMVO;
import com.njcn.device.pms.service.distribution.PwRMpMonitorAlarmCountMService;
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;

/**
 * 监测点告警统计
 * @Title RMpMonitorAlarmCountMController
 * @Package com.njcn.device.pms.controller
 * @Author jianghaifei
 * @Date 2022-10-13 08:54
 * @Version V1.0
 */
@RestController
@Api(tags = "配网-监测点告警统计(月)")
@RequiredArgsConstructor
@RequestMapping("/pwRMpMonitorAlarmCountM")
public class PwRMpMonitorAlarmCountMController extends BaseController {

    private final PwRMpMonitorAlarmCountMService rMpMonitorAlarmCountMService;

    /***
     * 根据条件查询监测点告警统计(月)(配网)
     * @author jianghaifei
     * @date 2022-11-01 15:21
     * @param rMpMonitorAlarmCountMParam
     * @return java.util.List<com.njcn.device.pms.pojo.vo.RMpMonitorAlarmCountMVO>
     */
    @PostMapping("/getPwRMpMonitorAlarmCountMList")
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @ApiOperation("查询监测点告警统计(月)(配网)")
    public HttpResult<Page<PwRMpMonitorAlarmCountMVO>> getPwRMpMonitorAlarmCountMList(@RequestBody RMpMonitorAlarmCountMParam rMpMonitorAlarmCountMParam) {
        String methodDescribe = getMethodDescribe("getPwRMpMonitorAlarmCountMList");
        Page<PwRMpMonitorAlarmCountMVO> page = rMpMonitorAlarmCountMService.getPwRMpMonitorAlarmCountMList(rMpMonitorAlarmCountMParam);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
    }
}
