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

import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.device.pms.pojo.param.gw.GwStatisticalParam;
import com.njcn.device.pms.pojo.param.gw.GwTerminalParam;
import com.njcn.device.pms.pojo.vo.gw.Statistical;
import com.njcn.device.pms.service.gwPush.MonitorStatisticsService;
import com.njcn.web.pojo.dto.PmsHttpResult;
import com.njcn.web.pojo.dto.PmsPage;
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 java.util.Map;


/**
 * @author wr
 * @description
 * @date 2024/5/16 9:22
 */
@Slf4j
@RestController
@RequestMapping("/basicInfo")
@Api(tags = "主配网监测点统计下穿")
@RequiredArgsConstructor
public class MonitorStatisticalController {

    private final MonitorStatisticsService monitorStatisticsService;

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/Equipment/getMonitorTerminalData")
    @ApiOperation("查询监测终端数据列表")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<Map<String, String>>> getMonitorTerminalData(@RequestBody GwTerminalParam param) {
        PmsPage<Map<String, String>> PmsPage = monitorStatisticsService.getMonitorTerminalData(param);
        return new PmsHttpResult<>(0, PmsPage);
    }


    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/jcd/getMonitorStatisticalDetailList")
    @ApiOperation("查询主配网监测点统计")
    @ApiImplicitParam(name = "param", value = "实体参数", required = true)
    public PmsHttpResult<PmsPage<Statistical>> getMonitorStatisticalDetailList(@RequestBody GwStatisticalParam param) {
        PmsPage<Statistical> PmsPage = monitorStatisticsService.getMonitorStatisticalDetailList(param);;
        return new PmsHttpResult<>(0, PmsPage);
    }

}
