|
@@ -1,34 +1,33 @@
|
|
|
-package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal;
|
|
|
-
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import javax.annotation.Resource;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
-import io.swagger.v3.oas.annotations.Parameter;
|
|
|
-import io.swagger.v3.oas.annotations.Operation;
|
|
|
-
|
|
|
-import javax.validation.*;
|
|
|
-import javax.servlet.http.*;
|
|
|
-import java.util.*;
|
|
|
-import java.io.IOException;
|
|
|
+package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03;
|
|
|
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
-import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
-
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
-
|
|
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
|
|
-import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo.*;
|
|
|
-import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
|
|
|
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentRespVO;
|
|
|
+import cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.vo.Demo03StudentSaveReqVO;
|
|
|
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03CourseDO;
|
|
|
import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03GradeDO;
|
|
|
+import cn.iocoder.yudao.module.infra.dal.dataobject.demo.demo03.Demo03StudentDO;
|
|
|
import cn.iocoder.yudao.module.infra.service.demo.demo03.Demo03StudentService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
|
|
|
@Tag(name = "管理后台 - 学生")
|
|
|
@RestController
|
|
@@ -95,6 +94,47 @@ public class Demo03StudentController {
|
|
|
|
|
|
// ==================== 子表(学生课程) ====================
|
|
|
|
|
|
+ @GetMapping("/demo03-course/page")
|
|
|
+ @Operation(summary = "获得学生课程分页")
|
|
|
+ @Parameter(name = "studentId", description = "学生编号")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
+ public CommonResult<PageResult<Demo03CourseDO>> getDemo03CoursePage(PageParam pageReqVO,
|
|
|
+ @RequestParam("studentId") Long studentId) {
|
|
|
+ return success(demo03StudentService.getDemo03CoursePage(pageReqVO, studentId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/demo03-course/create")
|
|
|
+ @Operation(summary = "创建学生课程")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
|
|
|
+ public CommonResult<Long> createDemo03Course(@Valid @RequestBody Demo03CourseDO demo03Course) {
|
|
|
+ return success(demo03StudentService.createDemo03Course(demo03Course));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/demo03-course/update")
|
|
|
+ @Operation(summary = "更新学生课程")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
|
|
|
+ public CommonResult<Boolean> updateDemo03Course(@Valid @RequestBody Demo03CourseDO demo03Course) {
|
|
|
+ demo03StudentService.updateDemo03Course(demo03Course);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/demo03-course/delete")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
+ @Operation(summary = "删除学生课程")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
|
|
+ public CommonResult<Boolean> deleteDemo03Course(@RequestParam("id") Long id) {
|
|
|
+ demo03StudentService.deleteDemo03Course(id);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/demo03-course/get")
|
|
|
+ @Operation(summary = "获得学生课程")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
+ public CommonResult<Demo03CourseDO> getDemo03Course(@RequestParam("id") Long id) {
|
|
|
+ return success(demo03StudentService.getDemo03Course(id));
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/demo03-course/list-by-student-id")
|
|
|
@Operation(summary = "获得学生课程列表")
|
|
|
@Parameter(name = "studentId", description = "学生编号")
|
|
@@ -105,6 +145,47 @@ public class Demo03StudentController {
|
|
|
|
|
|
// ==================== 子表(学生班级) ====================
|
|
|
|
|
|
+ @GetMapping("/demo03-grade/page")
|
|
|
+ @Operation(summary = "获得学生班级分页")
|
|
|
+ @Parameter(name = "studentId", description = "学生编号")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
+ public CommonResult<PageResult<Demo03GradeDO>> getDemo03GradePage(PageParam pageReqVO,
|
|
|
+ @RequestParam("studentId") Long studentId) {
|
|
|
+ return success(demo03StudentService.getDemo03GradePage(pageReqVO, studentId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/demo03-grade/create")
|
|
|
+ @Operation(summary = "创建学生班级")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:create')")
|
|
|
+ public CommonResult<Long> createDemo03Grade(@Valid @RequestBody Demo03GradeDO demo03Grade) {
|
|
|
+ return success(demo03StudentService.createDemo03Grade(demo03Grade));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/demo03-grade/update")
|
|
|
+ @Operation(summary = "更新学生班级")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:update')")
|
|
|
+ public CommonResult<Boolean> updateDemo03Grade(@Valid @RequestBody Demo03GradeDO demo03Grade) {
|
|
|
+ demo03StudentService.updateDemo03Grade(demo03Grade);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/demo03-grade/delete")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
+ @Operation(summary = "删除学生班级")
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
|
|
+ public CommonResult<Boolean> deleteDemo03Grade(@RequestParam("id") Long id) {
|
|
|
+ demo03StudentService.deleteDemo03Grade(id);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/demo03-grade/get")
|
|
|
+ @Operation(summary = "获得学生班级")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
+ @PreAuthorize("@ss.hasPermission('infra:demo03-student:query')")
|
|
|
+ public CommonResult<Demo03GradeDO> getDemo03Grade(@RequestParam("id") Long id) {
|
|
|
+ return success(demo03StudentService.getDemo03Grade(id));
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/demo03-grade/get-by-student-id")
|
|
|
@Operation(summary = "获得学生班级")
|
|
|
@Parameter(name = "studentId", description = "学生编号")
|