package org.jeecg.ctop.material.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.ctop.material.service.IBossDataExhibitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Administrator
 * 2022/1/17
 **/
@Slf4j
@Api(tags="boss数据看板")
@RestController
@RequestMapping("/boss/bossDataExhibitionController")
public class BossDataExhibitionController {

    @Autowired
    private IBossDataExhibitionService bossDataExhibitionServiceImpl;



    @ApiOperation(value="素材产出占比", notes="素材产出占比")
    @GetMapping(value = "/getMeterialProduceRate")
    public Result getMeterialProduceRate(
            @RequestParam(name="mediaType",defaultValue = "2") String mediaType,
            @RequestParam(name="startTime") String startTime,
            @RequestParam(name="endTime") String endTime) {
        return bossDataExhibitionServiceImpl.getMeterialProduceRate(mediaType,startTime,endTime);
    }



    @ApiOperation(value="分公司素材消耗", notes="分公司素材消耗")
    @GetMapping(value = "/getCompanyMeterialConsume")
    public Result getCompanyMeterialConsume(
            @RequestParam(name="mediaType",defaultValue = "2") String mediaType,
            @RequestParam(name="startTime") String startTime,
            @RequestParam(name="endTime") String endTime) {
        return bossDataExhibitionServiceImpl.getCompanyMeterialConsume(mediaType,startTime,endTime);
    }




    @ApiOperation(value="素材相关-使用率；爆款率；创新率", notes="素材相关-使用率；爆款率；创新率")
    @GetMapping(value = "/getMeterialRelevantInfo")
    public Result getMeterialRelevantInfo(
            @RequestParam(name="mediaType",defaultValue = "2") String mediaType,
            @RequestParam(name="startTime") String startTime,
            @RequestParam(name="endTime") String endTime) {
        return bossDataExhibitionServiceImpl.getMeterialRelevantInfo(mediaType,startTime,endTime);
    }



    @ApiOperation(value="分公司投放数据", notes="分公司投放数据")
    @GetMapping(value = "/getCompanyAccountDataInfo")
    public Result getCompanyAccountDataInfo(
            @RequestParam(name="mediaType",defaultValue = "2") String mediaType,
            @RequestParam(name="startTime") String startTime,
            @RequestParam(name="endTime") String endTime) {
        return bossDataExhibitionServiceImpl.getCompanyAccountDataInfo(mediaType,startTime,endTime);
    }



    @ApiOperation(value="分媒体投放数据", notes="分媒体投放数据")
    @GetMapping(value = "/getAccountDataByMediaType")
    public Result getAccountDataByMediaType() {
        return bossDataExhibitionServiceImpl.getAccountDataByMediaType();
    }


    @ApiOperation(value="分媒体公司消耗-账户维度-分日数据-折线图", notes="分媒体公司消耗-账户维度-分日数据-折线图")
    @GetMapping(value = "/getAccountTrendByMediaType")
    public Result getAccountTrendByMediaType(
            @RequestParam(name="mediaType",defaultValue = "2") String mediaType,
            @RequestParam(name="startTime") String startTime,
            @RequestParam(name="endTime") String endTime) {
        return bossDataExhibitionServiceImpl.getAccountTrendByMediaType(mediaType,startTime,endTime);
    }


    @ApiOperation(value="项目消耗排行top10", notes="项目消耗排行top10")
    @GetMapping(value = "/getProjectCostTopTenByMediaType")
    public Result getProjectCostTopTenByMediaType(
            @RequestParam(name="mediaType",defaultValue = "2") String mediaType,
            @RequestParam(name="startTime") String startTime,
            @RequestParam(name="endTime") String endTime) {
        return bossDataExhibitionServiceImpl.getProjectCostTopTenByMediaType(mediaType,startTime,endTime);
    }










}