浏览代码

fix 小程序课程

he2802 3 年之前
父节点
当前提交
673026af0e

+ 1 - 33
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java

@@ -44,11 +44,7 @@ import java.util.List;
 public class CommonController extends BaseController {
 
     private final ICourseService iCourseService;
-    private final WxTokenService wxTokenService;
-    private final ICourseModuleChapterService iCourseModuleChapterService;
-    private final ICourseMenuService iCourseMenuService;
-    private final ICourseChapterSectionService iCourseChapterSectionService;
-    private final IGoodsAttachedService iGoodsAttachedService;
+
 
     /**
      * 查询课程列表
@@ -72,34 +68,6 @@ public class CommonController extends BaseController {
         return getDataTable(list);
     }
 
-    /**
-     * 查询课程目录结构列表
-     */
-    @ApiOperation("查询课程目录结构列表")
-    @GetMapping("/course/menuList")
-    public TableDataInfo<CourseUserMenuVo> menuList(CourseMenuQueryBo bo) {
-        startPage();
-        List<CourseUserMenuVo> list = iCourseMenuService.menuList(bo);
-        return getDataTable(list);
-    }
-
-
-    @ApiOperation("查询模块与章关系列表")
-    @GetMapping("/chapterList")
-    public AjaxResult<List<CourseUserModuleChapterVo>> chapterList(CourseMenuQueryBo bo) {
-        List<CourseUserModuleChapterVo> list = iCourseModuleChapterService.chapterList(bo);
-        return AjaxResult.success(list);
-    }
-
-    /**
-     * 查询章与节关系列表
-     */
-    @ApiOperation("查询章与节关系列表+章卷同级展示")
-    @GetMapping("/sectionList")
-    public AjaxResult<List<CourseUserChapterSectionVo>> sectionList(CourseMenuQueryBo bo) {
-        List<CourseUserChapterSectionVo> list = iCourseChapterSectionService.sectionList(bo);
-        return AjaxResult.success(list);
-    }
 
 
 }

+ 83 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonCourseController.java

@@ -0,0 +1,83 @@
+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.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.CourseMenuQueryBo;
+import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
+import com.zhongzheng.modules.course.service.ICourseMenuService;
+import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
+import com.zhongzheng.modules.course.vo.CourseUserChapterSectionVo;
+import com.zhongzheng.modules.course.vo.CourseUserMenuVo;
+import com.zhongzheng.modules.course.vo.CourseUserModuleChapterVo;
+import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
+import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
+import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+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;
+
+
+
+    /**
+     * 查询课程目录结构列表
+     */
+    @ApiOperation("查询课程目录结构列表")
+    @GetMapping("/menuList")
+    public TableDataInfo<CourseUserMenuVo> menuList(CourseMenuQueryBo bo) {
+        startPage();
+        List<CourseUserMenuVo> list = iCourseMenuService.menuList(bo);
+        return getDataTable(list);
+    }
+
+
+    @ApiOperation("查询模块与章关系列表")
+    @GetMapping("/chapterList")
+    public AjaxResult<List<CourseUserModuleChapterVo>> chapterList(CourseMenuQueryBo bo) {
+        List<CourseUserModuleChapterVo> list = iCourseModuleChapterService.chapterList(bo);
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 查询章与节关系列表
+     */
+    @ApiOperation("查询章与节关系列表+章卷同级展示")
+    @GetMapping("/sectionList")
+    public AjaxResult<List<CourseUserChapterSectionVo>> sectionList(CourseMenuQueryBo bo) {
+        List<CourseUserChapterSectionVo> list = iCourseChapterSectionService.sectionList(bo);
+        return AjaxResult.success(list);
+    }
+
+}

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserChapterSectionVo.java

@@ -85,4 +85,11 @@ public class CourseUserChapterSectionVo {
 	@Excel(name = "1 需重修")
 	@ApiModelProperty("1 需重修")
 	private Integer rebuild;
+
+	/** 直播开始时间 */
+	@ApiModelProperty("直播开始时间")
+	private Long liveStartTime;
+	/** 直播结束时间 */
+	@ApiModelProperty("直播结束时间")
+	private Long liveEndTime;
 }

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserMenuVo.java

@@ -57,6 +57,16 @@ public class CourseUserMenuVo {
 	private Integer sort;
 	@ApiModelProperty("1要重修")
 	private Integer rebuild;
+	/** 节类型 1录播 2直播 3回放 */
+	@ApiModelProperty("节类型 1录播 2直播 3回放")
+	private Integer sectionType;
+
+	/** 直播开始时间 */
+	@ApiModelProperty("直播开始时间")
+	private Long liveStartTime;
+	/** 直播结束时间 */
+	@ApiModelProperty("直播结束时间")
+	private Long liveEndTime;
 
 	/** 章模块关系 */
 	@Excel(name = "章模块关系")

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -41,6 +41,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="sectionType" column="section_type"/>
         <result property="publishStatus" column="publish_status"/>
         <result property="durationTime" column="duration_time"/>
+        <result property="liveStartTime" column="live_start_time"/>
+        <result property="liveEndTime" column="live_end_time"/>
     </resultMap>
 
 

+ 7 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml

@@ -39,6 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="menuName" column="menu_name"/>
         <result property="durationTime" column="duration_time"/>
         <result property="sort" column="sort"/>
+        <result property="sectionType" column="section_type"/>
+        <result property="liveStartTime" column="live_start_time"/>
+        <result property="liveEndTime" column="live_end_time"/>
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo"  resultMap="CourseMenuResultVo">
@@ -96,7 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     0
                 WHEN m.type = 3 THEN
                     cs.duration_time
-                END duration_time
+                END duration_time,
+            cs.section_type,
+            cs.live_start_time,
+            cs.live_end_time
         FROM
             course_menu m
                 LEFT JOIN course_module cm ON m.menu_id = cm.module_id