CommonCourseController.java 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. package com.zhongzheng.controller.cmmon;
  2. import com.zhongzheng.common.core.controller.BaseController;
  3. import com.zhongzheng.common.core.domain.AjaxResult;
  4. import com.zhongzheng.common.core.page.TableDataInfo;
  5. import com.zhongzheng.framework.web.service.WxTokenService;
  6. import com.zhongzheng.modules.activity.bo.ActivityRecommendGoodsQueryBo;
  7. import com.zhongzheng.modules.activity.service.IActivityRecommendGoodsService;
  8. import com.zhongzheng.modules.activity.vo.ActivityRecommendGoodsVo;
  9. import com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo;
  10. import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
  11. import com.zhongzheng.modules.bank.bo.QuestionModuleChapterQueryBo;
  12. import com.zhongzheng.modules.bank.service.IExamQuestionService;
  13. import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
  14. import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
  15. import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
  16. import com.zhongzheng.modules.bank.vo.ExamVo;
  17. import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
  18. import com.zhongzheng.modules.course.bo.CourseHandoutsFileQueryBo;
  19. import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
  20. import com.zhongzheng.modules.course.bo.CourseSubjectQueryBo;
  21. import com.zhongzheng.modules.course.service.*;
  22. import com.zhongzheng.modules.course.vo.*;
  23. import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
  24. import com.zhongzheng.modules.goods.bo.GoodsCourseTeacherQueryBo;
  25. import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
  26. import com.zhongzheng.modules.goods.service.IGoodsCourseTeacherService;
  27. import com.zhongzheng.modules.goods.service.IGoodsService;
  28. import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
  29. import com.zhongzheng.modules.goods.vo.GoodsCourseTeacherVo;
  30. import io.swagger.annotations.Api;
  31. import io.swagger.annotations.ApiOperation;
  32. import lombok.RequiredArgsConstructor;
  33. import org.springframework.beans.factory.annotation.Autowired;
  34. import org.springframework.security.access.prepost.PreAuthorize;
  35. import org.springframework.web.bind.annotation.GetMapping;
  36. import org.springframework.web.bind.annotation.PathVariable;
  37. import org.springframework.web.bind.annotation.RequestMapping;
  38. import org.springframework.web.bind.annotation.RestController;
  39. import java.util.ArrayList;
  40. import java.util.Arrays;
  41. import java.util.List;
  42. /**
  43. * 课程Controller
  44. *
  45. * @author hjl
  46. * @date 2021-10-09
  47. */
  48. @Api(value = "游客课程访问接口", tags = {"游客程访访问接口"})
  49. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  50. @RestController
  51. @RequestMapping("/app/common/course/")
  52. public class CommonCourseController extends BaseController {
  53. private final ICourseModuleChapterService iCourseModuleChapterService;
  54. private final ICourseMenuService iCourseMenuService;
  55. private final ICourseChapterSectionService iCourseChapterSectionService;
  56. private final IGoodsCourseTeacherService iGoodsCourseTeacherService;
  57. private final ICourseSubjectService iCourseSubjectService;
  58. private final ICourseHandoutsService iCourseHandoutsService;
  59. /**
  60. * 查询课程目录结构列表
  61. */
  62. @ApiOperation("查询课程目录结构列表")
  63. @GetMapping("/menuList")
  64. public TableDataInfo<CourseUserMenuVo> menuList(CourseMenuQueryBo bo) {
  65. startPage();
  66. List<CourseUserMenuVo> list = iCourseMenuService.menuList(bo);
  67. return getDataTable(list);
  68. }
  69. @ApiOperation("查询模块与章关系列表")
  70. @GetMapping("/chapterList/{id}")
  71. public AjaxResult<List<CourseModuleChapterVo>> chapterList(@PathVariable("id" ) Long id) {
  72. List<CourseModuleChapterVo> list = iCourseModuleChapterService.getListById(id);
  73. return AjaxResult.success(list);
  74. }
  75. /**
  76. * 查询章与节关系列表
  77. */
  78. @ApiOperation("查询章与节关系列表+章卷同级展示(不带用户信息)")
  79. @GetMapping("/sectionList/{id}")
  80. public AjaxResult<List<CourseChapterSectionVo>> sectionList(@PathVariable("id" ) Long id) {
  81. List<CourseChapterSectionVo> list = iCourseChapterSectionService.getListById(id);
  82. return AjaxResult.success(list);
  83. }
  84. /**
  85. * 查询商品课程双师资绑定列表
  86. */
  87. @ApiOperation("查询商品课程双师资绑定列表")
  88. @PreAuthorize("@ss.hasPermi('system:teacher:list')")
  89. @GetMapping("/teacher/list")
  90. public AjaxResult<List<GoodsCourseTeacherVo>> list(GoodsCourseTeacherQueryBo bo) {
  91. bo.setStatus(1);
  92. List<GoodsCourseTeacherVo> list = iGoodsCourseTeacherService.queryList(bo);
  93. return AjaxResult.success(list);
  94. }
  95. /**
  96. * 查询科目列表
  97. */
  98. @ApiOperation("查询科目列表")
  99. @GetMapping("/subjectList")
  100. public AjaxResult<List<CourseSubjectVo>> getSubjectList(CourseSubjectQueryBo bo) {
  101. bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
  102. List<CourseSubjectVo> list = iCourseSubjectService.queryList(bo);
  103. return AjaxResult.success(list);
  104. }
  105. /**
  106. * 获取讲义列详细信息
  107. */
  108. @ApiOperation("获取讲义列详细信息去地址")
  109. @GetMapping("/handouts/file/detail")
  110. public AjaxResult<CourseHandoutsVo> getInfo(CourseHandoutsFileQueryBo queryBo) {
  111. CourseHandoutsVo detail = iCourseHandoutsService.queryByIdNoUrl(queryBo);
  112. return AjaxResult.success(detail);
  113. }
  114. }