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

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.custom.service.CustomDmatablepressviewService;
import com.tofly.xrtygis.entity.Dmatablepressview;
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 Michael.Shu
 * @date 2021-5-28 09:26:53
 */
@RestController
@AllArgsConstructor
@RequestMapping("/dmapress")
@Api(tags = "分区计量--压力历史采集分析")
public class CustomDmatablepressviewController {

    private final CustomDmatablepressviewService customDmatablepressviewService;

    /**
     * 分区获取压力数据
     *
     * @param response   响应对象
     * @param page       分页对象
     * @param start_time 开始时间
     * @param end_time   结束时间
     * @param table_ids  观察表ID集（多个英文逗号隔开）
     * @return
     */
    @PostMapping("/list")
    @ApiOperation(value = "压力历史采集列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "start_time", value = "开始时间"),
            @ApiImplicitParam(name = "end_time", value = "结束时间"),
            @ApiImplicitParam(name = "table_ids", value = "观察表ID集，多个用英文逗号隔开"),
            @ApiImplicitParam(name = "isExport", value = "是否导出（true导出，false不导出")
    })
    public ResultRespone getListInfo(HttpServletResponse response, Page<Dmatablepressview> page, String start_time, String end_time, String table_ids, boolean isExport) {
        return ResultRespone.success(customDmatablepressviewService.getListInfo(response, page, start_time, end_time, table_ids, isExport));
    }
}