ClassSubjectTaskController.java 8.52 KB
package com.meishu.controller;


import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.task.GetClassStudentsDTO;
import com.meishu.dto.administer.PublishTasksDTO;
import com.meishu.dto.exercise.GetExerciseRequestDTO;
import com.meishu.dto.task.*;
import com.meishu.model.ClassSubjectTaskDO;
import com.meishu.model.ExerciseDictDO;
import com.meishu.model.SubjectTreeDO;
import com.meishu.model.TaskContentDO;
import com.meishu.service.ClassSubjectTaskService;
import com.meishu.vo.task.GetExpandingsPO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import io.swagger.annotations.Api;

/**
 * <p>
 * 学习任务列表 前端控制器
 * </p>
 *
 * @author DengMin
 * @since 2021-09-16
 */
@RestController
@Api(tags = "学习任务列表")
@RequestMapping("/classSubjectTask")
public class ClassSubjectTaskController {

    @Autowired
    private ClassSubjectTaskService classSubjectTaskService;

    @GetMapping("/code")
    public String code(String telephone){
        String code = classSubjectTaskService.code(telephone);
        return code;
    }

    @PostMapping("getTeacherClass")
    @ApiOperation("获取某个老师的班级   {userId:教师id }")
    public ResponseVO getTeacherClass(@RequestBody GetClassesRequestVO getClassesRequestVO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getTeacherClass(getClassesRequestVO));
    }

    @PostMapping("publishTasks")
    @ApiOperation("老师发布学习任务  {treeName任务名称  taskType任务类型 0:预学作业  1:课后作业 2:每周推荐  treeIds:知识点  taskDate 任务日期  subjectIds 科目id userId 教师id \" +\n" +
            "关联视频vodIds  关联习题 relatedIds  publishExpandingVOS [ expandingExeIds 习题ids  expandingStudents学生ids  expandingName拓展习题名字]\" +\n" +
            "            \"   adviceLength:书面作业时间长度  书面作业时间   publishHomeworkVOS[ homeworkType 作业类型 1:附件 2:通知   homeworkContent:内容/附件  fileName 文件名称  fileSize:文件大小  fileType:文件类型 ]  }")
    public ResponseVO publishTasks(@RequestBody PublishTasksDTO publishTasksDTO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.publishTasks(publishTasksDTO));
    }

    @PostMapping("/getTaskById")
    @ApiOperation("通过科目id获取已经发布任务  { subjectId  课程id  taskType 任务类型:0 预学作业 1 课后作业 startDate  endDate  任务日期 pageSize  pageNum}")
    public ResponseVO getTaskById(@RequestBody GetTaskByIdRequestDTO getTaskByIdRequestDTO) {
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getTaskById(getTaskByIdRequestDTO));
    }

    @PostMapping("/deletePreTasksById")
    @ApiOperation("删除预发布任务   {id 任务id}")
    public ResponseVO deletePreTasks(@RequestBody ClassSubjectTaskDO classSubjectTask) {
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.deletePreTasks(classSubjectTask));
    }

    @PostMapping("/queryTaskDetail")
    @ApiOperation("通过任务id查看已发布的预学作业/课后作业详情  { id  任务id")
    public ResponseVO queryTaskDetail(@RequestBody QueryTaskDetailDTO queryTaskDetailDTO) {
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.queryTaskDetail(queryTaskDetailDTO));
    }

    @PostMapping("/getRelativeExercises")
    @ApiOperation("通过知识点获取关联习题   {treeId  知识点id userId  用户id }")
    public ResponseVO getRelativeExercises(@RequestBody GetExerciseRequestDTO getExerciseRequestDTO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRelativeExercises(getExerciseRequestDTO));
    }

    @PostMapping("/perStudentVod")
    @ApiOperation("通过任务id查看学生短视频学习情况  {  vodId  视频id  任务时间 taskDate taskId 任务id}")
    public ResponseVO perStudentVod(@RequestBody GetUserVodPlayDTO getUserVodPlayDTO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentVod(getUserVodPlayDTO));
    }

    @PostMapping("/perStudentRelateExes")
    @ApiOperation("通过任务id查看学生的关联习题完成情况 { taskId 任务id  treeId 知识点id  subjectId 科目id}")
    public ResponseVO perStudentRelateExes(@RequestBody PerStudentExesDTO perStudentExesDTO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentRelateExes(perStudentExesDTO));
    }

    @PostMapping("/exeRightRatio")
    @ApiOperation("习题班级正确率+整体正确率    {任务taskId   科目id treeId 知识点id/拓展习题 exerciseType:0 关联习题 1拓展习题 }")
    public ResponseVO exeRightRatio(@RequestBody ExeRightRatioDTO exeRightRatioPO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.exeRightRatio(exeRightRatioPO));
    }

    @PostMapping("/studentRelateDoneInfo")
    @ApiOperation("学生个人关联习题的完成度 { userId  学生id   taskId:任务id  treeId 知识点id  }")
    public ResponseVO studentRelateDoneInfo(@RequestBody StudentDoneInfoRequestVO studentDoneInfoRequestVO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.studentRelateDoneInfo(studentDoneInfoRequestVO));
    }

    @PostMapping(value = "/getExeById")
    @ApiOperation("通过id查询题目 {id 题目id }")
    public ResponseVO getExeById(@RequestBody ExerciseDictDO exerciseDict){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getExeById(exerciseDict));
    }

    @PostMapping("/getExpandings")
    @ApiOperation("通过id获取拓展题组   {id  拓展题id   userId  用户id}")
    public ResponseVO getExpandings(@RequestBody GetExpandingsPO getExpandingsPO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getExpandings(getExpandingsPO));
    }

    @PostMapping("/studentxpandingDoneInfo")
    @ApiOperation("学生个人拓展习题的完成度 {userId  学生id   taskId:任务id  treeId 知识点id}")
    public ResponseVO studentxpandingDoneInfo(@RequestBody StudentDoneInfoRequestVO studentDoneInfoRequestVO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.studentxpandingDoneInfo(studentDoneInfoRequestVO));
    }

    @PostMapping("/perStudentExpandingExes")
    @ApiOperation("通过任务id查看学生的拓展习题完成情况 { taskId 任务id   treeId 拓展习题组id }")
    public ResponseVO perStudentExpandingExes(@RequestBody PerStudentExesRequestVO perStudentExesRequestVO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentExpandingExes(perStudentExesRequestVO));
    }

    @PostMapping("/getRecommendVodByTreeId")
    @ApiOperation("获取某个学校针对某个知识点的推荐视频  {treeIds 知识点id }")
    public ResponseVO getRecommendVodByTreeId(@RequestBody GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRecommendVodByTreeId(getRecommendVodByTreeIdVO));
    }

    @PostMapping("/getRecommendExeByTreeId")
    @ApiOperation("获取某个学校针对某个知识点的推荐习题  {treeIds 知识点id}")
    public ResponseVO getRecommendExeByTreeId(@RequestBody GetRecommendExeByTreeIdVO getRecommendVodByTreeIdVO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRecommendExeByTreeId(getRecommendVodByTreeIdVO));
    }

    @PostMapping("/allNodes")
    @ApiOperation("返回知识图谱  {subjectId 科目id}")
    public ResponseVO allNodes(@RequestBody SubjectTreeDO knowledgeTree){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.allNodes(knowledgeTree));
    }

    @PostMapping("getClassStudents")
    @ApiOperation("获取多个班级里的学生 ids ")
    public ResponseVO getClassStudents(@RequestBody GetClassStudentsDTO getClassStudentsDTO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getClassStudents(getClassStudentsDTO));
    }

    @PostMapping("data")
    public void data(){
        classSubjectTaskService.data();
    }

    @PostMapping("queryTaskRelatedExercise")
    @ApiOperation("查询发布后的关联习题  taskId  contentId")
    public ResponseVO queryTaskRelatedExercise(@RequestBody TaskContentDO taskContentDO){
        return ResponseData.generateCreatedResponse(0,classSubjectTaskService.queryTaskRelatedExercise(taskContentDO));
    }

}