CourseChapterSectionController.java 4.4 KB

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