he2802 3 жил өмнө
parent
commit
09e925a3a3

+ 98 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java

@@ -0,0 +1,98 @@
+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.common.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.WxTokenService;
+import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
+import com.zhongzheng.modules.course.bo.CourseQueryBo;
+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.service.ICourseService;
+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.course.vo.CourseUserVo;
+import com.zhongzheng.modules.goods.vo.GoodsUserVo;
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
+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/")
+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;
+
+    /**
+     * 查询课程列表
+     */
+    @ApiOperation("查询商品下的课程列表")
+    @GetMapping("/courseList")
+    public TableDataInfo<CourseUserVo> courseList(CourseQueryBo bo) {
+        startPage();
+        List<CourseUserVo> list = iCourseService.courseList(bo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询课程列表
+     */
+    @ApiOperation("查询用户拥有的商品")
+    @GetMapping("/goodsList")
+    public TableDataInfo<GoodsUserVo> goodsList(CourseQueryBo bo) {
+        startPage();
+        List<GoodsUserVo> list = iCourseService.goodsList(bo);
+        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);
+    }
+}