浏览代码

教学视频相关接口

wwl 3 年之前
父节点
当前提交
230afe7703
共有 15 个文件被更改,包括 932 次插入10 次删除
  1. 5 10
      zzjs-admin/src/main/java/com/miaxis/app/controller/fulu/AppletFuluCommodityInfoController.java
  2. 126 0
      zzjs-admin/src/main/java/com/miaxis/pc/controller/teachingVideo/TeachingVideoInfoController.java
  3. 109 0
      zzjs-admin/src/main/java/com/miaxis/pc/controller/teachingVideo/TeachingVideoTypeInfoController.java
  4. 60 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/domain/TeachingVideoInfo.java
  5. 51 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/domain/TeachingVideoTypeInfo.java
  6. 31 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/mapper/TeachingVideoInfoMapper.java
  7. 29 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/mapper/TeachingVideoTypeInfoMapper.java
  8. 55 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/service/ITeachingVideoInfoService.java
  9. 39 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/service/ITeachingVideoTypeInfoService.java
  10. 93 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/service/impl/TeachingVideoInfoServiceImpl.java
  11. 95 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/service/impl/TeachingVideoTypeInfoServiceImpl.java
  12. 60 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoInfoVo.java
  13. 55 0
      zzjs-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoTypeInfoVo.java
  14. 77 0
      zzjs-service/src/main/resources/mapper/teachingVideo/TeachingVideoInfoMapper.xml
  15. 47 0
      zzjs-service/src/main/resources/mapper/teachingVideo/TeachingVideoTypeInfoMapper.xml

+ 5 - 10
zzjs-admin/src/main/java/com/miaxis/app/controller/fulu/AppletFuluCommodityInfoController.java

@@ -1,20 +1,15 @@
 package com.miaxis.app.controller.fulu;
 package com.miaxis.app.controller.fulu;
 
 
-import com.miaxis.common.annotation.Log;
 import com.miaxis.common.constant.Constants;
 import com.miaxis.common.constant.Constants;
 import com.miaxis.common.core.controller.BaseController;
 import com.miaxis.common.core.controller.BaseController;
 import com.miaxis.common.core.domain.Response;
 import com.miaxis.common.core.domain.Response;
-import com.miaxis.common.core.page.ResponsePageInfo;
-import com.miaxis.common.enums.BusinessTypeEnum;
-import com.miaxis.fulu.domain.FuluCommodityInfo;
 import com.miaxis.fulu.service.IFuluCommodityInfoService;
 import com.miaxis.fulu.service.IFuluCommodityInfoService;
-import com.miaxis.fulu.vo.FuluCommodityInfoVo;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 
 /**
 /**
  * 【福禄商品】Controller
  * 【福禄商品】Controller

+ 126 - 0
zzjs-admin/src/main/java/com/miaxis/pc/controller/teachingVideo/TeachingVideoInfoController.java

@@ -0,0 +1,126 @@
+package com.miaxis.pc.controller.teachingVideo;
+
+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.TeachingVideoInfo;
+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 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<Integer> add(@RequestBody TeachingVideoInfo teachingVideoInfo){
+        return toResponse(teachingVideoInfoService.save(teachingVideoInfo) ? 1 : 0);
+    }
+
+    /**
+     * 修改教学视频
+     */
+    @PreAuthorize("@ss.hasPermi('teachingVideo:info:edit')")
+    @Log(title = "教学视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改教学视频")
+    public Response<Integer> edit(@RequestBody TeachingVideoInfo teachingVideoInfo){
+        return toResponse(teachingVideoInfoService.updateById(teachingVideoInfo) ? 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 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
zzjs-admin/src/main/java/com/miaxis/pc/controller/teachingVideo/TeachingVideoTypeInfoController.java

@@ -0,0 +1,109 @@
+package com.miaxis.pc.controller.teachingVideo;
+
+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);
+    }
+
+
+}

+ 60 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/domain/TeachingVideoInfo.java

@@ -0,0 +1,60 @@
+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_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("teaching_video_type_id")
+    @ApiModelProperty(value = "教学视频分类id (关联teaching_video_type_info表)")
+    private Long teachingVideoTypeId;
+
+    @TableField("shelf_status")
+    @ApiModelProperty(value = "上架状态  0:已上架、1:未上架")
+    private Integer shelfStatus;
+
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private String status;
+
+}

+ 51 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/domain/TeachingVideoTypeInfo.java

@@ -0,0 +1,51 @@
+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;
+
+}

+ 31 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/mapper/TeachingVideoInfoMapper.java

@@ -0,0 +1,31 @@
+package com.miaxis.teachingVideo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.teachingVideo.domain.TeachingVideoInfo;
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
+
+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);
+}

+ 29 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/mapper/TeachingVideoTypeInfoMapper.java

@@ -0,0 +1,29 @@
+package com.miaxis.teachingVideo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.teachingVideo.domain.TeachingVideoTypeInfo;
+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();
+}

+ 55 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/service/ITeachingVideoInfoService.java

@@ -0,0 +1,55 @@
+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.vo.TeachingVideoInfoVo;
+
+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 ids
+     * @return
+     */
+    Response<Integer> removeTeachingVideoByIds(Long[] ids);
+
+
+    /**
+     * 上架教学视频
+     * @param ids
+     * @return
+     */
+    Response removePutShelfByIds(Long[] ids);
+
+    /**
+     * 下架教学视频
+     * @param ids
+     * @return
+     */
+    Response removeOffShelfByIds(Long[] ids);
+
+}

+ 39 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/service/ITeachingVideoTypeInfoService.java

@@ -0,0 +1,39 @@
+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.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();
+
+    /**
+     * 删除教学视频分类(伪删除)
+     * @param ids
+     * @return
+     */
+    Response removeVideoTypeByIds(Long[] ids);
+
+
+}

+ 93 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/service/impl/TeachingVideoInfoServiceImpl.java

@@ -0,0 +1,93 @@
+package com.miaxis.teachingVideo.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.teachingVideo.domain.TeachingVideoInfo;
+import com.miaxis.teachingVideo.mapper.TeachingVideoInfoMapper;
+import com.miaxis.teachingVideo.service.ITeachingVideoInfoService;
+import com.miaxis.teachingVideo.vo.TeachingVideoInfoVo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 教学视频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;
+
+    /**
+     * 查询教学视频列表
+     *
+     * @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 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();
+    }
+
+}

+ 95 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/service/impl/TeachingVideoTypeInfoServiceImpl.java

@@ -0,0 +1,95 @@
+package com.miaxis.teachingVideo.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.teachingVideo.domain.TeachingVideoTypeInfo;
+import com.miaxis.teachingVideo.mapper.TeachingVideoTypeInfoMapper;
+import com.miaxis.teachingVideo.service.ITeachingVideoTypeInfoService;
+import com.miaxis.teachingVideo.vo.TeachingVideoTypeInfoVo;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+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;
+
+    /**
+     * 查询教学视频分类列表
+     *
+     * @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();
+    }
+
+}

+ 60 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoInfoVo.java

@@ -0,0 +1,60 @@
+package com.miaxis.teachingVideo.vo;
+
+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;
+
+/**
+ * 教学视频对象返回参
+ * @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("teaching_video_type_id")
+    @ApiModelProperty(value = "教学视频分类id (关联teaching_video_type_info表)")
+    private Long teachingVideoTypeId;
+
+    @ApiModelProperty(value = "教学视频分类名称")
+    private String teachingVideoTypeName;
+
+    @TableField("shelf_status")
+    @ApiModelProperty(value = "上架状态  0:已上架、1:未上架")
+    private Integer shelfStatus;
+
+    @TableField("status")
+    @ApiModelProperty(value = "状态  0:有效(默认)、1:失效 (伪删除)")
+    private String status;
+
+}

+ 55 - 0
zzjs-service/src/main/java/com/miaxis/teachingVideo/vo/TeachingVideoTypeInfoVo.java

@@ -0,0 +1,55 @@
+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 com.miaxis.product.vo.AppletProductTypeInfoVo;
+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;
+
+}

+ 77 - 0
zzjs-service/src/main/resources/mapper/teachingVideo/TeachingVideoInfoMapper.xml

@@ -0,0 +1,77 @@
+<?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="status"    column="status"    />
+        <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.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.shelf_status,
+        vi.status
+        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 file_id = #{fileId}</if>
+            <if test="coverFileId != null "> and cover_file_id = #{coverFileId}</if>
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
+            <if test="videoDescribe != null  and videoDescribe != ''"> and video_describe like concat('%', #{videoDescribe}, '%')</if>
+            <if test="videoDuration != null  and videoDuration != ''"> and video_duration = #{videoDuration}</if>
+            <if test="teachingVideoTypeId != null "> and teaching_video_type_id = #{teachingVideoTypeId}</if>
+            <if test="shelfStatus != null "> and shelf_status = #{shelfStatus}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+        </where>
+    </select>
+
+
+    <select id="getTeachingVideoDetailsById" resultType="com.miaxis.teachingVideo.vo.TeachingVideoInfoVo">
+        select
+        vi.id,
+        vi.title,
+        vi.video_describe,
+        vi.video_duration,
+        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.shelf_status,
+        vi.status
+        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>
+
+</mapper>

+ 47 - 0
zzjs-service/src/main/resources/mapper/teachingVideo/TeachingVideoTypeInfoMapper.xml

@@ -0,0 +1,47 @@
+<?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>
+
+</mapper>