|
@@ -0,0 +1,40 @@
|
|
|
+package com.ym.mec.web.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
+import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
|
|
|
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
|
|
|
+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.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.RequestBody;
|
|
|
+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')")
|
|
|
+ public HttpResponseResult add(Integer userId, Integer classGroupId) throws Exception {
|
|
|
+ ClassGroupStudentMapper classStudentMapper = classGroupStudentMapperService.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId);
|
|
|
+ if (classStudentMapper == null) {
|
|
|
+ return failed("班级学生不存在");
|
|
|
+ }
|
|
|
+ classStudentMapper.setStatus(ClassGroupStudentStatusEnum.QUIT);
|
|
|
+ return succeed(classGroupStudentMapperService.update(classStudentMapper));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|