package com.zhongzheng.controller.cmmon; import com.zhongzheng.common.core.controller.BaseController; import com.zhongzheng.common.core.domain.AjaxResult; import com.zhongzheng.common.core.page.TableDataInfo; import com.zhongzheng.framework.web.service.WxTokenService; import com.zhongzheng.modules.activity.bo.ActivityRecommendGoodsQueryBo; import com.zhongzheng.modules.activity.service.IActivityRecommendGoodsService; import com.zhongzheng.modules.activity.vo.ActivityRecommendGoodsVo; import com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo; import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo; import com.zhongzheng.modules.bank.bo.QuestionModuleChapterQueryBo; import com.zhongzheng.modules.bank.service.IExamQuestionService; import com.zhongzheng.modules.bank.service.IQuestionChapterExamService; import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService; import com.zhongzheng.modules.bank.vo.ExamQuestionVo; import com.zhongzheng.modules.bank.vo.ExamVo; import com.zhongzheng.modules.bank.vo.QuestionChapterVo; import com.zhongzheng.modules.course.bo.CourseHandoutsFileQueryBo; import com.zhongzheng.modules.course.bo.CourseMenuQueryBo; import com.zhongzheng.modules.course.bo.CourseSubjectQueryBo; import com.zhongzheng.modules.course.service.*; import com.zhongzheng.modules.course.vo.*; import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo; import com.zhongzheng.modules.goods.bo.GoodsCourseTeacherQueryBo; import com.zhongzheng.modules.goods.service.IGoodsAttachedService; import com.zhongzheng.modules.goods.service.IGoodsCourseTeacherService; import com.zhongzheng.modules.goods.service.IGoodsService; import com.zhongzheng.modules.goods.vo.GoodsAttachedVo; import com.zhongzheng.modules.goods.vo.GoodsCourseTeacherVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * 课程Controller * * @author hjl * @date 2021-10-09 */ @Api(value = "游客课程访问接口", tags = {"游客程访访问接口"}) @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/app/common/course/") public class CommonCourseController extends BaseController { private final ICourseModuleChapterService iCourseModuleChapterService; private final ICourseMenuService iCourseMenuService; private final ICourseChapterSectionService iCourseChapterSectionService; private final IGoodsCourseTeacherService iGoodsCourseTeacherService; private final ICourseSubjectService iCourseSubjectService; private final ICourseHandoutsService iCourseHandoutsService; /** * 查询课程目录结构列表 */ @ApiOperation("查询课程目录结构列表") @GetMapping("/menuList") public TableDataInfo menuList(CourseMenuQueryBo bo) { startPage(); List list = iCourseMenuService.menuList(bo); return getDataTable(list); } @ApiOperation("查询模块与章关系列表") @GetMapping("/chapterList/{id}") public AjaxResult> chapterList(@PathVariable("id" ) Long id) { List list = iCourseModuleChapterService.getListById(id); return AjaxResult.success(list); } /** * 查询章与节关系列表 */ @ApiOperation("查询章与节关系列表+章卷同级展示(不带用户信息)") @GetMapping("/sectionList/{id}") public AjaxResult> sectionList(@PathVariable("id" ) Long id) { List list = iCourseChapterSectionService.getListById(id); return AjaxResult.success(list); } /** * 查询商品课程双师资绑定列表 */ @ApiOperation("查询商品课程双师资绑定列表") @PreAuthorize("@ss.hasPermi('system:teacher:list')") @GetMapping("/teacher/list") public AjaxResult> list(GoodsCourseTeacherQueryBo bo) { bo.setStatus(1); List list = iGoodsCourseTeacherService.queryList(bo); return AjaxResult.success(list); } /** * 查询科目列表 */ @ApiOperation("查询科目列表") @GetMapping("/subjectList") public AjaxResult> getSubjectList(CourseSubjectQueryBo bo) { bo.setStatus(new ArrayList(Arrays.asList(1))); List list = iCourseSubjectService.queryList(bo); return AjaxResult.success(list); } /** * 获取讲义列详细信息 */ @ApiOperation("获取讲义列详细信息去地址") @GetMapping("/handouts/file/detail") public AjaxResult getInfo(CourseHandoutsFileQueryBo queryBo) { CourseHandoutsVo detail = iCourseHandoutsService.queryByIdNoUrl(queryBo); return AjaxResult.success(detail); } }