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.dma.TableCountService;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @author 20126
 */
@RestController
@AllArgsConstructor
@RequestMapping("/tableCount")
@Api(tags = "分区计量--观察表统计分析")
public class TableCountController {

    private final TableCountService tableCountService;

    @GetMapping("/getPartition")
    @ApiOperation("获取分区内观察表统计信息")
    public ResultRespone getPartition(Page page){
        return ResultRespone.success(tableCountService.getPartition(page));
    }

    @GetMapping("/viewPartition")
    @ApiOperation(" 获取观察表详细信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dmaId",value = "dmaId",required = true,dataType = "string"),
            @ApiImplicitParam(name = "isExport",value = "0：不导出  1：导出",required = true,dataType = "string")
    })
    public ResultRespone viewPartition(HttpServletResponse response,Page page, String dmaId, String isExport){
        return ResultRespone.success(tableCountService.viewPartition(response,page, dmaId, isExport));
    }

}
