ClassesDictController.java 4.19 KB
package com.meishu.controller;


import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.classes.*;
import com.meishu.dto.exercise.ExeLatexExpressDTO;
import com.meishu.service.ClassesDictService;
import com.meishu.util.LatexUtils;
import io.swagger.annotations.ApiOperation;
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 io.swagger.annotations.Api;

/**
 * <p>
 * 学校班级字典表 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2021-08-11
 */
@RestController
@Api(tags = "学校班级字典表")
@RequestMapping("/classesDict")
public class ClassesDictController {

    @Autowired
    private ClassesDictService classesDictService;

    @PostMapping("getClasses")
    @ApiOperation("获取行政班级 {className grade  session  status} ")
    public ResponseVO getClasses(@RequestBody GetClassesDTO getClassesDTO) {
        return ResponseData.generateCreatedResponse(0, classesDictService.getClasses(getClassesDTO));
    }

    @PostMapping("addClass")
    @ApiOperation("添加班级   {classes  grade  session  subjects []  upgradeDate}")
    public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){
        return ResponseData.generateCreatedResponse(0,classesDictService.addClass(addClassDTO));
    }

    @PostMapping("updateClass")
    @ApiOperation("更新班级  {id grade classes session subject[]  upgradeDate}")
    public ResponseVO updateClass(@RequestBody AddClassDTO addClassDTO){
        return ResponseData.generateCreatedResponse(0,classesDictService.updateClass(addClassDTO));
    }

    @PostMapping("addSubjectTeacherMapping")
    @ApiOperation("将某老师配置到某班级的科目下 {addSubjectTeacherMappingDTOS[subjectId  科目id  teacherIds[]:老师id ]classId: 班级id   }")
    public ResponseVO addSubjectTeacherMapping(@RequestBody AddSubjectTeacherDTO addSubjectTeacherDTO){
        return ResponseData.generateCreatedResponse(0,classesDictService.addSubjectTeacherMapping(addSubjectTeacherDTO));
    }

    @PostMapping("getClassStudents")
    @ApiOperation("获取某班级下的学生  {pageSize  pageNum classId :班级id userName 学生 }")
    public ResponseVO getClassStudents(@RequestBody GetClassStudentsDTO getClassStudentsDTO){
        return ResponseData.generateCreatedResponse(0,classesDictService.getClassStudents(getClassStudentsDTO));
    }

    @PostMapping("queryNoClassStudents")
    @ApiOperation("获取没有班级的学生列表  {pageSize pageNum userName }")
    public ResponseVO queryNoClassStudents(@RequestBody QueryNoClassStudentsDTO queryNoClassStudentsDTO){
        return ResponseData.generateCreatedResponse(0,classesDictService.queryNoClassStudents(queryNoClassStudentsDTO));
    }

    @PostMapping("batchAddStudentToClass")
    @ApiOperation("批量添加学生到某班级里   ids[] 多个学生id  classId  班级id")
    public ResponseVO batchAddStudentToClass(@RequestBody BatchAddStudentToClassDTO batchAddStudentToClassDTO){
        return ResponseData.generateCreatedResponse(0,classesDictService.batchAddStudentToClass(batchAddStudentToClassDTO));
    }

    @PostMapping("batchDeleteStudent")
    @ApiOperation("批量移除班级  ids[] 多个学生  classId 班级id")
    public ResponseVO batchDeleteStudent(@RequestBody BatchAddStudentToClassDTO batchAddStudentToClassDTO){
        return ResponseData.generateCreatedResponse(0,classesDictService.batchDeleteStudent(batchAddStudentToClassDTO));
    }

    @PostMapping("getClassesWithPage")
    @ApiOperation("获取所有在读行政班级 ")
    public ResponseVO getClassesWithPage() {
        return ResponseData.generateCreatedResponse(0, classesDictService.getClassesWithPage());
    }


    @PostMapping("batchUpGrade")
    @ApiOperation("批量更新晋升时间  { upgradeDate 晋升时间  ids班级id}")
    public ResponseVO batchUpGrade(@RequestBody BatchUpGradeDTO batchUpGradeDTO){
        return ResponseData.generateCreatedResponse(0,classesDictService.batchUpGrade(batchUpGradeDTO));
    }


}