package com.microservices.dms.achievementLibrary.controller;

import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.dms.achievementLibrary.service.BigScreenStatisticService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@Api(tags = "数据管理体系-大屏统计接口")
@RequestMapping("/bigScreenStatistic")
public class BigScreenStatisticController {

    private final BigScreenStatisticService bigScreenStatisticService;


    @GetMapping(value = "/achievement/getAchievementTopStatistic")
    @ApiOperation(value = "成果任务统计顶部折线图")
    public AjaxResult getAchievementTopStatistic(String source) {
        return AjaxResult.success(bigScreenStatisticService.getAchievementTopStatistic(source));
    }

    @GetMapping(value = "/achievement/getAchievementDataYearly")
    @ApiOperation(value = "年度成果数据")
    public AjaxResult getAchievementDataYearly() {
        return AjaxResult.success(bigScreenStatisticService.getAchievementDataYearly());
    }


    @GetMapping(value = "/achievement/getAchievementType")
    @ApiOperation(value = "成果类型")
    public AjaxResult getAchievementType() {
        return AjaxResult.success(bigScreenStatisticService.getAchievementType());
    }


    @GetMapping(value = "/achievement/getAchievementDomain")
    @ApiOperation(value = "成果领域分布")
    public AjaxResult getAchievementDomain() {
        return AjaxResult.success(bigScreenStatisticService.getAchievementDomain());
    }


    @GetMapping(value = "/achievement/getAchievementAddYearly")
    @ApiOperation(value = "近1年新增成果数")
    public AjaxResult getAchievementAddYearly() {
        return AjaxResult.success(bigScreenStatisticService.getAchievementAddYearly());
    }

    @GetMapping(value = "/achievement/getAchievementActData")
    @ApiOperation(value = "成果行为数据展示")
    public AjaxResult getAchievementActData() {
        return AjaxResult.success(bigScreenStatisticService.getAchievementActData());
    }

    @GetMapping(value = "/achievement/getAchievementHotRank")
    @ApiOperation(value = "成果热度排行")
    public AjaxResult getAchievementHotRank() {
        return AjaxResult.success(bigScreenStatisticService.getAchievementHotRank());
    }


    @GetMapping(value = "/competition/getCompetitionTopStatistic")
    @ApiOperation(value = "competition统计顶部")
    public AjaxResult getAchievementTopStatistic() {
        return AjaxResult.success(bigScreenStatisticService.getCompetitionTopStatistic());
    }

    @GetMapping(value = "/competition/getCompetitionStatisticYearly")
    @ApiOperation(value = "竞赛数据统计")
    public AjaxResult getCompetitionStatisticYearly() {
        return AjaxResult.success(bigScreenStatisticService.getCompetitionStatisticYearly());
    }

    @GetMapping(value = "/competition/getCompetitionHot")
    @ApiOperation(value = "热门竞赛统计")
    public AjaxResult getCompetitionHot() {
        return AjaxResult.success(bigScreenStatisticService.getCompetitionHot());
    }

    @GetMapping(value = "/competition/getCompetitionYearlyPaperAdd")
    @ApiOperation(value = "年度竞赛作品新增数")
    public AjaxResult getCompetitionYearlyPaperAdd() {
        return AjaxResult.success(bigScreenStatisticService.getCompetitionYearlyPaperAdd());
    }

    @GetMapping(value = "/competition/getCompetitionYearlyFinish")
    @ApiOperation(value = "近1年竞赛完成情况")
    public AjaxResult getCompetitionYearlyFinish() {
        return AjaxResult.success(bigScreenStatisticService.getCompetitionYearlyFinish());
    }



}
