CourseChapterSectionController.java 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. package com.zhongzheng.controller.course;
  2. import java.util.HashMap;
  3. import java.util.List;
  4. import java.util.Arrays;
  5. import java.util.Map;
  6. import cn.hutool.http.HttpStatus;
  7. import com.github.pagehelper.PageInfo;
  8. import com.zhongzheng.modules.course.bo.CourseChapterSectionAddBo;
  9. import com.zhongzheng.modules.course.bo.CourseChapterSectionEditBo;
  10. import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
  11. import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
  12. import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
  13. import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
  14. import lombok.RequiredArgsConstructor;
  15. import org.springframework.security.access.prepost.PreAuthorize;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.web.bind.annotation.GetMapping;
  18. import org.springframework.web.bind.annotation.PostMapping;
  19. import org.springframework.web.bind.annotation.PutMapping;
  20. import org.springframework.web.bind.annotation.DeleteMapping;
  21. import org.springframework.web.bind.annotation.PathVariable;
  22. import org.springframework.web.bind.annotation.RequestBody;
  23. import org.springframework.web.bind.annotation.RequestMapping;
  24. import org.springframework.web.bind.annotation.RestController;
  25. import com.zhongzheng.common.annotation.Log;
  26. import com.zhongzheng.common.core.controller.BaseController;
  27. import com.zhongzheng.common.core.domain.AjaxResult;
  28. import com.zhongzheng.common.enums.BusinessType;
  29. import com.zhongzheng.common.utils.poi.ExcelUtil;
  30. import com.zhongzheng.common.core.page.TableDataInfo;
  31. import io.swagger.annotations.Api;
  32. import io.swagger.annotations.ApiOperation;
  33. /**
  34. * 章与节关系Controller
  35. *
  36. * @author hjl
  37. * @date 2021-10-12
  38. */
  39. @Api(value = "章与节关系控制器", tags = {"章与节关系管理"})
  40. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  41. @RestController
  42. @RequestMapping("/course/chapter/section")
  43. public class CourseChapterSectionController extends BaseController {
  44. private final ICourseChapterSectionService iCourseChapterSectionService;
  45. /**
  46. * 查询章与节关系列表
  47. */
  48. @ApiOperation("查询章与节关系列表")
  49. @PreAuthorize("@ss.hasPermi('system:section:list')")
  50. @GetMapping("/list/{id}")
  51. public AjaxResult<List<CourseChapterSectionVo>> list(@PathVariable("id" ) Long id) {
  52. List<CourseChapterSectionVo> list = iCourseChapterSectionService.getListById(id);
  53. return AjaxResult.success(list);
  54. }
  55. /**
  56. * 导出章与节关系列表
  57. */
  58. /* @ApiOperation("导出章与节关系列表")
  59. @PreAuthorize("@ss.hasPermi('system:section:export')")
  60. @Log(title = "章与节关系", businessType = BusinessType.EXPORT)
  61. @GetMapping("/export")
  62. public AjaxResult<CourseChapterSectionVo> export(CourseChapterSectionQueryBo bo) {
  63. List<CourseChapterSectionVo> list = iCourseChapterSectionService.queryList(bo);
  64. ExcelUtil<CourseChapterSectionVo> util = new ExcelUtil<CourseChapterSectionVo>(CourseChapterSectionVo.class);
  65. return util.exportExcel(list, "章与节关系");
  66. }*/
  67. /**
  68. * 获取章与节关系详细信息
  69. */
  70. /* @ApiOperation("获取章与节关系详细信息")
  71. @PreAuthorize("@ss.hasPermi('system:section:query')")
  72. @GetMapping("/{id}")
  73. public AjaxResult<CourseChapterSectionVo> getInfo(@PathVariable("id" ) Long id) {
  74. return AjaxResult.success(iCourseChapterSectionService.queryById(id));
  75. }*/
  76. /**
  77. * 新增章与节关系
  78. */
  79. /*@ApiOperation("新增章与节关系")
  80. @PreAuthorize("@ss.hasPermi('system:section:add')")
  81. @Log(title = "章与节关系", businessType = BusinessType.INSERT)
  82. @PostMapping()
  83. public AjaxResult<Void> add(@RequestBody CourseChapterSectionAddBo bo) {
  84. return toAjax(iCourseChapterSectionService.insertByAddBo(bo) ? 1 : 0);
  85. }*/
  86. /**
  87. * 修改章与节关系
  88. */
  89. /* @ApiOperation("修改章与节关系")
  90. @PreAuthorize("@ss.hasPermi('system:section:edit')")
  91. @Log(title = "章与节关系", businessType = BusinessType.UPDATE)
  92. @PostMapping("/edit")
  93. public AjaxResult<Void> edit(@RequestBody CourseChapterSectionEditBo bo) {
  94. return toAjax(iCourseChapterSectionService.updateByEditBo(bo) ? 1 : 0);
  95. }*/
  96. /**
  97. * 删除章与节关系
  98. */
  99. /* @ApiOperation("删除章与节关系")
  100. @PreAuthorize("@ss.hasPermi('system:section:remove')")
  101. @Log(title = "章与节关系" , businessType = BusinessType.DELETE)
  102. @PostMapping("/del/{ids}")
  103. public AjaxResult<Void> remove(@PathVariable Long[] ids) {
  104. return toAjax(iCourseChapterSectionService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
  105. }*/
  106. }