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.WaterSupplyMonthService;
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("/supplyMonth")
@Api(tags = "分区计量--观察表供水量分析")
public class WaterSupplyMonthController {

    private final WaterSupplyMonthService waterSupplyMonthService;

    @GetMapping("/getSupplyMonth")
    @ApiOperation("获取观察表供水量(月)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "表id",required = true,dataType = "long"),
            @ApiImplicitParam(name = "isExport",value = "0:不导出 1：导出",required = true,dataType = "string"),
            @ApiImplicitParam(name = "start",value = "开始时间（例如202101,2021年1月）",dataType = "string"),
            @ApiImplicitParam(name = "end",value = "结束时间（例如202101,2021年1月）",dataType = "string")
    })
    public ResultRespone getSupplyMonth(HttpServletResponse response, Page page, Long id, String start, String end, String isExport){
        return ResultRespone.success(waterSupplyMonthService.getSupplyMonth(response, page, id, start, end, isExport));
    }

    @GetMapping("/getSupplyDay")
    @ApiOperation("获取观察表供水量(天)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "表id",required = true,dataType = "long"),
            @ApiImplicitParam(name = "isExport",value = "0:不导出 1：导出",required = true,dataType = "string"),
            @ApiImplicitParam(name = "start",value = "开始时间（例如20210101,2021年1月1日）",dataType = "string"),
            @ApiImplicitParam(name = "end",value = "结束时间（例如20210101,2021年1月1日）",dataType = "string")
    })
    public ResultRespone getSupplyDay(HttpServletResponse response, Page page, Long id, String start, String end, String isExport){
        return ResultRespone.success(waterSupplyMonthService.getSupplyDay(response, page, id, start, end, isExport));
    }

    @GetMapping("/getSupplyHour")
    @ApiOperation("获取观察表供水量(时)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "表id",required = true,dataType = "long"),
            @ApiImplicitParam(name = "isExport",value = "0:不导出 1：导出",required = true,dataType = "string"),
            @ApiImplicitParam(name = "start",value = "开始时间（例如2021010101,2021年1月1日凌晨1点）",dataType = "string"),
            @ApiImplicitParam(name = "end",value = "结束时间（例如2021010101,2021年1月1日凌晨1点）",dataType = "string")
    })
    public ResultRespone getSupplyHour(HttpServletResponse response, Page page, Long id, String start, String end, String isExport){
        return ResultRespone.success(waterSupplyMonthService.getSupplyHour(response, page, id, start, end, isExport));
    }


}
