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.LineBaseQueryParam;
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
import com.njcn.device.pq.service.IPqDataVerifyCountService;
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;

/**
 * <p>
 *  异常数据功能
 * </p>
 *
 * @author xy
 * @since 2025-12-10
 */
@RestController
@RequestMapping("/dataVerifyCount")
@RequiredArgsConstructor
@Api(tags = "异常数据数量统计")
public class PqDataVerifyCountController extends BaseController {

    private final IPqDataVerifyCountService pqDataVerifyCountService;

    /**
     * 获取有异常数据的监测点相关信息
     */
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getAnomalousData")
    @ApiOperation("异常-获取异常数据主页面")
    public HttpResult<List<OnlineMonitorVo>> getAnomalousData(@RequestBody LineBaseQueryParam param){
        String methodDescribe = getMethodDescribe("getMonitorVerifyData");
        List<OnlineMonitorVo> list = pqDataVerifyCountService.getAnomalousData(param);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

}

