package com.xhkjedu.sapi.controller.analyze;

import com.xhkjedu.sapi.service.analyze.SchoolSummaryService;
import com.xhkjedu.sapi.vo.analyze.SchoolParams;
import com.xhkjedu.sapi.vo.analyze.SchoolSummaryVo;
import com.xhkjedu.utils.N_Utils;
import com.xhkjedu.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName SchoolSummaryController
 * Description TODO 数据汇总
 * Author WN
 * Date 2020/10/15 11:10
 **/
@RestController
@RequestMapping("/schools")
public class SchoolSummaryController {
    @Autowired
    private SchoolSummaryService schoolSummaryService;

    //数据汇总
    @PostMapping("/summary")
    public ResultVo listSchoolTaskWork(@RequestBody SchoolParams srparams){
        N_Utils.validation(new Object[]{srparams.getSchoolid(), "学校id", 1,
                srparams.getGradeid(), "年级", 1,srparams.getYear(),"学年",1});
        List<SchoolSummaryVo> lst = schoolSummaryService.schoolSummary(srparams);
        return new ResultVo(0,"",lst);
    }
}
