package com.microservices.dms.achievementLibrary.controller;

import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.dms.achievementLibrary.service.ExpertDashboardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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.RestController;

@RestController
@RequiredArgsConstructor
@Api(tags = "数据管理体系-专家可视化接口")
@RequestMapping("/expertDashboard")
public class ExpertDashboardController {
    @Autowired
    private ExpertDashboardService expertDashboardService;

    @GetMapping(value = "getExpertTotal")
    @ApiOperation(value = "获取专家总数")
    public AjaxResult getExpertTotal() {
        return AjaxResult.success(expertDashboardService.getExpertTotal());
    }

    @GetMapping(value = "getAuthenticationStatistic")
    @ApiOperation(value = "专家实名完成度")
    public AjaxResult getAuthenticationStatistic() {
        return AjaxResult.success(expertDashboardService.getAuthenticationStatistic());
    }

    @GetMapping(value = "getTitleRankStatistic")
    @ApiOperation(value = "专家职称级分布")
    public AjaxResult getTitleRankStatistic() {
        return AjaxResult.success(expertDashboardService.getTitleRankStatistic());
    }

    @GetMapping(value = "getExpertAduit")
    @ApiOperation(value = "专家评审作品数排序")
    public AjaxResult getExpertAduit() {
        return AjaxResult.success(expertDashboardService.getExpertAduit());
    }

    @GetMapping(value = "getExpertTypeStatistic")
    @ApiOperation(value = "专家专业类别")
    public AjaxResult getExpertTypeStatistic() {
        return AjaxResult.success(expertDashboardService.getExpertTypeStatistic());
    }

    @GetMapping(value = "getWorkplaceTypeStatistic")
    @ApiOperation(value = "专家单位类别分布")
    public AjaxResult getWorkplaceTypeStatistic() {
        return AjaxResult.success(expertDashboardService.getWorkplaceTypeStatistic());
    }

    @GetMapping(value = "getHighestDegreeStatistic")
    @ApiOperation(value = "专家学历分布")
    public AjaxResult getHighestDegreeStatistic() {
        return AjaxResult.success(expertDashboardService.getHighestDegreeStatistic());
    }

    //7、年度专家数据统计  cretate_on
    @GetMapping(value = "getExpertTotalByYear")
    @ApiOperation(value = "年度专家数据统计")
    public AjaxResult getExpertTotalByYear() {
        return AjaxResult.success(expertDashboardService.getExpertTotalByYear());
    }

    @GetMapping(value = "getReviewAreasStatistic")
    @ApiOperation(value = "热门专家领域")
    public AjaxResult getReviewAreasStatistic() {
        return AjaxResult.success(expertDashboardService.getReviewAreasStatistic());
    }

}
