package com.xhkjedu.sapi.controller.component;

import com.xhkjedu.sapi.service.component.ComponentService;
import com.xhkjedu.sapi.vo.component.ComponentParams;
import com.xhkjedu.utils.N_Utils;
import com.xhkjedu.vo.ResultVo;
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 javax.annotation.Resource;

/**
 * @Description：组件内容
 * @Author: WN
 * @Date: 2024/7/19 16:19:25
 **/
@RestController
@RequestMapping("/zjdata")
public class ComponentController {
    @Resource
    private ComponentService componentService;

    /*
     * @Description 教学教研--待批作业
     * @Date 2024/7/19 16:22:32
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/list_paper")
    public ResultVo listCorrectPages(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.listCorrectPages(userid, limitSize));
    }

    /*
     * @Description 教学教研--通知公告
     * @Date 2024/7/19 16:28:34
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/list_notice")
    public ResultVo listNotices(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.ListNotices(userid, limitSize));
    }

    /*
     * @Description 教学教研
     * @Date 2024/7/19 16:33:13
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/list_research")
    public ResultVo listResearchs(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.listResearchs(userid, limitSize));
    }

    /*
     * @Description 我的空间
     * @Date 2024/7/19 16:57:45
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/list_myspace")
    public ResultVo listMySpaces(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.listMySpaces(userid, limitSize));
    }

    /*
     * @Description 校本资源
     * @Date 2024/7/19 17:24:45
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/list_resource")
    public ResultVo listSchoolResources(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.listSchoolResources(userid, limitSize));
    }

    /*
     * @Description 同步视频
     * @Date 2024/7/19 17:36:26
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/list_video")
    public ResultVo listVideos(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.listVideos(userid, limitSize));
    }

    /*
     * @Description 预习
     * @Date 2024/7/22 9:26:52
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/list_guide")
    public ResultVo listGuides(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.listGuides(userid, limitSize));
    }

    /*
     * @Description 背诵
     * @Date 2024/7/22 9:27:34
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/list_recited")
    public ResultVo listReciteds(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.listReciteds(userid, limitSize));
    }

    /*
     * @Description 课堂回顾
     * @Date 2024/7/22 10:16:10
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/list_room")
    public ResultVo listClassrooms(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.listClassrooms(userid, limitSize));
    }

    /*
     * @Description 预习统计-班级
     * @Date 2024/7/22 12:29:01
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/guide_class")
    public ResultVo listGuidesStatisticClass(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.listGuidesStatisticClass(params));
    }

    /*
     * @Description 预习统计-科目
     * @Date 2024/7/22 14:22:29
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/guide_subject")
    public ResultVo listGuidesStatisticSubject(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.listGuidesStatisticSubject(params));
    }

    /*
     * @Description 作业统计-班级
     * @Date 2024/7/22 15:36:23
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/paper_class")
    public ResultVo listPapersStatisticClass(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.listPapersStatisticClass(params));
    }

    /*
     * @Description 作业统计-科目
     * @Date 2024/7/22 15:37:29
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/paper_subject")
    public ResultVo listPapersStatisticSubject(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.listPapersStatisticSubject(params));
    }

    /*
     * @Description 直播巡课
     * @Date 2024/7/22 17:09:17
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/live_patrol")
    public ResultVo listLivePatrol(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.listLivePatrol(params));
    }

    /*
     * @Description 教师直播
     * @Date 2024/7/22 17:20:50
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/live_teacher")
    public ResultVo listLiveTeachers(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
        return new ResultVo(0, componentService.listLiveTeachers(params));
    }

    /*
     * @Description 班级错题集
     * @Date 2024/7/23 10:21:22
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/class_errorq")
    public ResultVo getClassErrorQuestion(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer classid = params.getClassid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1, classid, "班级ID", 1});
        return new ResultVo(0, componentService.getClassErrorQuestion(params));
    }

    /*
     * @Description 我的班级
     * @Date 2024/7/23 10:51:51
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/class_teacher")
    public ResultVo getClassForTeacher(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.getClassForTeacher(params));
    }

    /*
     * @Description 校本题库
     * @Date 2024/7/23 11:24:09
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/question_statistic")
    public ResultVo getQuestionStatistic(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.getQuestionStatistic(params));
    }

    /*
     * @Description 教学统计
     * @Date 2024/7/23 12:20:34
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/teach_statistic")
    public ResultVo getTeachingStatistic(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.getTeachingStatistic(params));
    }

    /*
     * @Description 常用应用
     * @Date 2024/7/23 14:44:52
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/user_module")
    public ResultVo listUserModules(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer belongcode = params.getBelongcode();
        N_Utils.validation(new Object[]{userid, "用户ID", 1,belongcode,"归属",1});
        return new ResultVo(0, componentService.listUserModules(params));
    }

    /*
     * @Description 考试-待出卷
     * @Date 2024/7/23 15:00:42
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/exam_paper_giv")
    public ResultVo listExamPaperGiv(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.listExamPaperGiv(params));
    }

    /*
     * @Description 考试-待批阅
     * @Date 2024/7/23 15:13:03
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/exam_paper_check")
    public ResultVo listExamPaperCheck(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.listExamPaperCheck(params));
    }

    /*
     * @Description 考试待监考
     * @Date 2024/7/23 15:26:09
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/exam_invigilate")
    public ResultVo listExamInvigilate(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.listExamInvigilate(params));
    }

    /*
     * @Description 考试-校级报告
     * @Date 2024/7/23 16:33:08
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/exam_report_school")
    public ResultVo getExamReportSchool(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.getExamReportSchool(params));
    }

    /*
     * @Description 考试-班级报告
     * @Date 2024/7/23 17:58:10
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/exam_report_class")
    public ResultVo getExamReportClass(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.getExamReportClass(params));
    }

    /*
     * @Description 考试-单科报告
     * @Date 2024/7/23 17:24:51
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/exam_report_single")
    public ResultVo getExamReportSingle(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.getExamReportSingle(params));
    }

    /*
     * @Description 考试-阅卷进度
     * @Date 2024/7/24 10:49:38
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/exam_check_progress")
    public ResultVo listExamCheckProgress(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        N_Utils.validation(new Object[]{userid, "用户ID", 1});
        return new ResultVo(0, componentService.listExamCheckProgress(params));
    }

    /*
     * @Description 作业-我的
     * @Date 2024/7/25 16:26:17
     * @Author WN
     * @Param [params]
     * @Return com.xhkjedu.vo.ResultVo
     **/
    @PostMapping("/paper_my")
    public ResultVo listPaperForMy(@RequestBody ComponentParams params) {
        Integer userid = params.getUserid();
        Integer limitSize = params.getLimitSize();
        N_Utils.validation(new Object[]{userid, "用户ID", 1,limitSize, "数量", 1});
        return new ResultVo(0, componentService.listPaperForMy(params));
    }
}
