1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- package com.ym.mec.web.controller;
- import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
- import com.ym.mec.biz.dal.enums.GroupType;
- import com.ym.mec.biz.service.ClassGroupStudentMapperService;
- import com.ym.mec.common.controller.BaseController;
- import com.ym.mec.common.entity.HttpResponseResult;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiImplicitParam;
- import io.swagger.annotations.ApiImplicitParams;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- @RequestMapping("classGroupStudent")
- @Api(tags = "班级学生服务")
- @RestController
- public class ClassGroupStudentController extends BaseController {
- @Autowired
- private ClassGroupStudentMapperService classGroupStudentMapperService;
- @ApiOperation(value = "删除班级学生")
- @PostMapping("/del")
- @PreAuthorize("@pcs.hasPermissions('classGroupStudent/del')")
- @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "int"),
- @ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
- public HttpResponseResult del(Integer userId, Integer classGroupId) throws Exception {
- return succeed(classGroupStudentMapperService.delClassGroupStudent(userId, classGroupId));
- }
- @ApiOperation(value = "查询班级所有学生")
- @PostMapping("/findAllStudent")
- @PreAuthorize("@pcs.hasPermissions('classGroupStudent/findAllStudent')")
- @ApiImplicitParams({@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
- public HttpResponseResult findAllStudent(Integer classGroupId) throws Exception {
- return succeed(classGroupStudentMapperService.findClassStudentList(classGroupId, ClassGroupStudentStatusEnum.NORMAL));
- }
- @ApiOperation(value = "调整班级(小班课)")
- @PostMapping("/adjustClassGroup")
- @PreAuthorize("@pcs.hasPermissions('classGroupStudent/adjustClassGroup')")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "userId", value = "学生userId", required = true, dataType = "int"),
- @ApiImplicitParam(name = "oldClassGroupId", value = "原班级id", required = true, dataType = "int"),
- @ApiImplicitParam(name = "classGroupId", value = "新班级id", required = true, dataType = "int")
- })
- public HttpResponseResult adjustClassGroup(Integer userId, Integer oldClassGroupId, Integer classGroupId) throws Exception {
- return succeed(classGroupStudentMapperService.adjustClassGroup(userId, oldClassGroupId, classGroupId));
- }
- @ApiOperation(value = "添加学生(小班课,单技班通用)")
- @PostMapping("/addStudents")
- @PreAuthorize("@pcs.hasPermissions('classGroupStudent/addStudents')")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "classGroupId", value = "小课班班级id", required = true, dataType = "int"),
- @ApiImplicitParam(name = "userIdsStr", value = "学生UserId,逗号分隔", required = true, dataType = "String")
- })
- public HttpResponseResult addStudents(Integer classGroupId, String userIdsStr) throws Exception {
- return succeed(classGroupStudentMapperService.addStudents(classGroupId, userIdsStr, GroupType.MUSIC));
- }
- }
|