小么熊🐻 2 سال پیش
والد
کامیت
40c7ae365f

+ 109 - 0
nbjk-admin/src/main/java/com/miaxis/app/controller/video/VideoTeachingController.java

@@ -0,0 +1,109 @@
+package com.miaxis.app.controller.video;
+
+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.utils.poi.ExcelUtil;
+import com.miaxis.video.domain.VideoTeaching;
+import com.miaxis.video.service.IVideoTeachingService;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 【教练视频】Controller
+ *
+ * @author miaxis
+ * @date 2023-02-20
+ */
+@RestController
+@RequestMapping("/video/teaching")
+@Api(tags={"【app-教练视频】"})
+public class VideoTeachingController extends BaseController{
+    @Autowired
+    private IVideoTeachingService videoTeachingService;
+
+    /**
+     * 查询教练视频列表
+     */
+    @PreAuthorize("@ss.hasPermi('video:teaching: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<VideoTeaching> list(@ModelAttribute VideoTeaching videoTeaching){
+        startPage();
+        List<VideoTeaching> list = videoTeachingService.selectVideoTeachingList(videoTeaching);
+        return toResponsePageInfo(list);
+    }
+    
+    /**
+     * 导出教练视频列表
+     */
+    @PreAuthorize("@ss.hasPermi('video:teaching:export')")
+    @Log(title = "教练视频", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出教练视频列表Excel")
+    public Response<String> export(@ModelAttribute VideoTeaching videoTeaching){
+        List<VideoTeaching> list = videoTeachingService.selectVideoTeachingList(videoTeaching);
+        ExcelUtil<VideoTeaching> util = new ExcelUtil<VideoTeaching>(VideoTeaching.class);
+        return util.exportExcel(list, "teaching");
+    }
+
+    /**
+     * 获取教练视频详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('video:teaching:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取教练视频详细信息")
+    public Response<VideoTeaching> getInfo(
+            @ApiParam(name = "id", value = "教练视频参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(videoTeachingService.getById(id));
+    }
+
+    /**
+     * 新增教练视频
+     */
+    @PreAuthorize("@ss.hasPermi('video:teaching:add')")
+    @Log(title = "教练视频", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增教练视频")
+    public Response<Integer> add(@RequestBody VideoTeaching videoTeaching){
+        return toResponse(videoTeachingService.save(videoTeaching) ? 1 : 0);
+    }
+
+    /**
+     * 修改教练视频
+     */
+    @PreAuthorize("@ss.hasPermi('video:teaching:edit')")
+    @Log(title = "教练视频", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改教练视频")
+    public Response<Integer> edit(@RequestBody VideoTeaching videoTeaching){
+        return toResponse(videoTeachingService.updateById(videoTeaching) ? 1 : 0);
+    }
+
+    /**
+     * 删除教练视频
+     */
+    @PreAuthorize("@ss.hasPermi('video:teaching: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(videoTeachingService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+    }
+}

+ 118 - 0
nbjk-service/src/main/java/com/miaxis/video/domain/VideoTeaching.java

@@ -0,0 +1,118 @@
+package com.miaxis.video.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import lombok.Data;
+/**
+ * 教练视频对象 video_teaching
+ *
+ * @author miaxis
+ * @date 2023-02-20
+ */
+@Data
+@TableName("video_teaching")
+@ApiModel(value = "VideoTeaching", description = "教练视频对象 video_teaching")
+public class VideoTeaching extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "$column.columnComment")
+    private Long id;
+
+    /** 视频名称 */
+    @Excel(name = "视频名称")
+    @TableField("video_name")
+    @ApiModelProperty(value = "视频名称")
+    private String videoName;
+
+    /** 视频封面 */
+    @Excel(name = "视频封面")
+    @TableField("video_cover")
+    @ApiModelProperty(value = "视频封面")
+    private String videoCover;
+
+    /** 视频地址 */
+    @Excel(name = "视频地址")
+    @TableField("video_url")
+    @ApiModelProperty(value = "视频地址")
+    private String videoUrl;
+
+    /** 1:科目一 2:科目二 3:科目三 4:科目四 */
+    @Excel(name = "1:科目一 2:科目二 3:科目三 4:科目四")
+    @TableField("video_subject")
+    @ApiModelProperty(value = "1:科目一 2:科目二 3:科目三 4:科目四")
+    private Long videoSubject;
+
+    /** 0未开启 1已开启 */
+    @Excel(name = "0未开启 1已开启")
+    @TableField("state")
+    @ApiModelProperty(value = "0未开启 1已开启")
+    private Long state;
+
+    public void setId(Long id){
+        this.id = id;
+    }
+
+    public Long getId(){
+        return id;
+    }
+    public void setVideoName(String videoName){
+        this.videoName = videoName;
+    }
+
+    public String getVideoName(){
+        return videoName;
+    }
+    public void setVideoCover(String videoCover){
+        this.videoCover = videoCover;
+    }
+
+    public String getVideoCover(){
+        return videoCover;
+    }
+    public void setVideoUrl(String videoUrl){
+        this.videoUrl = videoUrl;
+    }
+
+    public String getVideoUrl(){
+        return videoUrl;
+    }
+    public void setVideoSubject(Long videoSubject){
+        this.videoSubject = videoSubject;
+    }
+
+    public Long getVideoSubject(){
+        return videoSubject;
+    }
+    public void setState(Long state){
+        this.state = state;
+    }
+
+    public Long getState(){
+        return state;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("videoName", getVideoName())
+            .append("videoCover", getVideoCover())
+            .append("videoUrl", getVideoUrl())
+            .append("videoSubject", getVideoSubject())
+            .append("state", getState())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 22 - 0
nbjk-service/src/main/java/com/miaxis/video/mapper/VideoTeachingMapper.java

@@ -0,0 +1,22 @@
+package com.miaxis.video.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.video.domain.VideoTeaching;
+
+/**
+ * 教练视频Mapper接口
+ *
+ * @author miaxis
+ * @date 2023-02-20
+ */
+public interface VideoTeachingMapper extends BaseMapper<VideoTeaching> {
+    /**
+     * 查询教练视频列表
+     *
+     * @param videoTeaching 教练视频
+     * @return 教练视频集合
+     */
+    public List<VideoTeaching> selectVideoTeachingList(VideoTeaching videoTeaching);
+
+}

+ 21 - 0
nbjk-service/src/main/java/com/miaxis/video/service/IVideoTeachingService.java

@@ -0,0 +1,21 @@
+package com.miaxis.video.service;
+
+import java.util.List;
+import com.miaxis.video.domain.VideoTeaching;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 教练视频Service接口
+ *
+ * @author miaxis
+ * @date 2023-02-20
+ */
+public interface IVideoTeachingService extends IService<VideoTeaching>{
+    /**
+     * 查询教练视频列表
+     *
+     * @param videoTeaching 教练视频
+     * @return 教练视频集合
+     */
+    public List<VideoTeaching> selectVideoTeachingList(VideoTeaching videoTeaching);
+}

+ 36 - 0
nbjk-service/src/main/java/com/miaxis/video/service/impl/VideoTeachingServiceImpl.java

@@ -0,0 +1,36 @@
+package com.miaxis.video.service.impl;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.miaxis.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.commons.lang3.StringUtils;
+import com.miaxis.video.mapper.VideoTeachingMapper;
+import com.miaxis.video.domain.VideoTeaching;
+import com.miaxis.video.service.IVideoTeachingService;
+
+/**
+ * 教练视频Service业务层处理
+ *
+ * @author miaxis
+ * @date 2023-02-20
+ */
+@Service
+public class VideoTeachingServiceImpl extends ServiceImpl<VideoTeachingMapper, VideoTeaching> implements IVideoTeachingService {
+    @Autowired
+    private VideoTeachingMapper videoTeachingMapper;
+
+    /**
+     * 查询教练视频列表
+     *
+     * @param videoTeaching 教练视频
+     * @return 教练视频
+     */
+    @Override
+    public List<VideoTeaching> selectVideoTeachingList(VideoTeaching videoTeaching){
+        return videoTeachingMapper.selectVideoTeachingList(videoTeaching);
+    }
+}

+ 33 - 0
nbjk-service/src/main/resources/mapper/video/VideoTeachingMapper.xml

@@ -0,0 +1,33 @@
+<?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.video.mapper.VideoTeachingMapper">
+
+    <resultMap type="VideoTeaching" id="VideoTeachingResult">
+        <result property="id"    column="id"    />
+        <result property="videoName"    column="video_name"    />
+        <result property="videoCover"    column="video_cover"    />
+        <result property="videoUrl"    column="video_url"    />
+        <result property="videoSubject"    column="video_subject"    />
+        <result property="state"    column="state"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectVideoTeachingVo">
+        select * from video_teaching
+    </sql>
+
+    <select id="selectVideoTeachingList" parameterType="VideoTeaching" resultMap="VideoTeachingResult">
+        <include refid="selectVideoTeachingVo"/>
+        <where>
+            <if test="videoName != null  and videoName != ''"> and video_name like concat('%', #{videoName}, '%')</if>
+            <if test="videoCover != null  and videoCover != ''"> and video_cover = #{videoCover}</if>
+            <if test="videoUrl != null  and videoUrl != ''"> and video_url = #{videoUrl}</if>
+            <if test="videoSubject != null "> and video_subject = #{videoSubject}</if>
+            <if test="state != null "> and state = #{state}</if>
+        </where>
+    </select>
+
+</mapper>