package com.tofly.xrtygis.custom.controller.scada;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.custom.entity.scada.IndexDeviceHistory;
import com.tofly.xrtygis.custom.service.CustomIndexDeviceHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * 流量采集数据记录历史信息
 *
 * @author JF
 * @date 2022-4-21 16:32:46
 */
@RestController
@AllArgsConstructor
@RequestMapping("/indexDeviceHistory")
@Api(tags = "流量采集数据记录历史信息")
public class CustomIndexDeviceHistoryController {

    private final CustomIndexDeviceHistoryService customIndexDeviceHistoryService;

    /**
     * 流量采集数据记录历史信息
     *
     * @param response   响应对象
     * @param page       分页对象
     * @param start_time 开始时间
     * @param end_time   结束时间
     * @return
     */
    @PostMapping("/list")
    @ApiOperation(value = "流量采集数据记录历史信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start_time", value = "开始时间"),
            @ApiImplicitParam(name = "end_time", value = "结束时间")
    })
    public ResultRespone getListInfo(HttpServletResponse response, Page<IndexDeviceHistory> page, String start_time, String end_time) {
        return ResultRespone.success(customIndexDeviceHistoryService.getListInfo(response, page, start_time, end_time));
    }
}
