package com.bonus.material.index.controller;

import com.bonus.common.biz.config.ListPagingUtil;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.device.domain.vo.DevInfoVo;
import com.bonus.material.index.service.IndexService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("/index")
public class IndexController extends BaseController {
    @Resource
    private IndexService indexService;

    @ApiOperation(value = "数据总览")
    @GetMapping("/getDeviceNum")
    public AjaxResult getDeviceNum() {
        return indexService.getDeviceNum();
    }


    @ApiOperation(value = "使用情况")
    @GetMapping("/getUseDeviceNum")
    public AjaxResult getUseDeviceNum() {
        return indexService.getUseDeviceNum();
    }

    @ApiOperation(value = "实时情况")
    @GetMapping("/getReal")
    public AjaxResult getReal() {
        return indexService.getReal();
    }

    @ApiOperation(value = "实时情况")
    @GetMapping("/getDeviceByDept")
    public AjaxResult getDeviceByDept() {
        return indexService.getDeviceByDept();
    }

    @ApiOperation(value = "实时情况")
    @GetMapping("/getMaQc")
    public AjaxResult getMaQc() {
        return indexService.getMaQc();
    }



    @ApiOperation(value = "实时情况")
    @GetMapping("/getDeviceNumByMonth")
    public AjaxResult getDeviceNumByMonth() {
        return indexService.getDeviceNumByMonth();
    }

    @ApiOperation(value = "实时情况")
    @GetMapping("/getApprover")
    public AjaxResult getApprover() {
        return indexService.getApprover();
    }

    @ApiOperation(value = "实时情况")
    @GetMapping("/getShare")
    public AjaxResult getShare() {
        return indexService.getShare();
    }


    @ApiOperation(value = "导出装备信息")
    @PostMapping("/export")
    public void export(HttpServletResponse response) {
        indexService.export(response);
    }



}
