package com.xhkjedu.sapi.controller.region;

import com.xhkjedu.sapi.service.region.RResourceAnalyzeService;
import com.xhkjedu.vo.ResultVo;
import com.xhkjedu.sapi.vo.region.RSchoolVo;
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 java.util.List;
import java.util.Map;

/**
 * @ClassName RResourceController
 * Description TODO 区域资源统计
 * Author WN
 * Date 2021/7/9 9:35
 **/
@RestController
@RequestMapping("rra")
public class RResourceAnalyzeController {
    @Resource
    RResourceAnalyzeService rResourceAnalyzeService;

    //资源数量统计
    @PostMapping("/resnum")
    public ResultVo getResourceQuestionNum(){
        Map map = rResourceAnalyzeService.getResourceQuestionNum();
        return new ResultVo(0,"获取资源数量统计成功",map);
    }

    //资源学段、分类、格式统计
    @PostMapping("/res")
    public ResultVo getResourceLeveType(){
        Map map = rResourceAnalyzeService.listRResourceLevelTypeNum();
        return new ResultVo(0,"获取资源分类和格式统计成功",map);
    }

    //试题学段占比、学校使用统计
    @PostMapping("/que")
    public ResultVo getQuestionLeveAndUse(){
        Map map = rResourceAnalyzeService.listRQuestionLevelNumAnUse();
        return new ResultVo(0,"获取试题学段占比和使用统计成功",map);
    }

    //校本资源统计
    @PostMapping("/xbres")
    public ResultVo listRResourceXbType(){
        List<RSchoolVo> schools = rResourceAnalyzeService.listRResourceXbType();
        return new ResultVo(0,"获取校本资源统计成功",schools);
    }


}
