package com.ruixuan.data.controller;

import com.ruixuan.common.core.controller.BaseController;
import com.ruixuan.common.utils.poi.ExcelUtil;
import com.ruixuan.data.entity.KuaishouLiveDataAnalysis;
import com.ruixuan.data.service.IKuaishouLiveDataAnalysisService;
import com.ruixuan.data.service.IKuaishouLiveDataFunnelService;
import com.ruixuan.data.service.IKuaishouLiveDataKanbanService;
import com.ruixuan.data.service.IKuaishouLiveDataOverviewService;
import org.springframework.beans.factory.annotation.Autowired;
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;
import java.util.List;

/**
 * 商品分析数据Controller
 *
 * @author ruoyi
 * @date 2022-05-31
 */
@RestController
@RequestMapping("/live/data")
public class KuaishouLiveDataController extends BaseController {
    @Autowired
    private IKuaishouLiveDataAnalysisService analysisService;
    @Autowired
    private IKuaishouLiveDataFunnelService funnelService;
    @Autowired
    private IKuaishouLiveDataKanbanService kanbanService;
    @Autowired
    private IKuaishouLiveDataOverviewService overviewService;





    /**
     * 导出商品分析数据列表
     */
    @PostMapping("/export")
    public void export(HttpServletResponse response, KuaishouLiveDataAnalysis kuaishouLiveDataAnalysis) {
        List<KuaishouLiveDataAnalysis> list = analysisService.selectKuaishouLiveDataAnalysisList(kuaishouLiveDataAnalysis);
        ExcelUtil<KuaishouLiveDataAnalysis> util = new ExcelUtil<KuaishouLiveDataAnalysis>(KuaishouLiveDataAnalysis.class);
        util.exportExcel(response, list, "商品分析数据数据");
    }
}
