package com.lutao.cloud.oil.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.lutao.cloud.common.core.util.MessageInfo;
import com.lutao.cloud.common.security.annotation.Inner;
import com.lutao.cloud.oil.pojo.param.DetectAlarmChartVOParam;
import com.lutao.cloud.oil.pojo.param.FireAndGasAlarmParam;
import com.lutao.cloud.oil.pojo.param.FireGasHazardAlarmParam;
import com.lutao.cloud.oil.pojo.vo.DetectAlarmChartVO;
import com.lutao.cloud.oil.pojo.vo.DetectionAlarmVO;
import com.lutao.cloud.oil.pojo.vo.FireGasHazardAlarmVO;
import com.lutao.cloud.oil.service.IBusinessPerceptionMonitorAlarmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 javax.annotation.Resource;
import java.util.List;

/**
 * 感知监控报警控制器
 *
 * @author yx
 * @date 2023/07/26
 */
@Api(value = "感知监控报警控制器", tags = "感知监控报警控制器")
@RestController
@RequestMapping("/perception_monitor_alarm")
public class PerceptionMonitorAlarmController {

    @Resource
    private IBusinessPerceptionMonitorAlarmService iBusinessPerceptionMonitorAlarmService;

    @ApiOperation(value = "火灾探测报警")
    @ApiOperationSupport(order = 4)
    @PostMapping("/fire-detective-alarm")
    @Inner(value = false)
    public MessageInfo<IPage<DetectionAlarmVO>> fireDetectiveAlarm(Page page, @RequestBody FireAndGasAlarmParam param) {

        return iBusinessPerceptionMonitorAlarmService.queryFireDetectionAlarmList(param, page);
    }

    @ApiOperation(value = "可燃气体探测报警")
    @ApiOperationSupport(order = 5)
    @PostMapping("/gas-detective-alarm")
    @Inner(value = false)
    public MessageInfo<IPage<DetectionAlarmVO>> gasDetectiveAlarm(Page page, @RequestBody FireAndGasAlarmParam param) {

        return iBusinessPerceptionMonitorAlarmService.queryGasDetectionAlarmList(param, page);
    }

    @ApiOperation(value = "有毒气体探测报警")
    @ApiOperationSupport(order = 6)
    @PostMapping("/hazardous-detective-alarm")
    @Inner(value = false)
    public MessageInfo<IPage<DetectionAlarmVO>> hazardousDetectiveAlarm(Page page, @RequestBody FireAndGasAlarmParam param) {

        return iBusinessPerceptionMonitorAlarmService.queryHazardousGasDetectionAlarmList(param, page);
    }

    @ApiOperation(value = "火灾报警图表",notes = "火灾报警图表")
    @ApiOperationSupport(order = 7)
    @PostMapping("/fire-alarm-chart")
    @Inner(value = false)
    public MessageInfo<List<DetectAlarmChartVO>> fireAlarmChart(@RequestBody DetectAlarmChartVOParam param){
        return iBusinessPerceptionMonitorAlarmService.getFireAlarmChart(param);
    }

    @ApiOperation(value = "可燃气体报警图表",notes = "可燃气体报警图表")
    @ApiOperationSupport(order = 8)
    @PostMapping("/gas-alarm-chart")
    @Inner(value = false)
    public MessageInfo<List<DetectAlarmChartVO>> gasAlarmChart(@RequestBody DetectAlarmChartVOParam param){
        return iBusinessPerceptionMonitorAlarmService.getGasAlarmChart(param);
    }

    @ApiOperation(value = "有毒气体报警图表",notes = "有毒气体报警图表")
    @ApiOperationSupport(order = 9)
    @PostMapping("/hazardous-alarm-chart")
    @Inner(value = false)
    public MessageInfo<List<DetectAlarmChartVO>> hazardousAlarmChart(@RequestBody DetectAlarmChartVOParam param){
        return iBusinessPerceptionMonitorAlarmService.getHazardousAlarmChart(param);
    }

    @ApiOperation(value = "火灾-可燃-有毒气体-近30天总报警总体情况",notes = "火灾-可燃-有毒气体-近30天总报警总体情况")
    @ApiOperationSupport(order = 10)
    @PostMapping("/fire-gas-hazard-alarm-statistics")
    @Inner(value = false)
    public MessageInfo<FireGasHazardAlarmVO> fireGasHazardAlarmStatistics(@RequestBody FireGasHazardAlarmParam param){
        return iBusinessPerceptionMonitorAlarmService.fireGasHazardAlarmStatistics(param);
    }

}
