浏览代码

视频教学接口

花田厝 11 月之前
父节点
当前提交
6f2f72d89e
共有 36 个文件被更改,包括 2947 次插入0 次删除
  1. 60 0
      jsjp-admin/src/main/java/com/miaxis/app/controller/teachingDsp/AppTeachingDspInfoController.java
  2. 94 0
      jsjp-admin/src/main/java/com/miaxis/app/controller/teachingVideo/AppletTeachingVideoInfoController.java
  3. 164 0
      jsjp-admin/src/main/java/com/miaxis/pc/TeachingDspInfoController.java
  4. 148 0
      jsjp-admin/src/main/java/com/miaxis/pc/TeachingVideoInfoController.java
  5. 109 0
      jsjp-admin/src/main/java/com/miaxis/pc/TeachingVideoTypeInfoController.java
  6. 101 0
      jsjp-service/src/main/java/com/miaxis/file/domain/FileInfo.java
  7. 23 0
      jsjp-service/src/main/java/com/miaxis/file/mapper/FileInfoMapper.java
  8. 22 0
      jsjp-service/src/main/java/com/miaxis/file/service/IFileInfoService.java
  9. 33 0
      jsjp-service/src/main/java/com/miaxis/file/service/impl/FileInfoServiceImpl.java
  10. 27 0
      jsjp-service/src/main/java/com/miaxis/file/vo/FileVo.java
  11. 103 0
      jsjp-service/src/main/java/com/miaxis/teachingDsp/domain/TeachingDspInfo.java
  12. 38 0
      jsjp-service/src/main/java/com/miaxis/teachingDsp/dto/TeachingDspInfoDto.java
  13. 25 0
      jsjp-service/src/main/java/com/miaxis/teachingDsp/mapper/TeachingDspInfoMapper.java
  14. 78 0
      jsjp-service/src/main/java/com/miaxis/teachingDsp/service/ITeachingDspInfoService.java
  15. 244 0
      jsjp-service/src/main/java/com/miaxis/teachingDsp/service/impl/TeachingDspInfoServiceImpl.java
  16. 75 0
      jsjp-service/src/main/java/com/miaxis/teachingDsp/vo/TeachingDspInfoVo.java
  17. 87 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/domain/TeachingVideoInfo.java
  18. 55 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/domain/TeachingVideoTypeInfo.java
  19. 44 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/dto/TeachingVideoInfoDto.java
  20. 24 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/dto/TeachingVideoInfoTypeIdDto.java
  21. 24 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/dto/TeachingVideoInfoTypeSubjectDto.java
  22. 57 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/mapper/TeachingVideoInfoMapper.java
  23. 36 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/mapper/TeachingVideoTypeInfoMapper.java
  24. 100 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/service/ITeachingVideoInfoService.java
  25. 46 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/service/ITeachingVideoTypeInfoService.java
  26. 325 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/service/impl/TeachingVideoInfoServiceImpl.java
  27. 147 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/service/impl/TeachingVideoTypeInfoServiceImpl.java
  28. 57 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/AppletTeachingVideoTypeInfoVo.java
  29. 30 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/AppletTeachingVideoVo.java
  30. 60 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoInfoAppletVo.java
  31. 86 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoInfoVo.java
  32. 53 0
      jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoTypeInfoVo.java
  33. 31 0
      jsjp-service/src/main/resources/mapper/file/FileInfoMapper.xml
  34. 88 0
      jsjp-service/src/main/resources/mapper/teachingDsp/TeachingDspInfoMapper.xml
  35. 187 0
      jsjp-service/src/main/resources/mapper/teachingVideo/TeachingVideoInfoMapper.xml
  36. 66 0
      jsjp-service/src/main/resources/mapper/teachingVideo/TeachingVideoTypeInfoMapper.xml

+ 60 - 0
jsjp-admin/src/main/java/com/miaxis/app/controller/teachingDsp/AppTeachingDspInfoController.java

@@ -0,0 +1,60 @@
+package com.miaxis.app.controller.teachingDsp;
+
+import com.miaxis.common.constant.Constants;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.teachingDsp.domain.TeachingDspInfo;
+import com.miaxis.teachingDsp.service.ITeachingDspInfoService;
+import com.miaxis.teachingDsp.vo.TeachingDspInfoVo;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 【学车短视频】Controller
+ *
+ * @author miaxis
+ * @date 2021-12-09
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping(Constants.OPEN_PREFIX+"/teachingDsp/dsp")
+@Api(tags={"【app-学车短视频】"})
+public class AppTeachingDspInfoController extends BaseController {
+    @Autowired
+    private ITeachingDspInfoService teachingDspInfoService;
+
+    /**
+     * 查询学车短视频列表
+     */
+    @GetMapping("/list")
+    @ApiOperation("查询学车短视频列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<TeachingDspInfoVo> list(@ModelAttribute TeachingDspInfo teachingDspInfo){
+        startPage();
+        List<TeachingDspInfoVo> list = teachingDspInfoService.selectTeachingDspInfoList(teachingDspInfo);
+        return toResponsePageInfo(list);
+    }
+
+
+    /**
+     * 获取学车短视频详细信息
+     */
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取学车短视频详细信息")
+    public Response<TeachingDspInfoVo> getInfo(
+            @ApiParam(name = "id", value = "学车短视频参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return teachingDspInfoService.getTeachingDspDetailsById(id);
+    }
+
+
+}

+ 94 - 0
jsjp-admin/src/main/java/com/miaxis/app/controller/teachingVideo/AppletTeachingVideoInfoController.java

@@ -0,0 +1,94 @@
+package com.miaxis.app.controller.teachingVideo;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.miaxis.common.constant.Constants;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.teachingVideo.domain.TeachingVideoTypeInfo;
+import com.miaxis.teachingVideo.dto.TeachingVideoInfoTypeIdDto;
+import com.miaxis.teachingVideo.service.ITeachingVideoInfoService;
+import com.miaxis.teachingVideo.service.ITeachingVideoTypeInfoService;
+import com.miaxis.teachingVideo.vo.AppletTeachingVideoTypeInfoVo;
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 【教学视频】Controller
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/7 14:49
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping(Constants.OPEN_PREFIX+"/teachingVideo/info")
+@Api(tags={"【app-教学视频】"})
+public class AppletTeachingVideoInfoController extends BaseController {
+
+    private final ITeachingVideoInfoService teachingVideoInfoService;
+
+    private final ITeachingVideoTypeInfoService videoTypeInfoService;
+
+    @GetMapping("/typeList")
+    @ApiOperation("查询教学视频一级分类列表")
+    public Response typeList(){
+        return Response.success(videoTypeInfoService.list(new QueryWrapper<TeachingVideoTypeInfo>().eq("pid",0).eq("status",0).orderByAsc("type_sort")));
+    }
+
+    /**
+     * 查询教学视频列表1
+
+    @GetMapping("/list/{pid}")
+    @ApiOperation("查询教学视频列表")
+    public Response list(@ApiParam(name = "pid", value = "分类id", required = true)
+                             @PathVariable("pid") String pid){
+        return teachingVideoInfoService.queryTeachingVideoInfoList(pid);
+    }
+     */
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取教学视频详细信息")
+    public Response<TeachingVideoInfoVo> getInfo(
+            @ApiParam(name = "id", value = "教学视频参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return teachingVideoInfoService.getTeachingVideoDetailsById(id);
+    }
+
+
+    /**
+     * 关键字搜索教学视频
+     */
+    @GetMapping("/search")
+    @ApiOperation("关键字搜索教学视频")
+    public Response search(String keyword){
+        return teachingVideoInfoService.searchTeachingVideoInfoByKeyword(keyword);
+    }
+
+
+    /**
+     * 根据分类ID 查询教学视频
+     */
+    @GetMapping("/getTeachingVideoByTypeId")
+    @ApiOperation("根据分类ID查询教学视频")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public Response getTeachingVideoByTypeId(@ModelAttribute TeachingVideoInfoTypeIdDto teachingVideoInfoTypeIdDto){
+        startPage();
+        return teachingVideoInfoService.getTeachingVideoByTypeId(teachingVideoInfoTypeIdDto.getVideoTypeId());
+    }
+
+
+    /**
+     * 查询教学视频分类树形列表
+     */
+    @GetMapping("/treeList")
+    @ApiOperation("查询教学视频分类树形列表")
+    public Response<List<AppletTeachingVideoTypeInfoVo>> treeList(Integer[] subjects){
+        return videoTypeInfoService.selectAppletTeachingVideoTypeInfoTreeList(subjects);
+    }
+}

+ 164 - 0
jsjp-admin/src/main/java/com/miaxis/pc/TeachingDspInfoController.java

@@ -0,0 +1,164 @@
+package com.miaxis.pc;
+
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.common.exception.CustomException;
+import com.miaxis.common.utils.StringUtils;
+import com.miaxis.teachingDsp.domain.TeachingDspInfo;
+import com.miaxis.teachingDsp.dto.TeachingDspInfoDto;
+import com.miaxis.teachingDsp.service.ITeachingDspInfoService;
+import com.miaxis.teachingDsp.vo.TeachingDspInfoVo;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * 【学车短视频】Controller
+ *
+ * @author miaxis
+ * @date 2021-12-09
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/pc/teachingDsp/dsp")
+@Api(tags={"【pc-学车短视频】"})
+public class TeachingDspInfoController extends BaseController {
+    @Autowired
+    private ITeachingDspInfoService teachingDspInfoService;
+
+    /**
+     * 查询学车短视频列表
+     */
+    @PreAuthorize("@ss.hasPermi('teachingDsp:dsp:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询学车短视频列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<TeachingDspInfoVo> list(@ModelAttribute TeachingDspInfo teachingDspInfo){
+        startPage();
+        List<TeachingDspInfoVo> list = teachingDspInfoService.selectTeachingDspInfoList(teachingDspInfo);
+        return toResponsePageInfo(list);
+    }
+
+
+
+
+
+    /**
+     * 新增学车短视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingDsp:info:add')")
+    @Log(title = "新增学车短视频", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增教学视频")
+    public Response add(@RequestBody TeachingDspInfoDto teachingDspInfoDto){
+        return teachingDspInfoService.saveTeachingDsp(teachingDspInfoDto);
+    }
+
+
+    /**
+     * 修改学车短视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingDsp:info:edit')")
+    @Log(title = "修改学车短视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改学车短视频")
+    public Response edit(@RequestBody TeachingDspInfoDto teachingDspInfoDto){
+        return teachingDspInfoService.updateTeachingDspById(teachingDspInfoDto);
+    }
+
+
+    /**
+     * 删除学车短视频
+
+    @PreAuthorize("@ss.hasPermi('teachingDsp:dsp:remove')")
+    @Log(title = "学车短视频", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{ids}")
+    @ApiOperation("删除学车短视频")
+    public  Response<Integer> remove(
+            @ApiParam(name = "ids", value = "学车短视频ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return toResponse(teachingDspInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+    }
+     */
+
+    /**
+     * 删除教学视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:remove')")
+    @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping("/{ids}")
+    @ApiOperation("删除教学视频")
+    public Response remove(
+            @ApiParam(name = "ids", value = "教学视频ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return teachingDspInfoService.removeTeachingDspByIds(ids);
+    }
+
+    /**
+     * 上架短视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:putShelf')")
+    @Log(title = "上架短视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping("/putShelf/{ids}")
+    @ApiOperation("上架短视频")
+    public Response putShelf(
+            @ApiParam(name = "ids", value = "教学视频ids参数", required = true) @PathVariable Long[] ids
+    ){
+        return teachingDspInfoService.removePutShelfByIds(ids);
+    }
+
+    /**
+     * 下架短视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:offShelf')")
+    @Log(title = "下架短视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping("/offShelf/{ids}")
+    @ApiOperation("下架短视频")
+    public Response offShelf(
+            @ApiParam(name = "ids", value = "教学视频ids参数", required = true) @PathVariable Long[] ids
+    ){
+        return teachingDspInfoService.removeOffShelfByIds(ids);
+    }
+
+
+    /**
+     * 短视频封面上传
+     */
+    @Log(title = "短视频封面上传", businessType = BusinessTypeEnum.INSERT)
+    @PutMapping("/coverUp")
+    @ApiOperation("短视频封面上传")
+    public Response coverUp(MultipartFile coverFile,
+                            @ApiParam(name = "fileId",value = "云点播fileId",required = true) @RequestParam("fileId") String fileId){
+        if (StringUtils.isEmpty(fileId)){
+            throw new CustomException("视频文件未上传");
+        }
+        return teachingDspInfoService.coverUp(fileId,coverFile);
+    }
+
+    /**
+     * 获取短视频详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('teachingDsp:info:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取短视频详细信息")
+    public Response<TeachingDspInfoVo> getInfo(
+            @ApiParam(name = "id", value = "获取短视频参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return teachingDspInfoService.getTeachingDspDetailsById(id);
+    }
+
+}

+ 148 - 0
jsjp-admin/src/main/java/com/miaxis/pc/TeachingVideoInfoController.java

@@ -0,0 +1,148 @@
+package com.miaxis.pc;
+
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.common.exception.CustomException;
+import com.miaxis.common.utils.StringUtils;
+import com.miaxis.teachingVideo.domain.TeachingVideoInfo;
+import com.miaxis.teachingVideo.dto.TeachingVideoInfoDto;
+import com.miaxis.teachingVideo.service.ITeachingVideoInfoService;
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * 【教学视频】Controller
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 14:49
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/pc/teachingVideo/info")
+@Api(tags={"【pc-教学视频】"})
+public class TeachingVideoInfoController extends BaseController {
+
+    private final ITeachingVideoInfoService teachingVideoInfoService;
+
+    /**
+     * 查询教学视频列表
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询教学视频列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<TeachingVideoInfoVo> list(@ModelAttribute TeachingVideoInfo teachingVideoInfo){
+        startPage();
+        List<TeachingVideoInfoVo> list = teachingVideoInfoService.selectTeachingVideoInfoList(teachingVideoInfo);
+        return toResponsePageInfo(list);
+    }
+
+
+    /**
+     * 获取教学视频详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取教学视频详细信息")
+    public Response<TeachingVideoInfoVo> getInfo(
+            @ApiParam(name = "id", value = "教学视频参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return teachingVideoInfoService.getTeachingVideoDetailsById(id);
+    }
+
+    /**
+     * 新增教学视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:add')")
+    @Log(title = "教学视频", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增教学视频")
+    public Response add(@RequestBody TeachingVideoInfoDto teachingVideoInfo){
+        return teachingVideoInfoService.saveTeachingVideo(teachingVideoInfo);
+    }
+
+
+    /**
+     * 修改教学视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:edit')")
+    @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改教学视频")
+    public Response edit(@RequestBody TeachingVideoInfoDto teachingVideoInfo){
+        return teachingVideoInfoService.updateTeachingVideoById(teachingVideoInfo);
+    }
+
+    /**
+     * 封面上传
+     */
+    @Log(title = "教学视频", businessType = BusinessTypeEnum.INSERT)
+    @PutMapping("/coverUp")
+    @ApiOperation("封面上传")
+    public Response coverUp(MultipartFile coverFile,
+                            @ApiParam(name = "fileId",value = "云点播fileId",required = true) @RequestParam("fileId") String fileId){
+        if (StringUtils.isEmpty(fileId)){
+            throw new CustomException("视频文件未上传");
+        }
+        return teachingVideoInfoService.coverUp(fileId,coverFile);
+    }
+
+    /**
+     * 删除教学视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:remove')")
+    @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping("/{ids}")
+    @ApiOperation("删除教学视频")
+    public Response remove(
+            @ApiParam(name = "ids", value = "教学视频ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return teachingVideoInfoService.removeTeachingVideoByIds(ids);
+    }
+
+
+    /**
+     * 上架教学视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:putShelf')")
+    @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping("/putShelf/{ids}")
+    @ApiOperation("上架教学视频")
+    public Response putShelf(
+            @ApiParam(name = "ids", value = "教学视频ids参数", required = true) @PathVariable Long[] ids
+    ){
+        return teachingVideoInfoService.removePutShelfByIds(ids);
+    }
+
+    /**
+     * 下架教学视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:offShelf')")
+    @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping("/offShelf/{ids}")
+    @ApiOperation("下架教学视频")
+    public Response offShelf(
+            @ApiParam(name = "ids", value = "教学视频ids参数", required = true) @PathVariable Long[] ids
+    ){
+        return teachingVideoInfoService.removeOffShelfByIds(ids);
+    }
+
+
+
+
+
+}

+ 109 - 0
jsjp-admin/src/main/java/com/miaxis/pc/TeachingVideoTypeInfoController.java

@@ -0,0 +1,109 @@
+package com.miaxis.pc;
+
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.teachingVideo.domain.TeachingVideoTypeInfo;
+import com.miaxis.teachingVideo.service.ITeachingVideoTypeInfoService;
+import com.miaxis.teachingVideo.vo.TeachingVideoTypeInfoVo;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 【教学视频分类】Controller
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 13:45
+ */
+@AllArgsConstructor
+@RestController
+@RequestMapping("/pc/videoType/info")
+@Api(tags={"【pc-教学视频分类】"})
+public class TeachingVideoTypeInfoController extends BaseController {
+
+    private final ITeachingVideoTypeInfoService teachingVideoTypeInfoService;
+
+    /**
+     * 查询教学视频分类列表
+     */
+    @PreAuthorize("@ss.hasPermi('videoType:info:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询教学视频分类列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<TeachingVideoTypeInfo> list(@ModelAttribute TeachingVideoTypeInfo teachingVideoTypeInfo){
+        startPage();
+        List<TeachingVideoTypeInfo> list = teachingVideoTypeInfoService.selectTeachingVideoTypeInfoList(teachingVideoTypeInfo);
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 查询教学视频分类树形列表
+     */
+    @PreAuthorize("@ss.hasPermi('videoType:info:treeList')")
+    @GetMapping("/treeList")
+    @ApiOperation("查询教学视频分类树形列表")
+    public Response<List<TeachingVideoTypeInfoVo>> treeList(){
+        return teachingVideoTypeInfoService.selectTeachingVideoTypeInfoTreeList();
+    }
+
+
+    /**
+     * 获取教学视频分类详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('videoType:info:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取教学视频分类详细信息")
+    public Response<TeachingVideoTypeInfo> getInfo(
+            @ApiParam(name = "id", value = "教学视频分类参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(teachingVideoTypeInfoService.getById(id));
+    }
+
+    /**
+     * 新增教学视频分类
+     */
+    @PreAuthorize("@ss.hasPermi('videoType:info:add')")
+    @Log(title = "教学视频分类", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增教学视频分类")
+    public Response<Integer> add(@RequestBody TeachingVideoTypeInfo teachingVideoTypeInfo){
+        return toResponse(teachingVideoTypeInfoService.save(teachingVideoTypeInfo) ? 1 : 0);
+    }
+
+    /**
+     * 修改教学视频分类
+     */
+    @PreAuthorize("@ss.hasPermi('videoType:info:edit')")
+    @Log(title = "教学视频分类", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改教学视频分类")
+    public Response<Integer> edit(@RequestBody TeachingVideoTypeInfo teachingVideoTypeInfo){
+        return toResponse(teachingVideoTypeInfoService.updateById(teachingVideoTypeInfo) ? 1 : 0);
+    }
+
+    /**
+     * 删除教学视频分类
+     */
+    @PreAuthorize("@ss.hasPermi('videoType:info:remove')")
+    @Log(title = "教学视频分类", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping("/{ids}")
+    @ApiOperation("删除教学视频分类")
+    public Response remove(
+            @ApiParam(name = "ids", value = "教学视频分类ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return teachingVideoTypeInfoService.removeVideoTypeByIds(ids);
+    }
+
+
+}

+ 101 - 0
jsjp-service/src/main/java/com/miaxis/file/domain/FileInfo.java

@@ -0,0 +1,101 @@
+package com.miaxis.file.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 文件对象 file_info
+ *
+ * @author miaxis
+ * @date 2021-01-22
+ */
+@Data
+@TableName("file_info")
+@ApiModel(value = "FileInfo", description = "文件对象 file_info")
+public class FileInfo extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /** 自增id */
+    @TableId(value = "file_id")
+    @ApiModelProperty(value = "自增id")
+    private Long fileId;
+
+    /** 顺序 */
+    @Excel(name = "顺序")
+    @TableField("seq")
+    @ApiModelProperty(value = "顺序")
+    private Long seq;
+
+    /** 文件业务类型 */
+    @Excel(name = "文件业务类型")
+    @TableField("file_type")
+    @ApiModelProperty(value = "文件业务类型")
+    private String fileType;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    @TableField("remark")
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    /** 文件url(访问地址) */
+    @Excel(name = "文件url(访问地址)")
+    @TableField("file_url")
+    @ApiModelProperty(value = "文件url(访问地址)")
+    private String fileUrl;
+
+    /** 文件路径 */
+    @Excel(name = "文件路径")
+    @TableField("file_path")
+    @ApiModelProperty(value = "文件路径")
+    private String filePath;
+
+    public void setFileId(Long fileId){
+        this.fileId = fileId;
+    }
+
+    public Long getFileId(){
+        return fileId;
+    }
+    public void setSeq(Long seq){
+        this.seq = seq;
+    }
+
+    public Long getSeq(){
+        return seq;
+    }
+    public void setFileUrl(String fileUrl){
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileUrl(){
+        return fileUrl;
+    }
+    public void setFilePath(String filePath){
+        this.filePath = filePath;
+    }
+
+    public String getFilePath(){
+        return filePath;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("fileId", getFileId())
+            .append("seq", getSeq())
+            .append("fileUrl", getFileUrl())
+            .append("filePath", getFilePath())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 23 - 0
jsjp-service/src/main/java/com/miaxis/file/mapper/FileInfoMapper.java

@@ -0,0 +1,23 @@
+package com.miaxis.file.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.file.domain.FileInfo;
+
+import java.util.List;
+
+/**
+ * 文件Mapper接口
+ *
+ * @author miaxis
+ * @date 2021-01-22
+ */
+public interface FileInfoMapper extends BaseMapper<FileInfo> {
+    /**
+     * 查询文件列表
+     *
+     * @param fileInfo 文件
+     * @return 文件集合
+     */
+    public List<FileInfo> selectFileInfoList(FileInfo fileInfo);
+
+}

+ 22 - 0
jsjp-service/src/main/java/com/miaxis/file/service/IFileInfoService.java

@@ -0,0 +1,22 @@
+package com.miaxis.file.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.file.domain.FileInfo;
+
+import java.util.List;
+
+/**
+ * 文件Service接口
+ *
+ * @author miaxis
+ * @date 2021-01-22
+ */
+public interface IFileInfoService extends IService<FileInfo>{
+    /**
+     * 查询文件列表
+     *
+     * @param fileInfo 文件
+     * @return 文件集合
+     */
+    public List<FileInfo> selectFileInfoList(FileInfo fileInfo);
+}

+ 33 - 0
jsjp-service/src/main/java/com/miaxis/file/service/impl/FileInfoServiceImpl.java

@@ -0,0 +1,33 @@
+package com.miaxis.file.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.miaxis.file.domain.FileInfo;
+import com.miaxis.file.mapper.FileInfoMapper;
+import com.miaxis.file.service.IFileInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 文件Service业务层处理
+ *
+ * @author miaxis
+ * @date 2021-01-22
+ */
+@Service
+public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> implements IFileInfoService {
+    @Autowired
+    private FileInfoMapper fileInfoMapper;
+
+    /**
+     * 查询文件列表
+     *
+     * @param fileInfo 文件
+     * @return 文件
+     */
+    @Override
+    public List<FileInfo> selectFileInfoList(FileInfo fileInfo){
+        return fileInfoMapper.selectFileInfoList(fileInfo);
+    }
+}

+ 27 - 0
jsjp-service/src/main/java/com/miaxis/file/vo/FileVo.java

@@ -0,0 +1,27 @@
+package com.miaxis.file.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 文件上传vo
+ *
+ * @Author wwl
+ * @Date 2021/1/4
+ * @Version 1.0
+ */
+@Data
+public class FileVo implements Serializable {
+
+    @ApiModelProperty(value = "文件名")
+    private String fileName;
+
+    @ApiModelProperty(value = "文件路径")
+    private String filePath;
+
+    @ApiModelProperty(value = "文件访问路径")
+    private String fileUrl;
+
+}

+ 103 - 0
jsjp-service/src/main/java/com/miaxis/teachingDsp/domain/TeachingDspInfo.java

@@ -0,0 +1,103 @@
+package com.miaxis.teachingDsp.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 学车短视频对象 teaching_dsp_info
+ *
+ * @author miaxis
+ * @date 2021-12-09
+ */
+@Data
+@TableName("teaching_dsp_info")
+@ApiModel(value = "TeachingDspInfo", description = "学车短视频对象 teaching_dsp_info")
+public class TeachingDspInfo extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    /** 视频文件id */
+    @Excel(name = "视频文件id")
+    @TableField("file_id")
+    @ApiModelProperty(value = "视频文件id")
+    private Long fileId;
+
+    /** 封面图片id */
+    @Excel(name = "封面图片id")
+    @TableField("cover_file_id")
+    @ApiModelProperty(value = "封面图片id")
+    private Long coverFileId;
+
+    /** 视频标题 */
+    @Excel(name = "视频标题")
+    @TableField("title")
+    @ApiModelProperty(value = "视频标题")
+    private String title;
+
+    /** 视频描述 */
+    @Excel(name = "视频描述")
+    @TableField("video_describe")
+    @ApiModelProperty(value = "视频描述")
+    private String videoDescribe;
+
+    /** 视频时长 */
+    @Excel(name = "视频时长")
+    @TableField("video_duration")
+    @ApiModelProperty(value = "视频时长")
+    private String videoDuration;
+
+    /** 视频大小(单位:MB) */
+    @Excel(name = "视频大小(单位:MB)", readConverterExp = "单=位:MB")
+    @TableField("video_size")
+    @ApiModelProperty(value = "视频大小(单位:MB)")
+    private BigDecimal videoSize;
+
+    /** 视频高度 */
+    @Excel(name = "视频高度")
+    @TableField("video_height")
+    @ApiModelProperty(value = "视频高度")
+    private Integer videoHeight;
+
+    /** 视频宽度 */
+    @Excel(name = "视频宽度")
+    @TableField("video_width")
+    @ApiModelProperty(value = "视频宽度")
+    private Integer videoWidth;
+
+    /** 云点播视频fileId */
+    @Excel(name = "云点播视频fileId")
+    @TableField("vod_video_file_id")
+    @ApiModelProperty(value = "云点播视频fileId")
+    private String vodVideoFileId;
+
+    /** 上架状态  0:已上架、1:未上架 */
+    @Excel(name = "上架状态  0:已上架、1:未上架")
+    @TableField("shelf_status")
+    @ApiModelProperty(value = "上架状态  0:已上架、1:未上架")
+    private Integer shelfStatus;
+
+    /** 状态  0:有效(默认)、1:失效 (伪删除) */
+    @Excel(name = "状态  0:有效(默认)、1:失效 (伪删除)", readConverterExp = "伪=删除")
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private String status;
+
+
+    /** 排序 */
+    @Excel(name = "排序")
+    @TableField("sort")
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+}

+ 38 - 0
jsjp-service/src/main/java/com/miaxis/teachingDsp/dto/TeachingDspInfoDto.java

@@ -0,0 +1,38 @@
+package com.miaxis.teachingDsp.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 教学视频对象入参
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/2 14:25
+ */
+@Data
+@ApiModel(value = "TeachingDspInfoDto", description = "学车短视频对象入参")
+public class TeachingDspInfoDto implements Serializable {
+
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "视频文件id")
+    private String videoFileId;
+
+    @ApiModelProperty(value = "封面图片id")
+    private Long coverFileId;
+
+    @ApiModelProperty(value = "视频标题")
+    private String title;
+
+    @ApiModelProperty(value = "视频描述")
+    private String videoDescribe;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+
+}

+ 25 - 0
jsjp-service/src/main/java/com/miaxis/teachingDsp/mapper/TeachingDspInfoMapper.java

@@ -0,0 +1,25 @@
+package com.miaxis.teachingDsp.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.teachingDsp.domain.TeachingDspInfo;
+import com.miaxis.teachingDsp.vo.TeachingDspInfoVo;
+
+import java.util.List;
+
+/**
+ * 学车短视频Mapper接口
+ *
+ * @author miaxis
+ * @date 2021-12-09
+ */
+public interface TeachingDspInfoMapper extends BaseMapper<TeachingDspInfo> {
+    /**
+     * 查询学车短视频列表
+     *
+     * @param teachingDspInfo 学车短视频
+     * @return 学车短视频集合
+     */
+    List<TeachingDspInfoVo> selectTeachingDspInfoList(TeachingDspInfo teachingDspInfo);
+
+    TeachingDspInfoVo getTeachingDspDetailsById(Long id);
+}

+ 78 - 0
jsjp-service/src/main/java/com/miaxis/teachingDsp/service/ITeachingDspInfoService.java

@@ -0,0 +1,78 @@
+package com.miaxis.teachingDsp.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.teachingDsp.domain.TeachingDspInfo;
+import com.miaxis.teachingDsp.dto.TeachingDspInfoDto;
+import com.miaxis.teachingDsp.vo.TeachingDspInfoVo;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * 学车短视频Service接口
+ *
+ * @author miaxis
+ * @date 2021-12-09
+ */
+public interface ITeachingDspInfoService extends IService<TeachingDspInfo>{
+    /**
+     * 查询学车短视频列表
+     *
+     * @param teachingDspInfo 学车短视频
+     * @return 学车短视频集合
+     */
+    List<TeachingDspInfoVo> selectTeachingDspInfoList(TeachingDspInfo teachingDspInfo);
+
+
+    /**
+     * 上架教学视频
+     * @param ids
+     * @return
+     */
+    Response removePutShelfByIds(Long[] ids);
+
+    /**
+     * 下架教学视频
+     * @param ids
+     * @return
+     */
+    Response removeOffShelfByIds(Long[] ids);
+
+
+    /**
+     * 封面上传
+     * @param fileId
+     * @param coverFile
+     * @return
+     */
+    Response coverUp(String fileId, MultipartFile coverFile);
+
+    /**
+     * 新增学车短视频
+     * @param teachingDspInfoDto
+     * @return
+     */
+    Response saveTeachingDsp(TeachingDspInfoDto teachingDspInfoDto);
+
+    /**
+     * 修改学车短视频
+     * @param teachingDspInfoDto
+     * @return
+     */
+    Response updateTeachingDspById(TeachingDspInfoDto teachingDspInfoDto);
+
+    /**
+     * 根据ID获取学车短视频
+     * @param id
+     * @return
+     */
+    Response<TeachingDspInfoVo> getTeachingDspDetailsById(Long id);
+
+    /**
+     * 伪删除视频
+     * @param ids
+     * @return
+     */
+    Response removeTeachingDspByIds(Long[] ids);
+}

+ 244 - 0
jsjp-service/src/main/java/com/miaxis/teachingDsp/service/impl/TeachingDspInfoServiceImpl.java

@@ -0,0 +1,244 @@
+package com.miaxis.teachingDsp.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.enums.FileUploadTypeEnum;
+import com.miaxis.common.exception.CustomException;
+import com.miaxis.common.utils.bean.BeanUtils;
+import com.miaxis.file.domain.FileInfo;
+import com.miaxis.file.service.IFileInfoService;
+import com.miaxis.teachingDsp.domain.TeachingDspInfo;
+import com.miaxis.teachingDsp.dto.TeachingDspInfoDto;
+import com.miaxis.teachingDsp.mapper.TeachingDspInfoMapper;
+import com.miaxis.teachingDsp.service.ITeachingDspInfoService;
+import com.miaxis.teachingDsp.vo.TeachingDspInfoVo;
+import com.tencentcloudapi.vod.v20180717.VodClient;
+import com.tencentcloudapi.vod.v20180717.models.DescribeMediaInfosRequest;
+import com.tencentcloudapi.vod.v20180717.models.DescribeMediaInfosResponse;
+import com.tencentcloudapi.vod.v20180717.models.ModifyMediaInfoRequest;
+import com.tencentcloudapi.vod.v20180717.models.ModifyMediaInfoResponse;
+import lombok.AllArgsConstructor;
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 学车短视频Service业务层处理
+ *
+ * @author miaxis
+ * @date 2021-12-09
+ */
+@Service
+@AllArgsConstructor
+public class TeachingDspInfoServiceImpl extends ServiceImpl<TeachingDspInfoMapper, TeachingDspInfo> implements ITeachingDspInfoService {
+
+    @Autowired
+    private TeachingDspInfoMapper teachingDspInfoMapper;
+
+    private final IFileInfoService fileInfoService;
+
+    private final VodClient vodClient;
+
+    /**
+     * 查询学车短视频列表
+     *
+     * @param teachingDspInfo 学车短视频
+     * @return 学车短视频
+     */
+    @Override
+    public List<TeachingDspInfoVo> selectTeachingDspInfoList(TeachingDspInfo teachingDspInfo){
+        return teachingDspInfoMapper.selectTeachingDspInfoList(teachingDspInfo);
+    }
+
+
+    /**
+     * 上架教学视频
+     * @param ids
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response removePutShelfByIds(Long[] ids) {
+        for (Long id : ids) {
+            this.update(new UpdateWrapper<TeachingDspInfo>().set("shelf_status",0).eq("id",id));
+        }
+        return Response.success();
+    }
+
+    /**
+     * 下架教学视频
+     * @param ids
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response removeOffShelfByIds(Long[] ids) {
+        for (Long id : ids) {
+            this.update(new UpdateWrapper<TeachingDspInfo>().set("shelf_status",1).eq("id",id));
+        }
+        return Response.success();
+    }
+
+    @Override
+    public Response coverUp(String fileId, MultipartFile coverFile) {
+        try{
+            byte[] refereeFileBase64Bytes = Base64.encodeBase64(coverFile.getBytes());
+            String UpFile = new String(refereeFileBase64Bytes, "UTF-8");
+            System.out.println(UpFile);
+
+            ModifyMediaInfoRequest req = new ModifyMediaInfoRequest();
+            req.setFileId(fileId);
+            req.setCoverData(UpFile);
+
+            ModifyMediaInfoResponse resp = vodClient.ModifyMediaInfo(req);
+            JSONObject jsonObject = JSONObject.parseObject(DescribeMediaInfosResponse.toJsonString(resp));
+            String coverUrl = (String) jsonObject.get("CoverUrl");//封面访问路径
+
+            //保存封面文件信息
+            FileInfo cover = new FileInfo();
+            cover.setFileType(FileUploadTypeEnum.STUDY_DSP.getFileType());
+            cover.setFileUrl(coverUrl);
+            cover.setRemark("视频封面");
+            fileInfoService.save(cover);
+
+            return Response.success(cover);
+        }catch (Exception e){
+            throw new CustomException("系统异常");
+        }
+    }
+
+    @Override
+    public Response saveTeachingDsp(TeachingDspInfoDto teachingDspInfoDto) {
+        try{
+            //教学视频详细信息
+            TeachingDspInfo dspInfo = new TeachingDspInfo();
+            BeanUtils.copyProperties(teachingDspInfoDto,dspInfo);
+
+            //根据fileId获取云点播视频信息
+            DescribeMediaInfosRequest req = new DescribeMediaInfosRequest();
+            String[] fileId = {teachingDspInfoDto.getVideoFileId()};
+            String[] filter = {"basicInfo","metaData"};
+            req.setFileIds(fileId);
+            req.setFilters(filter);
+            DescribeMediaInfosResponse resp = vodClient.DescribeMediaInfos(req);
+            JSONObject jsonObject = JSONObject.parseObject(DescribeMediaInfosResponse.toJsonString(resp));
+            JSONArray mediaInfoSetArr = (JSONArray)jsonObject.get("MediaInfoSet");
+            JSONObject mediaInfoSetObj = (JSONObject)mediaInfoSetArr.get(0);
+            JSONObject basicInfo = (JSONObject)mediaInfoSetObj.get("BasicInfo");
+            JSONObject metaData = (JSONObject)mediaInfoSetObj.get("MetaData");
+
+            //获取视频、封面基础信息
+            String mediaUrl = (String)basicInfo.get("MediaUrl");//视频访问路径
+            String size = String.valueOf(metaData.get("Size"));//视频文件大小
+            String duration =  String.valueOf(metaData.get("Duration"));//视屏时长
+            Integer height =  (Integer)metaData.get("Height");//视屏高度
+            Integer width =  (Integer)metaData.get("Width");//视屏宽度
+
+            FileInfo media = new FileInfo();
+            media.setFileType(FileUploadTypeEnum.STUDY_DSP.getFileType());
+            media.setFileUrl(mediaUrl);
+            media.setRemark(FileUploadTypeEnum.STUDY_DSP.getInfo());
+            fileInfoService.save(media);
+
+            dspInfo.setFileId(media.getFileId());
+            dspInfo.setVideoDuration(duration);
+            BigDecimal decimalSize = BigDecimal.valueOf(Double.valueOf(size))
+                    .divide(BigDecimal.valueOf(1024), 3, BigDecimal.ROUND_HALF_UP)
+                    .divide(BigDecimal.valueOf(1024), 2, BigDecimal.ROUND_HALF_UP);
+            dspInfo.setVideoSize(decimalSize);
+            dspInfo.setVideoHeight(height);
+            dspInfo.setVideoWidth(width);
+            dspInfo.setVodVideoFileId(teachingDspInfoDto.getVideoFileId());
+            teachingDspInfoMapper.insert(dspInfo);
+
+            return Response.success();
+        } catch (Exception e) {
+            throw new CustomException("系统错误");
+        }
+    }
+
+    @Override
+    public Response updateTeachingDspById(TeachingDspInfoDto teachingDspInfoDto) {
+
+        try {
+            TeachingDspInfo dspInfo = new TeachingDspInfo();
+            BeanUtils.copyProperties(teachingDspInfoDto,dspInfo);
+
+            //判断文件id是否修改
+            TeachingDspInfo dspInfoDb = this.getById(teachingDspInfoDto.getId());
+            if (!teachingDspInfoDto.getVideoFileId().equals(dspInfoDb.getVodVideoFileId())){
+                DescribeMediaInfosRequest req = new DescribeMediaInfosRequest();
+                String[] fileId = {teachingDspInfoDto.getVideoFileId()};
+                String[] filter = {"basicInfo","metaData"};
+                req.setFileIds(fileId);
+                req.setFilters(filter);
+                DescribeMediaInfosResponse resp = vodClient.DescribeMediaInfos(req);
+                JSONObject jsonObject = JSONObject.parseObject(DescribeMediaInfosResponse.toJsonString(resp));
+                JSONArray mediaInfoSetArr = (JSONArray)jsonObject.get("MediaInfoSet");
+                JSONObject mediaInfoSetObj = (JSONObject)mediaInfoSetArr.get(0);
+                JSONObject basicInfo = (JSONObject)mediaInfoSetObj.get("BasicInfo");
+                JSONObject metaData = (JSONObject)mediaInfoSetObj.get("MetaData");
+
+                //获取视频、封面基础信息
+                String mediaUrl = (String)basicInfo.get("MediaUrl");//视频访问路径
+                String size = String.valueOf(metaData.get("Size"));//视频文件大小
+                String duration =  String.valueOf(metaData.get("Duration"));//视屏时长
+                Integer height =  (Integer)metaData.get("Height");//视屏高度
+                Integer width =  (Integer)metaData.get("Width");//视屏宽度
+
+                //保存视频文件信息
+                FileInfo media = new FileInfo();
+                media.setFileType(FileUploadTypeEnum.STUDY_MOVIE.getFileType());
+                media.setFileUrl(mediaUrl);
+                media.setRemark(FileUploadTypeEnum.STUDY_MOVIE.getInfo());
+                fileInfoService.save(media);
+
+                dspInfo.setFileId(media.getFileId());
+                dspInfo.setVideoDuration(duration);
+                BigDecimal decimalSize = BigDecimal.valueOf(Double.valueOf(size))
+                        .divide(BigDecimal.valueOf(1024), 3, BigDecimal.ROUND_HALF_UP)
+                        .divide(BigDecimal.valueOf(1024), 2, BigDecimal.ROUND_HALF_UP);
+                dspInfo.setVideoSize(decimalSize);
+                dspInfo.setVideoHeight(height);
+                dspInfo.setVideoWidth(width);
+                dspInfo.setVodVideoFileId(teachingDspInfoDto.getVideoFileId());
+            }
+
+            teachingDspInfoMapper.updateById(dspInfo);
+
+            return Response.success();
+        } catch (Exception e) {
+            throw new CustomException("系统错误");
+        }
+
+    }
+
+    /**
+     * 获取教学视频详细信息
+     * @param id
+     * @return
+     */
+    @Override
+    public Response<TeachingDspInfoVo> getTeachingDspDetailsById(Long id) {
+        TeachingDspInfoVo info = teachingDspInfoMapper.getTeachingDspDetailsById(id);
+        return Response.success(info);
+    }
+
+    @Override
+    public Response removeTeachingDspByIds(Long[] ids) {
+        for (Long id : ids) {
+            this.update(new UpdateWrapper<TeachingDspInfo>().set("status",1).eq("id",id));
+        }
+        return Response.success();
+    }
+
+
+}

+ 75 - 0
jsjp-service/src/main/java/com/miaxis/teachingDsp/vo/TeachingDspInfoVo.java

@@ -0,0 +1,75 @@
+package com.miaxis.teachingDsp.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 学车短视频对象返回参
+ * @author zhangbin
+ * @version 1.0
+ * @date 2021/12/13 14:43
+ */
+@Data
+@ApiModel(value = "TeachingDspInfoVo", description = "学车短视频对象返回参")
+public class TeachingDspInfoVo extends BaseBusinessEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "视频文件访问地址")
+    private String fileUrl;
+
+    @ApiModelProperty(value = "封面图片访问地址")
+    private String coverFileUrl;
+
+    @TableField("title")
+    @ApiModelProperty(value = "视频标题")
+    private String title;
+
+    @TableField("video_describe")
+    @ApiModelProperty(value = "视频描述")
+    private String videoDescribe;
+
+    @TableField("video_duration")
+    @ApiModelProperty(value = "视频时长")
+    private String videoDuration;
+
+    @TableField("video_size")
+    @ApiModelProperty(value = "视频大小(单位:MB)")
+    private BigDecimal videoSize;
+
+    @TableField("video_width")
+    @ApiModelProperty(value = "视频宽度")
+    private Integer videoWidth;
+
+    @TableField("video_height")
+    @ApiModelProperty(value = "视频高度")
+    private Integer videoHeight;
+
+
+    @TableField("vod_video_file_id")
+    @ApiModelProperty(value = "云点播视频fileId")
+    private String vodVideoFileId;
+
+    @TableField("shelf_status")
+    @ApiModelProperty(value = "上架状态  0:已上架、1:未上架")
+    private Integer shelfStatus;
+
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private String status;
+
+    @TableField("sort")
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+}

+ 87 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/domain/TeachingVideoInfo.java

@@ -0,0 +1,87 @@
+package com.miaxis.teachingVideo.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 教学视频对象 teaching_video_info
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 14:43
+ */
+@Data
+@TableName("teaching_video_info")
+@ApiModel(value = "TeachingVideoInfo", description = "教学视频对象 teaching_video_info")
+public class TeachingVideoInfo extends BaseBusinessEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @TableField("file_id")
+    @ApiModelProperty(value = "视频文件id")
+    private Long fileId;
+
+    @TableField("cover_file_id")
+    @ApiModelProperty(value = "封面图片id")
+    private Long coverFileId;
+
+    @TableField("title")
+    @ApiModelProperty(value = "视频标题")
+    private String title;
+
+    @TableField("video_describe")
+    @ApiModelProperty(value = "视频描述")
+    private String videoDescribe;
+
+    @TableField("video_duration")
+    @ApiModelProperty(value = "视频时长")
+    private String videoDuration;
+
+    @TableField("video_size")
+    @ApiModelProperty(value = "视频大小(单位:MB)")
+    private BigDecimal videoSize;
+
+    @TableField("video_width")
+    @ApiModelProperty(value = "视频宽度")
+    private Integer videoWidth;
+
+    @TableField("video_height")
+    @ApiModelProperty(value = "视频高度")
+    private Integer videoHeight;
+
+    @TableField("teaching_video_type_id")
+    @ApiModelProperty(value = "教学视频分类id (关联teaching_video_type_info表)")
+    private Long teachingVideoTypeId;
+
+    @TableField("vod_video_file_id")
+    @ApiModelProperty(value = "云点播视频fileId")
+    private String vodVideoFileId;
+
+    @TableField("shelf_status")
+    @ApiModelProperty(value = "上架状态  0:已上架、1:未上架")
+    private Integer shelfStatus;
+
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private String status;
+
+    @TableField("sort")
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    @TableField("permission")
+    @ApiModelProperty(value = "排序")
+    private Integer permission;
+
+
+}

+ 55 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/domain/TeachingVideoTypeInfo.java

@@ -0,0 +1,55 @@
+package com.miaxis.teachingVideo.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 教学视频分类对象 teaching_video_type_info
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 13:47
+ */
+@Data
+@TableName("teaching_video_type_info")
+@ApiModel(value = "TeachingVideoTypeInfo", description = "教学视频分类对象 teaching_video_type_info")
+public class TeachingVideoTypeInfo extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @TableField("type_name")
+    @ApiModelProperty(value = "类型名称")
+    private String typeName;
+
+    @TableField("pid")
+    @ApiModelProperty(value = "父节点(预留)")
+    private Long pid;
+
+    @TableField("type_describe")
+    @ApiModelProperty(value = "类型描述,该类型名称的描述")
+    private String typeDescribe;
+
+    @TableField("type_icon")
+    @ApiModelProperty(value = "类型图标--对应file_info的id")
+    private Long typeIcon;
+
+    @TableField("type_sort")
+    @ApiModelProperty(value = "排序")
+    private Integer typeSort;
+
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private String status;
+
+    @TableField("subject")
+    @ApiModelProperty(value = "所属科目")
+    private Integer subject;
+
+}

+ 44 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/dto/TeachingVideoInfoDto.java

@@ -0,0 +1,44 @@
+package com.miaxis.teachingVideo.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 教学视频对象入参
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/2 14:25
+ */
+@Data
+@ApiModel(value = "TeachingVideoInfoDto", description = "教学视频对象入参")
+public class TeachingVideoInfoDto implements Serializable {
+
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "视频文件id")
+    private String videoFileId;
+
+    @ApiModelProperty(value = "封面图片id")
+    private Long coverFileId;
+
+    @ApiModelProperty(value = "视频标题")
+    private String title;
+
+    @ApiModelProperty(value = "视频描述")
+    private String videoDescribe;
+
+    @ApiModelProperty(value = "教学视频分类id (关联teaching_video_type_info表)")
+    private Long teachingVideoTypeId;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    @ApiModelProperty(value = "播放权限 0:正常 1:播放15秒  2:无法播放")
+    private Integer permission;
+
+
+}

+ 24 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/dto/TeachingVideoInfoTypeIdDto.java

@@ -0,0 +1,24 @@
+package com.miaxis.teachingVideo.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 教学视频对象入参
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/2 14:25
+ */
+@Data
+@ApiModel(value = "TeachingVideoInfoTypeIdDto", description = "教学视频ID对象")
+public class TeachingVideoInfoTypeIdDto implements Serializable {
+
+
+    @ApiModelProperty(value = "教学视频分类id (关联teaching_video_type_info表)")
+    private Long videoTypeId;
+
+
+}

+ 24 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/dto/TeachingVideoInfoTypeSubjectDto.java

@@ -0,0 +1,24 @@
+package com.miaxis.teachingVideo.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 教学视频对象入参
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/2 14:25
+ */
+@Data
+@ApiModel(value = "TeachingVideoInfoTypeSubjectDto", description = "教学视频subject对象")
+public class TeachingVideoInfoTypeSubjectDto implements Serializable {
+
+
+    @ApiModelProperty(value = "所属科目")
+    private Integer subject;
+
+
+}

+ 57 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/mapper/TeachingVideoInfoMapper.java

@@ -0,0 +1,57 @@
+package com.miaxis.teachingVideo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.teachingVideo.domain.TeachingVideoInfo;
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoAppletVo;
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 教学视频Mapper接口
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 14:45
+ */
+public interface TeachingVideoInfoMapper extends BaseMapper<TeachingVideoInfo> {
+
+    /**
+     * 查询教学视频列表
+     *
+     * @param teachingVideoInfo 教学视频
+     * @return 教学视频集合
+     */
+    List<TeachingVideoInfoVo> selectTeachingVideoInfoList(TeachingVideoInfo teachingVideoInfo);
+
+    /**
+     * 获取教学视频详细信息
+     * @param id
+     * @return
+     */
+    TeachingVideoInfoVo getTeachingVideoDetailsById(Long id);
+
+    /**
+     * 根据视频分类查询教学视频列表
+     * @param pid
+     * @return
+     */
+    List<TeachingVideoInfoAppletVo> getTeachingVideoDetailsByTypeIds(String pid);
+
+    /***
+     * 根据关键字搜索教学视频
+     * @param keyword
+     * @return
+     */
+    List<TeachingVideoInfoAppletVo> searchTeachingVideoInfoByKeyword(@Param("keyword") String keyword);
+
+
+    /**
+     * 根据类型ID获取视频
+     * @param typeId
+     * @return
+     */
+    List<TeachingVideoInfoAppletVo> getTeachingVideoByTypeId(Long typeId);
+
+    List<TeachingVideoInfoAppletVo> selectTeachingVideoInfoListByType();
+}

+ 36 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/mapper/TeachingVideoTypeInfoMapper.java

@@ -0,0 +1,36 @@
+package com.miaxis.teachingVideo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.teachingVideo.domain.TeachingVideoTypeInfo;
+import com.miaxis.teachingVideo.vo.AppletTeachingVideoTypeInfoVo;
+import com.miaxis.teachingVideo.vo.TeachingVideoTypeInfoVo;
+
+import java.util.List;
+
+/**
+ * 教学视频分类mapper接口
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 13:53
+ */
+public interface TeachingVideoTypeInfoMapper extends BaseMapper<TeachingVideoTypeInfo> {
+    /**
+     * 查询教学视频分类列表
+     *
+     * @param teachingVideoTypeInfo 教学视频分类
+     * @return 教学视频分类集合
+     */
+    List<TeachingVideoTypeInfo> selectTeachingVideoTypeInfoList(TeachingVideoTypeInfo teachingVideoTypeInfo);
+
+    /**
+     * 查询教学视频分类树形列表
+     * @return
+     */
+    List<TeachingVideoTypeInfoVo> selectTeachingVideoTypeInfoTreeList();
+
+    /**
+     * 查询教学视频分类树形列表
+     * @return
+     */
+    List<AppletTeachingVideoTypeInfoVo> selectAppletTeachingVideoTypeInfoTreeList(Integer[] subject);
+}

+ 100 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/service/ITeachingVideoInfoService.java

@@ -0,0 +1,100 @@
+package com.miaxis.teachingVideo.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.teachingVideo.domain.TeachingVideoInfo;
+import com.miaxis.teachingVideo.dto.TeachingVideoInfoDto;
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * 教学视频Service接口
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 14:47
+ */
+public interface ITeachingVideoInfoService extends IService<TeachingVideoInfo> {
+
+    /**
+     * 查询教学视频列表
+     *
+     * @param teachingVideoInfo 教学视频
+     * @return 教学视频集合
+     */
+    List<TeachingVideoInfoVo> selectTeachingVideoInfoList(TeachingVideoInfo teachingVideoInfo);
+
+    /**
+     * 获取教学视频详细信息
+     * @param id
+     * @return
+     */
+    Response<TeachingVideoInfoVo> getTeachingVideoDetailsById(Long id);
+
+    /**
+     *  新增教学视频
+     * @param teachingVideoInfo
+     * @return
+     */
+    Response saveTeachingVideo(TeachingVideoInfoDto teachingVideoInfo);
+
+    /**
+     * 修改教学视频
+     * @param teachingVideoInfo
+     * @return
+     */
+    Response updateTeachingVideoById(TeachingVideoInfoDto teachingVideoInfo);
+
+    /**
+     * 删除教学视频(伪删除)
+     * @param ids
+     * @return
+     */
+    Response<Integer> removeTeachingVideoByIds(Long[] ids);
+
+
+    /**
+     * 上架教学视频
+     * @param ids
+     * @return
+     */
+    Response removePutShelfByIds(Long[] ids);
+
+    /**
+     * 下架教学视频
+     * @param ids
+     * @return
+     */
+    Response removeOffShelfByIds(Long[] ids);
+
+    /**
+     * applet
+     * 查询教学视频列表
+     * @param pid
+     * @return
+     */
+    Response queryTeachingVideoInfoList(String pid);
+
+    /**
+     * 根据关键字搜索教学视频
+     * @param keyword
+     * @return
+     */
+    Response searchTeachingVideoInfoByKeyword(String keyword);
+
+    /**
+     * 封面上传
+     * @param fileId
+     * @param coverFile
+     * @return
+     */
+    Response coverUp(String fileId, MultipartFile coverFile);
+
+    /**
+     * 根据类型ID搜索教学视频
+     * @param typeId
+     * @return
+     */
+    Response getTeachingVideoByTypeId(Long typeId);
+}

+ 46 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/service/ITeachingVideoTypeInfoService.java

@@ -0,0 +1,46 @@
+package com.miaxis.teachingVideo.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.teachingVideo.domain.TeachingVideoTypeInfo;
+import com.miaxis.teachingVideo.vo.AppletTeachingVideoTypeInfoVo;
+import com.miaxis.teachingVideo.vo.TeachingVideoTypeInfoVo;
+
+import java.util.List;
+
+/**
+ * 教学视频分类Service接口
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 13:51
+ */
+public interface ITeachingVideoTypeInfoService extends IService<TeachingVideoTypeInfo> {
+    /**
+     * 查询教学视频分类列表
+     *
+     * @param teachingVideoTypeInfo 教学视频分类
+     * @return 教学视频分类集合
+     */
+    List<TeachingVideoTypeInfo> selectTeachingVideoTypeInfoList(TeachingVideoTypeInfo teachingVideoTypeInfo);
+
+    /**
+     * 查询教学视频分类树形列表
+     * @return
+     */
+    Response<List<TeachingVideoTypeInfoVo>> selectTeachingVideoTypeInfoTreeList();
+
+    /**
+     * 查询教学视频分类树形列表(小程序用)
+     * @return
+     */
+    Response<List<AppletTeachingVideoTypeInfoVo>> selectAppletTeachingVideoTypeInfoTreeList(Integer[] subjects);
+
+    /**
+     * 删除教学视频分类(伪删除)
+     * @param ids
+     * @return
+     */
+    Response removeVideoTypeByIds(Long[] ids);
+
+
+}

+ 325 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/service/impl/TeachingVideoInfoServiceImpl.java

@@ -0,0 +1,325 @@
+package com.miaxis.teachingVideo.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.enums.FileUploadTypeEnum;
+import com.miaxis.common.exception.CustomException;
+import com.miaxis.common.utils.bean.BeanUtils;
+import com.miaxis.file.domain.FileInfo;
+import com.miaxis.file.service.IFileInfoService;
+import com.miaxis.teachingVideo.domain.TeachingVideoInfo;
+import com.miaxis.teachingVideo.domain.TeachingVideoTypeInfo;
+import com.miaxis.teachingVideo.dto.TeachingVideoInfoDto;
+import com.miaxis.teachingVideo.mapper.TeachingVideoInfoMapper;
+import com.miaxis.teachingVideo.service.ITeachingVideoInfoService;
+import com.miaxis.teachingVideo.service.ITeachingVideoTypeInfoService;
+import com.miaxis.teachingVideo.vo.AppletTeachingVideoVo;
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoAppletVo;
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
+import com.tencentcloudapi.vod.v20180717.VodClient;
+import com.tencentcloudapi.vod.v20180717.models.DescribeMediaInfosRequest;
+import com.tencentcloudapi.vod.v20180717.models.DescribeMediaInfosResponse;
+import com.tencentcloudapi.vod.v20180717.models.ModifyMediaInfoRequest;
+import com.tencentcloudapi.vod.v20180717.models.ModifyMediaInfoResponse;
+import lombok.AllArgsConstructor;
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 教学视频Service业务层处理
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 14:48
+ */
+@Service
+@AllArgsConstructor
+public class TeachingVideoInfoServiceImpl extends ServiceImpl<TeachingVideoInfoMapper, TeachingVideoInfo> implements ITeachingVideoInfoService {
+
+    private final TeachingVideoInfoMapper teachingVideoInfoMapper;
+
+    private final IFileInfoService fileInfoService;
+
+    private final VodClient vodClient;
+
+    private final ITeachingVideoTypeInfoService videoTypeInfoService;
+
+    /**
+     * 查询教学视频列表
+     *
+     * @param teachingVideoInfo 教学视频
+     * @return 教学视频
+     */
+    @Override
+    public List<TeachingVideoInfoVo> selectTeachingVideoInfoList(TeachingVideoInfo teachingVideoInfo){
+        return teachingVideoInfoMapper.selectTeachingVideoInfoList(teachingVideoInfo);
+    }
+
+    /**
+     * 获取教学视频详细信息
+     * @param id
+     * @return
+     */
+    @Override
+    public Response<TeachingVideoInfoVo> getTeachingVideoDetailsById(Long id) {
+        TeachingVideoInfoVo info = teachingVideoInfoMapper.getTeachingVideoDetailsById(id);
+        return Response.success(info);
+    }
+
+    /**
+     * 新增教学视频
+     * @param teachingVideoInfo
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response saveTeachingVideo(TeachingVideoInfoDto teachingVideoInfo) {
+
+        try{
+            //教学视频详细信息
+            TeachingVideoInfo videoInfo = new TeachingVideoInfo();
+            BeanUtils.copyProperties(teachingVideoInfo,videoInfo);
+
+            //根据fileId获取云点播视频信息
+            DescribeMediaInfosRequest req = new DescribeMediaInfosRequest();
+            String[] fileId = {teachingVideoInfo.getVideoFileId()};
+            String[] filter = {"basicInfo","metaData"};
+            req.setFileIds(fileId);
+            req.setFilters(filter);
+            DescribeMediaInfosResponse resp = vodClient.DescribeMediaInfos(req);
+            JSONObject jsonObject = JSONObject.parseObject(DescribeMediaInfosResponse.toJsonString(resp));
+            JSONArray mediaInfoSetArr = (JSONArray)jsonObject.get("MediaInfoSet");
+            JSONObject mediaInfoSetObj = (JSONObject)mediaInfoSetArr.get(0);
+            JSONObject basicInfo = (JSONObject)mediaInfoSetObj.get("BasicInfo");
+            JSONObject metaData = (JSONObject)mediaInfoSetObj.get("MetaData");
+
+            //获取视频、封面基础信息
+            String mediaUrl = (String)basicInfo.get("MediaUrl");//视频访问路径
+            String size = String.valueOf(metaData.get("Size"));//视频文件大小
+            String duration =  String.valueOf(metaData.get("Duration"));//视屏时长
+            Integer height =  (Integer)metaData.get("Height");//视屏高度
+            Integer width =  (Integer)metaData.get("Width");//视屏宽度
+
+            FileInfo media = new FileInfo();
+            media.setFileType(FileUploadTypeEnum.STUDY_MOVIE.getFileType());
+            media.setFileUrl(mediaUrl);
+            media.setRemark(FileUploadTypeEnum.STUDY_MOVIE.getInfo());
+            fileInfoService.save(media);
+
+            videoInfo.setFileId(media.getFileId());
+            videoInfo.setVideoDuration(duration);
+            BigDecimal decimalSize = BigDecimal.valueOf(Double.valueOf(size))
+                    .divide(BigDecimal.valueOf(1024), 3, BigDecimal.ROUND_HALF_UP)
+                    .divide(BigDecimal.valueOf(1024), 2, BigDecimal.ROUND_HALF_UP);
+            videoInfo.setVideoSize(decimalSize);
+            videoInfo.setVideoHeight(height);
+            videoInfo.setVideoWidth(width);
+            videoInfo.setVodVideoFileId(teachingVideoInfo.getVideoFileId());
+            teachingVideoInfoMapper.insert(videoInfo);
+
+            return Response.success();
+        } catch (Exception e) {
+            throw new CustomException("系统错误");
+        }
+
+    }
+
+    /**
+     * 修改教学视频
+     * @param teachingVideoInfo
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response updateTeachingVideoById(TeachingVideoInfoDto teachingVideoInfo) {
+        try {
+
+            TeachingVideoInfo info = new TeachingVideoInfo();
+            BeanUtils.copyProperties(teachingVideoInfo,info);
+
+            //判断文件id是否修改
+            TeachingVideoInfo videoInfo = this.getById(teachingVideoInfo.getId());
+            if (!teachingVideoInfo.getVideoFileId().equals(videoInfo.getVodVideoFileId())){
+                DescribeMediaInfosRequest req = new DescribeMediaInfosRequest();
+                String[] fileId = {teachingVideoInfo.getVideoFileId()};
+                String[] filter = {"basicInfo","metaData"};
+                req.setFileIds(fileId);
+                req.setFilters(filter);
+                DescribeMediaInfosResponse resp = vodClient.DescribeMediaInfos(req);
+                JSONObject jsonObject = JSONObject.parseObject(DescribeMediaInfosResponse.toJsonString(resp));
+                JSONArray mediaInfoSetArr = (JSONArray)jsonObject.get("MediaInfoSet");
+                JSONObject mediaInfoSetObj = (JSONObject)mediaInfoSetArr.get(0);
+                JSONObject basicInfo = (JSONObject)mediaInfoSetObj.get("BasicInfo");
+                JSONObject metaData = (JSONObject)mediaInfoSetObj.get("MetaData");
+
+                //获取视频、封面基础信息
+                String mediaUrl = (String)basicInfo.get("MediaUrl");//视频访问路径
+                String size = String.valueOf(metaData.get("Size"));//视频文件大小
+                String duration =  String.valueOf(metaData.get("Duration"));//视屏时长
+                Integer height =  (Integer)metaData.get("Height");//视屏高度
+                Integer width =  (Integer)metaData.get("Width");//视屏宽度
+
+                //保存视频文件信息
+                FileInfo media = new FileInfo();
+                media.setFileType(FileUploadTypeEnum.STUDY_MOVIE.getFileType());
+                media.setFileUrl(mediaUrl);
+                media.setRemark(FileUploadTypeEnum.STUDY_MOVIE.getInfo());
+                fileInfoService.save(media);
+
+                info.setFileId(media.getFileId());
+                info.setVideoDuration(duration);
+                BigDecimal decimalSize = BigDecimal.valueOf(Double.valueOf(size))
+                        .divide(BigDecimal.valueOf(1024), 3, BigDecimal.ROUND_HALF_UP)
+                        .divide(BigDecimal.valueOf(1024), 2, BigDecimal.ROUND_HALF_UP);
+                info.setVideoSize(decimalSize);
+                info.setVideoHeight(height);
+                info.setVideoWidth(width);
+                info.setVodVideoFileId(teachingVideoInfo.getVideoFileId());
+            }
+
+            teachingVideoInfoMapper.updateById(info);
+
+            return Response.success();
+        } catch (Exception e) {
+            throw new CustomException("系统错误");
+        }
+    }
+
+
+    /**
+     * 删除教学视频(伪删除)
+     * @param ids
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response removeTeachingVideoByIds(Long[] ids) {
+        for (Long id : ids) {
+            this.update(new UpdateWrapper<TeachingVideoInfo>().set("status",1).eq("id",id));
+        }
+        return Response.success();
+    }
+
+    /**
+     * 上架教学视频
+     * @param ids
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response removePutShelfByIds(Long[] ids) {
+        for (Long id : ids) {
+            this.update(new UpdateWrapper<TeachingVideoInfo>().set("shelf_status",0).eq("id",id));
+        }
+        return Response.success();
+    }
+
+    /**
+     * 下架教学视频
+     * @param ids
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response removeOffShelfByIds(Long[] ids) {
+        for (Long id : ids) {
+            this.update(new UpdateWrapper<TeachingVideoInfo>().set("shelf_status",1).eq("id",id));
+        }
+        return Response.success();
+    }
+
+    /**
+     * applet
+     * 查询教学视频列表
+     * @param pid
+     * @return
+     */
+    @Override
+    public Response queryTeachingVideoInfoList(String pid) {
+
+        ArrayList<AppletTeachingVideoVo> appletVideoVos = new ArrayList<>();
+
+        //获取pid下的二级分类id
+        List<TeachingVideoTypeInfo> typeInfos = videoTypeInfoService.list(new QueryWrapper<TeachingVideoTypeInfo>().eq("pid", pid).eq("status", 0).orderByAsc("type_sort"));
+        List<TeachingVideoInfoAppletVo> appletVos = teachingVideoInfoMapper.getTeachingVideoDetailsByTypeIds(pid);
+
+        for (TeachingVideoTypeInfo typeInfo : typeInfos) {
+            AppletTeachingVideoVo videoVo = new AppletTeachingVideoVo();
+            videoVo.setTypeName(typeInfo.getTypeName());
+            videoVo.setList(appletVos
+                    .parallelStream()
+                    .filter(f -> f.getTeachingVideoTypeId().toString().equals(typeInfo.getId().toString()))
+                    .collect(Collectors.toList()));
+            appletVideoVos.add(videoVo);
+        }
+
+        return Response.success(appletVideoVos);
+    }
+
+    /**
+     * 根据关键字搜索教学视频
+     * @param keyword
+     * @return
+     */
+    @Override
+    public Response searchTeachingVideoInfoByKeyword(String keyword) {
+
+        return Response.success(teachingVideoInfoMapper.searchTeachingVideoInfoByKeyword(keyword));
+    }
+
+    /**
+     * 封面上传
+     * @param fileId
+     * @param coverFile
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response coverUp(String fileId, MultipartFile coverFile) {
+        try{
+            byte[] refereeFileBase64Bytes = Base64.encodeBase64(coverFile.getBytes());
+            String UpFile = new String(refereeFileBase64Bytes, "UTF-8");
+            System.out.println(UpFile);
+
+            ModifyMediaInfoRequest req = new ModifyMediaInfoRequest();
+            req.setFileId(fileId);
+            req.setCoverData(UpFile);
+
+            ModifyMediaInfoResponse resp = vodClient.ModifyMediaInfo(req);
+
+            JSONObject jsonObject = JSONObject.parseObject(DescribeMediaInfosResponse.toJsonString(resp));
+            String coverUrl = (String) jsonObject.get("CoverUrl");//封面访问路径
+
+            //保存封面文件信息
+            FileInfo cover = new FileInfo();
+            cover.setFileType(FileUploadTypeEnum.STUDY_MOVIE.getFileType());
+            cover.setFileUrl(coverUrl);
+            cover.setRemark("视频封面");
+            fileInfoService.save(cover);
+
+            return Response.success(cover);
+        }catch (Exception e){
+            throw new CustomException("系统异常");
+        }
+
+    }
+
+    @Override
+    @Cacheable(cacheNames="video",key="'getTeachingVideoByTypeId'+#typeId")
+    public Response getTeachingVideoByTypeId(Long typeId) {
+        return Response.success(teachingVideoInfoMapper.getTeachingVideoByTypeId(typeId));
+    }
+
+
+}

+ 147 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/service/impl/TeachingVideoTypeInfoServiceImpl.java

@@ -0,0 +1,147 @@
+package com.miaxis.teachingVideo.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.teachingVideo.domain.TeachingVideoTypeInfo;
+import com.miaxis.teachingVideo.mapper.TeachingVideoInfoMapper;
+import com.miaxis.teachingVideo.mapper.TeachingVideoTypeInfoMapper;
+import com.miaxis.teachingVideo.service.ITeachingVideoTypeInfoService;
+import com.miaxis.teachingVideo.vo.AppletTeachingVideoTypeInfoVo;
+import com.miaxis.teachingVideo.vo.TeachingVideoTypeInfoVo;
+import lombok.AllArgsConstructor;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 教学视频分类Service业务层处理
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 13:52
+ */
+@Service
+@AllArgsConstructor
+public class TeachingVideoTypeInfoServiceImpl extends ServiceImpl<TeachingVideoTypeInfoMapper, TeachingVideoTypeInfo> implements ITeachingVideoTypeInfoService {
+
+    private final TeachingVideoTypeInfoMapper teachingVideoTypeInfoMapper;
+    private final TeachingVideoInfoMapper teachingVideoInfoMapper;
+
+
+    /**
+     * 查询教学视频分类列表
+     *
+     * @param teachingVideoTypeInfo 教学视频分类
+     * @return 教学视频分类
+     */
+    @Override
+    public List<TeachingVideoTypeInfo> selectTeachingVideoTypeInfoList(TeachingVideoTypeInfo teachingVideoTypeInfo){
+        return teachingVideoTypeInfoMapper.selectTeachingVideoTypeInfoList(teachingVideoTypeInfo);
+    }
+
+    /**
+     * 查询教学视频分类树形列表
+     * @return
+     */
+    @Override
+    public Response<List<TeachingVideoTypeInfoVo>> selectTeachingVideoTypeInfoTreeList() {
+        List<TeachingVideoTypeInfoVo> list = teachingVideoTypeInfoMapper.selectTeachingVideoTypeInfoTreeList();
+        return Response.success(builTree(list));
+    }
+
+    //建立树形结构
+    public List<TeachingVideoTypeInfoVo> builTree(List<TeachingVideoTypeInfoVo> productList){
+        List<TeachingVideoTypeInfoVo> infoVos =new ArrayList<>();
+        //获取根节点
+        List<TeachingVideoTypeInfoVo> rootMenuLists =new  ArrayList<>();
+        for(TeachingVideoTypeInfoVo productType : productList) {
+            if(productType.getPid().toString().equals("0")) {
+                rootMenuLists.add(productType);
+            }
+        }
+        for(TeachingVideoTypeInfoVo productTypeInfoVo : rootMenuLists) {
+            productTypeInfoVo=getTree(productTypeInfoVo,productList);
+            infoVos.add(productTypeInfoVo);
+        }
+        return infoVos;
+    }
+    //递归,建立子树形结构
+    private TeachingVideoTypeInfoVo getTree(TeachingVideoTypeInfoVo productTypeInfo,List<TeachingVideoTypeInfoVo> menuList){
+        List<TeachingVideoTypeInfoVo> infoVos = new ArrayList<>();
+        for (TeachingVideoTypeInfoVo productTypeInfoVo : menuList) {
+            if (productTypeInfoVo.getPid().toString().equals(productTypeInfo.getId().toString())){
+                infoVos.add(getTree(productTypeInfoVo,menuList));
+            }
+        }
+        productTypeInfo.setChildren(infoVos);
+        return productTypeInfo;
+    }
+
+    /**
+     * 删除教学视频分类(伪删除)
+     * @param ids
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response removeVideoTypeByIds(Long[] ids) {
+        for (Long id : ids) {
+            this.update(new UpdateWrapper<TeachingVideoTypeInfo>().set("status",1).eq("id",id));
+        }
+        return Response.success();
+    }
+
+
+
+    /**
+     * 查询教学视频分类树形列表
+     * @return
+     */
+    @Cacheable(cacheNames="video",key="'selectAppletTeachingVideoTypeInfoTreeList'+#subjects")
+    @Override
+    public Response<List<AppletTeachingVideoTypeInfoVo>> selectAppletTeachingVideoTypeInfoTreeList(Integer[] subjects) {
+
+        List<AppletTeachingVideoTypeInfoVo> list = teachingVideoTypeInfoMapper.selectAppletTeachingVideoTypeInfoTreeList(subjects);
+        for (AppletTeachingVideoTypeInfoVo productTypeInfoVo : list) {
+            if(!"0".equals(productTypeInfoVo.getPid())){
+                PageHelper.startPage(1, 4, "sort");
+                productTypeInfoVo.setVideos(teachingVideoInfoMapper.getTeachingVideoByTypeId(productTypeInfoVo.getId()));
+            }
+        }
+
+        return Response.success(builTree2(list));
+    }
+
+    //建立树形结构
+    public List<AppletTeachingVideoTypeInfoVo> builTree2(List<AppletTeachingVideoTypeInfoVo> productList){
+        List<AppletTeachingVideoTypeInfoVo> infoVos =new ArrayList<>();
+        //获取根节点
+        List<AppletTeachingVideoTypeInfoVo> rootMenuLists =new  ArrayList<>();
+        for(AppletTeachingVideoTypeInfoVo productType : productList) {
+            if(productType.getPid().toString().equals("0")) {
+                rootMenuLists.add(productType);
+            }
+        }
+        for(AppletTeachingVideoTypeInfoVo productTypeInfoVo : rootMenuLists) {
+            productTypeInfoVo=getTree2(productTypeInfoVo,productList);
+            infoVos.add(productTypeInfoVo);
+        }
+        return infoVos;
+    }
+    //递归,建立子树形结构
+    private AppletTeachingVideoTypeInfoVo getTree2(AppletTeachingVideoTypeInfoVo productTypeInfo,List<AppletTeachingVideoTypeInfoVo> menuList){
+        List<AppletTeachingVideoTypeInfoVo> infoVos = new ArrayList<>();
+        for (AppletTeachingVideoTypeInfoVo productTypeInfoVo : menuList) {
+            if (productTypeInfoVo.getPid().toString().equals(productTypeInfo.getId().toString())) { //当前对象为这个的子类
+                infoVos.add(getTree2(productTypeInfoVo, menuList));
+            }
+        }
+        productTypeInfo.setChildren(infoVos);
+        return productTypeInfo;
+    }
+
+}

+ 57 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/AppletTeachingVideoTypeInfoVo.java

@@ -0,0 +1,57 @@
+package com.miaxis.teachingVideo.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 教学视频分类对象返回参
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 13:47
+ */
+@Data
+@ApiModel(value = "AppletTeachingVideoTypeInfoVo", description = "教学视频分类对象+视频返回")
+public class AppletTeachingVideoTypeInfoVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @TableField("type_name")
+    @ApiModelProperty(value = "类型名称")
+    private String typeName;
+
+    @TableField("pid")
+    @ApiModelProperty(value = "父节点(预留)")
+    private Long pid;
+
+    @TableField("type_describe")
+    @ApiModelProperty(value = "类型描述,该类型名称的描述")
+    private String typeDescribe;
+
+    @TableField("type_icon")
+    @ApiModelProperty(value = "类型图标--对应file_info的id")
+    private Long typeIcon;
+
+    @TableField("type_sort")
+    @ApiModelProperty(value = "排序")
+    private Integer typeSort;
+
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private String status;
+
+    @ApiModelProperty(value = "子节点分类")
+    private List<AppletTeachingVideoTypeInfoVo> children;
+
+    @ApiModelProperty(value = "子节点分类")
+    private List<TeachingVideoInfoAppletVo> videos;
+
+}

+ 30 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/AppletTeachingVideoVo.java

@@ -0,0 +1,30 @@
+package com.miaxis.teachingVideo.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * applet
+ * 教学视频对象返回参
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/7 14:43
+ */
+@Data
+@ApiModel(value = "AppletTeachingVideoVo", description = "教学视频对象返回参")
+public class AppletTeachingVideoVo implements Serializable {
+
+    @ApiModelProperty(value = "教学视频分类名称")
+    private String typeName;
+
+    @ApiModelProperty(value = "数据集合")
+    private List<TeachingVideoInfoAppletVo> list;
+
+
+
+
+}

+ 60 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoInfoAppletVo.java

@@ -0,0 +1,60 @@
+package com.miaxis.teachingVideo.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * applet
+ * 教学视频对象返回参
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/7 16:43
+ */
+@Data
+@ApiModel(value = "TeachingVideoInfoAppletVo", description = "教学视频对象返回参")
+public class TeachingVideoInfoAppletVo implements Serializable {
+
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "视频文件访问地址")
+    private String fileUrl;
+
+    @ApiModelProperty(value = "封面图片访问地址")
+    private String coverFileUrl;
+
+    @TableField("title")
+    @ApiModelProperty(value = "视频标题")
+    private String title;
+
+    @TableField("video_describe")
+    @ApiModelProperty(value = "视频描述")
+    private String videoDescribe;
+
+    @TableField("video_duration")
+    @ApiModelProperty(value = "视频时长")
+    private String videoDuration;
+
+    @TableField("video_size")
+    @ApiModelProperty(value = "视频大小(单位:MB)")
+    private BigDecimal videoSize;
+
+    @TableField("teaching_video_type_id")
+    @ApiModelProperty(value = "教学视频分类id (关联teaching_video_type_info表)")
+    private Long teachingVideoTypeId;
+
+    @ApiModelProperty(value = "视频分类pid")
+    private Long pid;
+
+    @ApiModelProperty(value = "播放权限 0:正常 1:播放15秒  2:无法播放")
+    private Integer permission;
+
+
+}

+ 86 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoInfoVo.java

@@ -0,0 +1,86 @@
+package com.miaxis.teachingVideo.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 教学视频对象返回参
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 14:43
+ */
+@Data
+@ApiModel(value = "TeachingVideoInfoVo", description = "教学视频对象返回参")
+public class TeachingVideoInfoVo extends BaseBusinessEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "视频文件访问地址")
+    private String fileUrl;
+
+    @ApiModelProperty(value = "封面图片访问地址")
+    private String coverFileUrl;
+
+    @TableField("title")
+    @ApiModelProperty(value = "视频标题")
+    private String title;
+
+    @TableField("video_describe")
+    @ApiModelProperty(value = "视频描述")
+    private String videoDescribe;
+
+    @TableField("video_duration")
+    @ApiModelProperty(value = "视频时长")
+    private String videoDuration;
+
+    @TableField("video_size")
+    @ApiModelProperty(value = "视频大小(单位:MB)")
+    private BigDecimal videoSize;
+
+    @TableField("video_width")
+    @ApiModelProperty(value = "视频宽度")
+    private Integer videoWidth;
+
+    @TableField("video_height")
+    @ApiModelProperty(value = "视频高度")
+    private Integer videoHeight;
+
+    @TableField("teaching_video_type_id")
+    @ApiModelProperty(value = "教学视频分类id (关联teaching_video_type_info表)")
+    private Long teachingVideoTypeId;
+
+    @ApiModelProperty(value = "教学视频分类名称")
+    private String teachingVideoTypeName;
+
+    @TableField("vod_video_file_id")
+    @ApiModelProperty(value = "云点播视频fileId")
+    private String vodVideoFileId;
+
+    @TableField("shelf_status")
+    @ApiModelProperty(value = "上架状态  0:已上架、1:未上架")
+    private Integer shelfStatus;
+
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private String status;
+
+
+    @TableField("sort")
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    @TableField("permission")
+    @ApiModelProperty(value = "播放权限")
+    private Integer permission;
+
+}

+ 53 - 0
jsjp-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoTypeInfoVo.java

@@ -0,0 +1,53 @@
+package com.miaxis.teachingVideo.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 教学视频分类对象返回参
+ * @author wwl
+ * @version 1.0
+ * @date 2021/7/1 13:47
+ */
+@Data
+@ApiModel(value = "TeachingVideoTypeInfoVo", description = "教学视频分类对象返回参")
+public class TeachingVideoTypeInfoVo{
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @TableField("type_name")
+    @ApiModelProperty(value = "类型名称")
+    private String typeName;
+
+    @TableField("pid")
+    @ApiModelProperty(value = "父节点(预留)")
+    private Long pid;
+
+    @TableField("type_describe")
+    @ApiModelProperty(value = "类型描述,该类型名称的描述")
+    private String typeDescribe;
+
+    @TableField("type_icon")
+    @ApiModelProperty(value = "类型图标--对应file_info的id")
+    private Long typeIcon;
+
+    @TableField("type_sort")
+    @ApiModelProperty(value = "排序")
+    private Integer typeSort;
+
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private String status;
+
+    @ApiModelProperty(value = "子节点分类")
+    private List<TeachingVideoTypeInfoVo> children;
+
+}

+ 31 - 0
jsjp-service/src/main/resources/mapper/file/FileInfoMapper.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.miaxis.file.mapper.FileInfoMapper">
+
+    <resultMap type="FileInfo" id="FileInfoResult">
+        <result property="fileId"    column="file_id"    />
+        <result property="seq"    column="seq"    />
+        <result property="fileType"    column="file_type"    />
+        <result property="fileUrl"    column="file_url"    />
+        <result property="filePath"    column="file_path"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectFileInfoVo">
+        select file_id, seq, file_url, file_path, create_time, update_time from file_info
+    </sql>
+
+    <select id="selectFileInfoList" parameterType="FileInfo" resultMap="FileInfoResult">
+        <include refid="selectFileInfoVo"/>
+        <where>
+            <if test="seq != null "> and seq = #{seq}</if>
+            <if test="fileType != null  and fileType != ''"> and file_type = #{fileType}</if>
+            <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
+            <if test="filePath != null  and filePath != ''"> and file_path = #{filePath}</if>
+        </where>
+    </select>
+
+</mapper>

+ 88 - 0
jsjp-service/src/main/resources/mapper/teachingDsp/TeachingDspInfoMapper.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.miaxis.teachingDsp.mapper.TeachingDspInfoMapper">
+
+    <resultMap type="TeachingDspInfo" id="TeachingDspInfoResult">
+        <result property="id"    column="id"    />
+        <result property="fileId"    column="file_id"    />
+        <result property="coverFileId"    column="cover_file_id"    />
+        <result property="title"    column="title"    />
+        <result property="videoDescribe"    column="video_describe"    />
+        <result property="videoDuration"    column="video_duration"    />
+        <result property="videoSize"    column="video_size"    />
+        <result property="videoHeight"    column="video_height"    />
+        <result property="videoWidth"    column="video_width"    />
+        <result property="vodVideoFileId"    column="vod_video_file_id"    />
+        <result property="shelfStatus"    column="shelf_status"    />
+        <result property="status"    column="status"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTeachingDspInfoVo">
+        select * from teaching_dsp_info
+    </sql>
+
+
+
+    <select id="selectTeachingDspInfoList" resultType="com.miaxis.teachingDsp.vo.TeachingDspInfoVo">
+        select
+        vi.id,
+        vi.title,
+        vi.video_describe,
+        vi.video_duration,
+        vi.video_size,
+        vi.video_width,
+        vi.video_height,
+        vi.create_time,
+        vi.update_time,
+        f1.file_url as fileUrl,
+        f2.file_url as coverFileUrl,
+        vi.vod_video_file_id,
+        vi.shelf_status,
+        vi.status,
+        vi.sort
+        from teaching_dsp_info vi
+        LEFT JOIN file_info f1 on f1.file_id = vi.file_id
+        LEFT JOIN file_info f2 on f2.file_id = vi.cover_file_id
+        <where>
+            <if test="fileId != null "> and vi.file_id = #{fileId}</if>
+            <if test="coverFileId != null "> and vi.cover_file_id = #{coverFileId}</if>
+            <if test="title != null  and title != ''"> and vi.title like concat('%', #{title}, '%')</if>
+            <if test="videoDescribe != null  and videoDescribe != ''"> and vi.video_describe like concat('%', #{videoDescribe}, '%')</if>
+            <if test="videoDuration != null  and videoDuration != ''"> and vi.video_duration = #{videoDuration}</if>
+            <if test="shelfStatus != null "> and vi.shelf_status = #{shelfStatus}</if>
+            <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        </where>
+        order by sort
+    </select>
+
+
+    <select id="getTeachingDspDetailsById" resultType="com.miaxis.teachingDsp.vo.TeachingDspInfoVo">
+        select
+            vi.id,
+            vi.title,
+            vi.video_describe,
+            vi.video_duration,
+            vi.video_size,
+            vi.video_width,
+            vi.video_height,
+            vi.create_time,
+            vi.update_time,
+            f1.file_url as fileUrl,
+            f2.file_url as coverFileUrl,
+            vi.vod_video_file_id,
+            vi.shelf_status,
+            vi.status,
+            vi.sort
+        from teaching_dsp_info vi
+                 LEFT JOIN file_info f1 on f1.file_id = vi.file_id
+                 LEFT JOIN file_info f2 on f2.file_id = vi.cover_file_id
+        where vi.id = #{id}
+    </select>
+    <select id="getTeachingDspByTypeId" resultType="com.miaxis.teachingDsp.vo.TeachingDspInfoVo"></select>
+
+
+</mapper>

+ 187 - 0
jsjp-service/src/main/resources/mapper/teachingVideo/TeachingVideoInfoMapper.xml

@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.miaxis.teachingVideo.mapper.TeachingVideoInfoMapper">
+
+    <resultMap type="TeachingVideoInfo" id="TeachingVideoInfoResult">
+        <result property="id"    column="id"    />
+        <result property="fileId"    column="file_id"    />
+        <result property="coverFileId"    column="cover_file_id"    />
+        <result property="title"    column="title"    />
+        <result property="videoDescribe"    column="video_describe"    />
+        <result property="videoDuration"    column="video_duration"    />
+        <result property="teachingVideoTypeId"    column="teaching_video_type_id"    />
+        <result property="shelfStatus"    column="shelf_status"    />
+        <result property="videoSize"    column="video_size"    />
+        <result property="videoHeight"    column="video_height"    />
+        <result property="status"    column="status"    />
+        <result property="permission"    column="permission"    />
+        <result property="videoWidth"    column="video_width"    />
+        <result property="vodVideoFileId"    column="vod_video_file_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTeachingVideoInfoVo">
+        select * from teaching_video_info
+    </sql>
+
+    <select id="selectTeachingVideoInfoList" resultType="com.miaxis.teachingVideo.vo.TeachingVideoInfoVo">
+        select
+        vi.id,
+        vi.title,
+        vi.video_describe,
+        vi.video_duration,
+        vi.video_size,
+        vi.video_width,
+        vi.video_height,
+        vi.teaching_video_type_id,
+        ti.type_name as teachingVideoTypeName,
+        vi.create_time,
+        vi.update_time,
+        f1.file_url as fileUrl,
+        f2.file_url as coverFileUrl,
+        vi.vod_video_file_id,
+        vi.shelf_status,
+        vi.status,
+        vi.sort,
+        vi.permission
+        from teaching_video_info vi
+        LEFT JOIN file_info f1 on f1.file_id = vi.file_id
+        LEFT JOIN file_info f2 on f2.file_id = vi.cover_file_id
+        LEFT JOIN teaching_video_type_info ti on ti.id = vi.teaching_video_type_id
+        <where>
+            <if test="fileId != null "> and vi.file_id = #{fileId}</if>
+            <if test="coverFileId != null "> and vi.cover_file_id = #{coverFileId}</if>
+            <if test="title != null  and title != ''"> and vi.title like concat('%', #{title}, '%')</if>
+            <if test="videoDescribe != null  and videoDescribe != ''"> and vi.video_describe like concat('%', #{videoDescribe}, '%')</if>
+            <if test="videoDuration != null  and videoDuration != ''"> and vi.video_duration = #{videoDuration}</if>
+            <if test="teachingVideoTypeId != null "> and vi.teaching_video_type_id = #{teachingVideoTypeId}</if>
+            <if test="shelfStatus != null "> and vi.shelf_status = #{shelfStatus}</if>
+            <if test="status != null  and status != ''"> and vi.status = #{status}</if>
+        </where>
+        order by vi.sort asc
+    </select>
+
+
+    <select id="getTeachingVideoDetailsById" resultType="com.miaxis.teachingVideo.vo.TeachingVideoInfoVo">
+        select
+        vi.id,
+        vi.title,
+        vi.video_describe,
+        vi.video_duration,
+        vi.video_size,
+        vi.video_width,
+        vi.video_height,
+        vi.teaching_video_type_id,
+        ti.type_name as teachingVideoTypeName,
+        vi.create_time,
+        vi.update_time,
+        f1.file_url as fileUrl,
+        f2.file_url as coverFileUrl,
+        vi.vod_video_file_id,
+        vi.shelf_status,
+        vi.status,
+        vi.sort,
+        vi.permission
+        from teaching_video_info vi
+        LEFT JOIN file_info f1 on f1.file_id = vi.file_id
+        LEFT JOIN file_info f2 on f2.file_id = vi.cover_file_id
+        LEFT JOIN teaching_video_type_info ti on ti.id = vi.teaching_video_type_id
+        where vi.id = #{id}
+    </select>
+
+
+    <select id="getTeachingVideoDetailsByTypeIds" resultType="com.miaxis.teachingVideo.vo.TeachingVideoInfoAppletVo">
+        select
+        vi.id,
+        vi.title,
+        vi.video_describe,
+        vi.video_duration,
+        vi.video_size,
+        vti.pid,
+        vi.teaching_video_type_id,
+        f1.file_url as fileUrl,
+        f2.file_url as coverFileUrl
+        from teaching_video_info vi
+        LEFT JOIN file_info f1 on f1.file_id = vi.file_id
+        LEFT JOIN file_info f2 on f2.file_id = vi.cover_file_id
+        LEFT JOIN teaching_video_type_info vti ON vti.id = vi.teaching_video_type_id
+        WHERE
+	      vi.teaching_video_type_id IN ( SELECT ti.id FROM teaching_video_type_info ti WHERE ti.pid = #{pid} )
+          AND vi.`shelf_status` = 0
+          AND vi.`status` = 0
+    </select>
+
+
+
+
+
+    <select id="searchTeachingVideoInfoByKeyword" resultType="com.miaxis.teachingVideo.vo.TeachingVideoInfoAppletVo">
+        select
+        vi.id,
+        vi.title,
+        vi.video_describe,
+        vi.video_duration,
+        vi.video_size,
+        vti.pid,
+        vi.teaching_video_type_id,
+        f1.file_url as fileUrl,
+        f2.file_url as coverFileUrl
+        from teaching_video_info vi
+        LEFT JOIN file_info f1 on f1.file_id = vi.file_id
+        LEFT JOIN file_info f2 on f2.file_id = vi.cover_file_id
+        LEFT JOIN teaching_video_type_info vti ON vti.id = vi.teaching_video_type_id
+        WHERE
+          vi.`shelf_status` = 0
+	      AND vi.`status` = 0
+	      AND (vi.`title` like concat('%', #{keyword}, '%') or vi.`video_describe` like concat('%', #{keyword}, '%'))
+    </select>
+
+
+    <select id="getTeachingVideoByTypeId" resultType="com.miaxis.teachingVideo.vo.TeachingVideoInfoAppletVo">
+        select
+            vi.id,
+            vi.title,
+            vi.video_describe,
+            vi.video_duration,
+            vi.video_size,
+            vi.permission,
+            vti.pid,
+            vi.teaching_video_type_id,
+            f1.file_url as fileUrl,
+            f2.file_url as coverFileUrl
+        from teaching_video_info vi
+                 LEFT JOIN file_info f1 on f1.file_id = vi.file_id
+                 LEFT JOIN file_info f2 on f2.file_id = vi.cover_file_id
+                 LEFT JOIN teaching_video_type_info vti ON vti.id = vi.teaching_video_type_id
+        WHERE
+            vi.teaching_video_type_id = #{videoTypeId}
+          AND vi.`shelf_status` = 0
+          AND vi.`status` = 0
+          order by sort
+    </select>
+    <select id="selectTeachingVideoInfoListByType" resultType="com.miaxis.teachingVideo.vo.TeachingVideoInfoAppletVo">
+        select
+            vi.id,
+            vi.title,
+            vi.video_describe,
+            vi.video_duration,
+            vi.video_size,
+            vti.pid,
+            vi.teaching_video_type_id,
+            f1.file_url as fileUrl,
+            f2.file_url as coverFileUrl
+        from teaching_video_info vi
+                 LEFT JOIN file_info f1 on f1.file_id = vi.file_id
+                 LEFT JOIN file_info f2 on f2.file_id = vi.cover_file_id
+                 LEFT JOIN teaching_video_type_info vti ON vti.id = vi.teaching_video_type_id
+        WHERE
+            vi.teaching_video_type_id = #{videoTypeId}
+          AND vi.`shelf_status` = 0
+          AND vi.`status` = 0
+          order by sort
+    </select>
+
+</mapper>

+ 66 - 0
jsjp-service/src/main/resources/mapper/teachingVideo/TeachingVideoTypeInfoMapper.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.miaxis.teachingVideo.mapper.TeachingVideoTypeInfoMapper">
+
+    <resultMap type="TeachingVideoTypeInfo" id="TeachingVideoTypeInfoResult">
+        <result property="id"    column="id"    />
+        <result property="typeName"    column="type_name"    />
+        <result property="pid"    column="pid"    />
+        <result property="typeDescribe"    column="type_describe"    />
+        <result property="typeIcon"    column="type_icon"    />
+        <result property="typeSort"    column="type_sort"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="status"    column="status"    />
+    </resultMap>
+
+    <sql id="selectTeachingVideoTypeInfoVo">
+        select * from teaching_video_type_info
+    </sql>
+
+    <select id="selectTeachingVideoTypeInfoList" parameterType="TeachingVideoTypeInfo" resultMap="TeachingVideoTypeInfoResult">
+        <include refid="selectTeachingVideoTypeInfoVo"/>
+        <where>
+            <if test="typeName != null  and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
+            <if test="pid != null "> and pid = #{pid}</if>
+            <if test="typeDescribe != null  and typeDescribe != ''"> and type_describe like concat('%', #{typeDescribe}, '%')</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+        </where>
+        ORDER BY type_Sort
+    </select>
+
+    <select id="selectTeachingVideoTypeInfoTreeList" resultType="com.miaxis.teachingVideo.vo.TeachingVideoTypeInfoVo">
+        select
+        ti.id,
+        ti.type_name,
+        ti.pid,
+        ti.type_describe,
+        ti.type_sort,
+        ti.status
+        from teaching_video_type_info ti
+        where ti.status = 0
+        ORDER BY type_sort
+    </select>
+
+    <select id="selectAppletTeachingVideoTypeInfoTreeList"  parameterType="Integer"  resultType="com.miaxis.teachingVideo.vo.AppletTeachingVideoTypeInfoVo">
+        select
+            ti.id,
+            ti.type_name,
+            ti.pid,
+            ti.type_describe,
+            ti.type_sort,
+            ti.status
+        from teaching_video_type_info ti
+        where ti.status = 0
+        <if test="array != null and array.length >0">
+            and ti.subject in
+            <foreach collection="array" item="subject" index="index" open="(" close=")" separator=",">
+                #{subject}
+            </foreach>
+        </if>
+        ORDER BY type_sort
+    </select>
+
+</mapper>