فهرست منبع

feat: 提交视频转图片后端基本功能代码

WANGKANG 10 ماه پیش
والد
کامیت
dcc0bb3afb

+ 108 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/Video2imageController.java

@@ -0,0 +1,108 @@
+package com.taais.biz.controller;
+
+import java.util.List;
+
+import com.taais.biz.domain.bo.Video2imageBo;
+import com.taais.biz.domain.vo.Video2imageVo;
+import com.taais.biz.service.IVideo2imageService;
+import com.taais.common.core.core.page.PageResult;
+import lombok.RequiredArgsConstructor;
+import jakarta.servlet.http.HttpServletResponse;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import com.taais.common.core.core.domain.CommonResult;
+import com.taais.common.excel.utils.ExcelUtil;
+import com.taais.common.log.annotation.Log;
+import com.taais.common.log.enums.BusinessType;
+import com.taais.common.web.annotation.RepeatSubmit;
+import com.taais.common.web.core.BaseController;
+import jakarta.annotation.Resource;
+
+/**
+ * 视频转图片Controller
+ *
+ * @author km
+ * 2024-08-16
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/demo/video2image")
+public class Video2imageController extends BaseController {
+    @Resource
+    private IVideo2imageService video2imageService;
+
+    /**
+     * 查询视频转图片列表
+     */
+    @SaCheckPermission("demo:video2image:list")
+    @GetMapping("/list")
+    public CommonResult<PageResult<Video2imageVo>> list(Video2imageBo video2imageBo) {
+        return CommonResult.success(video2imageService.selectPage(video2imageBo));
+    }
+
+    /**
+     * 导出视频转图片列表
+     */
+    @SaCheckPermission("demo:video2image:export")
+    @Log(title = "视频转图片", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, Video2imageBo video2imageBo) {
+        List<Video2imageVo> list = video2imageService.selectList(video2imageBo);
+        ExcelUtil.exportExcel(list, "视频转图片", Video2imageVo.class, response);
+    }
+
+    /**
+     * 获取视频转图片详细信息
+     */
+    @SaCheckPermission("demo:video2image:query")
+    @GetMapping(value = "/{id}")
+    public CommonResult<Video2imageVo> getInfo(@PathVariable Long id) {
+        return CommonResult.success(video2imageService.selectById(id));
+    }
+
+    /**
+     * 新增视频转图片
+     */
+    @SaCheckPermission("demo:video2image:add")
+    @Log(title = "视频转图片", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping
+    public CommonResult<Void> add(@Validated @RequestBody Video2imageBo video2imageBo) {
+        boolean inserted = video2imageService.insert(video2imageBo);
+        if (!inserted) {
+            return CommonResult.fail("新增视频转图片记录失败!");
+        }
+        return CommonResult.success();
+    }
+
+    /**
+     * 修改视频转图片
+     */
+    @SaCheckPermission("demo:video2image:edit")
+    @Log(title = "视频转图片", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping
+    public CommonResult<Void> edit(@Validated @RequestBody Video2imageBo video2imageBo) {
+        Boolean updated = video2imageService.update(video2imageBo);
+        if (!updated) {
+            return CommonResult.fail("修改视频转图片记录失败!");
+        }
+        return CommonResult.success();
+    }
+
+    /**
+     * 删除视频转图片
+     */
+    @SaCheckPermission("demo:video2image:remove")
+    @Log(title = "视频转图片", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public CommonResult<Void> remove(@PathVariable Long[] ids) {
+        boolean deleted = video2imageService.deleteByIds(ids);
+        if (!deleted) {
+            return CommonResult.fail("删除视频转图片记录失败!");
+        }
+        return CommonResult.success();
+    }
+}

+ 91 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/Video2image.java

@@ -0,0 +1,91 @@
+package com.taais.biz.domain;
+
+import java.util.Date;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.Table;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+
+import com.taais.common.orm.core.domain.BaseEntity;
+
+/**
+ * 视频转图片 对象 video2image
+ *
+ * @author km
+ * 2024-08-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Table(value = "video2image")
+public class Video2image extends BaseEntity {
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @Id
+    private Long id;
+
+    /**
+     * 视频名称
+     */
+    private String name;
+
+    /**
+     * 任务状态
+     */
+    private String status;
+
+    /**
+     * 切割好的图片的保存路径
+     */
+    private String outPath;
+
+    /**
+     * 开始时间
+     */
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    private Date endTime;
+
+    /**
+     * 耗时
+     */
+    private Long costSecond;
+
+    /**
+     * 日志
+     */
+    private String log;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 逻辑删除标志(0代表存在 1代表删除)
+     */
+    @Column(isLogicDelete = true)
+    private Integer delFlag;
+
+    /**
+     * 视频本身保存路径
+     */
+    private String path;
+
+    /**
+     * 切割帧率,默认1
+     */
+    private Long fps;
+
+
+}

+ 91 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/bo/Video2imageBo.java

@@ -0,0 +1,91 @@
+package com.taais.biz.domain.bo;
+
+import com.taais.biz.domain.Video2image;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import jakarta.validation.constraints.*;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.taais.common.orm.core.domain.BaseEntity;
+
+/**
+ * 视频转图片 业务对象 video2image
+ *
+ * @author km
+ * @date 2024-08-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = Video2image.class, reverseConvertGenerate = false)
+public class Video2imageBo extends BaseEntity{
+    /**
+     * 主键ID
+     */
+    @NotNull(message = "主键ID不能为空")
+    private Long id;
+
+    /**
+     * 视频名称
+     */
+    @NotBlank(message = "视频名称不能为空")
+    private String name;
+
+    /**
+     * 任务状态
+     */
+    @NotBlank(message = "任务状态不能为空")
+    private String status;
+
+    /**
+     * 切割好的图片的保存路径
+     */
+    @NotBlank(message = "切割好的图片的保存路径不能为空")
+    private String outPath;
+
+    /**
+     * 开始时间
+     */
+    @NotNull(message = "开始时间不能为空")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    @NotNull(message = "结束时间不能为空")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+    /**
+     * 耗时
+     */
+    @NotNull(message = "耗时不能为空")
+    private Long costSecond;
+
+    /**
+     * 日志
+     */
+    @NotBlank(message = "日志不能为空")
+    private String log;
+
+    /**
+     * 备注
+     */
+    @NotBlank(message = "备注不能为空")
+    private String remarks;
+
+    /**
+     * 视频本身保存路径
+     */
+    @NotBlank(message = "视频本身保存路径不能为空")
+    private String path;
+
+    /**
+     * 切割帧率,默认1
+     */
+    @NotNull(message = "切割帧率,默认1不能为空")
+    private Long fps;
+
+
+}

+ 95 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/vo/Video2imageImportVo.java

@@ -0,0 +1,95 @@
+package com.taais.biz.domain.vo;
+
+import java.util.Date;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import lombok.NoArgsConstructor;
+
+/**
+ * 视频转图片 导入视图对象 video2image
+ *
+ * @author km
+ * @date 2024-08-16
+ */
+
+@Data
+@NoArgsConstructor
+public class Video2imageImportVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * 视频名称
+     */
+    @ExcelProperty(value = "视频名称")
+    private String name;
+
+    /**
+     * 任务状态
+     */
+    @ExcelProperty(value = "任务状态")
+    private String status;
+
+    /**
+     * 切割好的图片的保存路径
+     */
+    @ExcelProperty(value = "切割好的图片的保存路径")
+    private String outPath;
+
+    /**
+     * 开始时间
+     */
+    @ExcelProperty(value = "开始时间")
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    @ExcelProperty(value = "结束时间")
+    private Date endTime;
+
+    /**
+     * 耗时
+     */
+    @ExcelProperty(value = "耗时")
+    private Long costSecond;
+
+    /**
+     * 日志
+     */
+    @ExcelProperty(value = "日志")
+    private String log;
+
+    /**
+     * 备注
+     */
+    @ExcelProperty(value = "备注")
+    private String remarks;
+
+    /**
+     * 逻辑删除标志(0代表存在 1代表删除)
+     */
+    @ExcelProperty(value = "逻辑删除标志(0代表存在 1代表删除)")
+    private Integer delFlag;
+
+    /**
+     * 视频本身保存路径
+     */
+    @ExcelProperty(value = "视频本身保存路径")
+    private String path;
+
+    /**
+     * 切割帧率,默认1
+     */
+    @ExcelProperty(value = "切割帧率,默认1")
+    private Long fps;
+
+
+}

+ 103 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/vo/Video2imageVo.java

@@ -0,0 +1,103 @@
+package com.taais.biz.domain.vo;
+
+import java.util.Date;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.taais.biz.domain.Video2image;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+import com.taais.common.orm.core.domain.BaseEntity;
+
+/**
+ * 视频转图片 视图对象 video2image
+ *
+ * @author km
+ * @date 2024-08-16
+ */
+@Data
+@ExcelIgnoreUnannotated
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = Video2image.class)
+public class Video2imageVo extends BaseEntity implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @ExcelProperty(value = "主键ID")
+    private Long id;
+
+    /**
+     * 视频名称
+     */
+    @ExcelProperty(value = "视频名称")
+    private String name;
+
+    /**
+     * 任务状态
+     */
+    @ExcelProperty(value = "任务状态")
+    private String status;
+
+    /**
+     * 切割好的图片的保存路径
+     */
+    @ExcelProperty(value = "切割好的图片的保存路径")
+    private String outPath;
+
+    /**
+     * 开始时间
+     */
+    @ExcelProperty(value = "开始时间")
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    @ExcelProperty(value = "结束时间")
+    private Date endTime;
+
+    /**
+     * 耗时
+     */
+    @ExcelProperty(value = "耗时")
+    private Long costSecond;
+
+    /**
+     * 日志
+     */
+    @ExcelProperty(value = "日志")
+    private String log;
+
+    /**
+     * 备注
+     */
+    @ExcelProperty(value = "备注")
+    private String remarks;
+
+    /**
+     * 逻辑删除标志(0代表存在 1代表删除)
+     */
+    @ExcelProperty(value = "逻辑删除标志(0代表存在 1代表删除)")
+    private Integer delFlag;
+
+    /**
+     * 视频本身保存路径
+     */
+    @ExcelProperty(value = "视频本身保存路径")
+    private String path;
+
+    /**
+     * 切割帧率,默认1
+     */
+    @ExcelProperty(value = "切割帧率,默认1")
+    private Long fps;
+}

+ 119 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/listener/Video2imageImportListener.java

@@ -0,0 +1,119 @@
+package com.taais.biz.listener;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.taais.biz.domain.bo.Video2imageBo;
+import com.taais.biz.domain.vo.Video2imageImportVo;
+import com.taais.biz.domain.vo.Video2imageVo;
+import com.taais.biz.service.IVideo2imageService;
+import com.taais.common.core.exception.ServiceException;
+import com.taais.common.core.utils.SpringUtils;
+import com.taais.common.core.utils.ValidatorUtils;
+import com.taais.common.excel.core.ExcelListener;
+import com.taais.common.excel.core.ExcelResult;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.List;
+
+/**
+ * 视频转图片自定义导入
+ *
+ * @author km
+ */
+@Slf4j
+public class Video2imageImportListener extends AnalysisEventListener<Video2imageImportVo> implements ExcelListener<Video2imageImportVo> {
+    private final IVideo2imageService video2imageService;
+
+    private final Boolean isUpdateSupport;
+    private int successNum = 0;
+    private int failureNum = 0;
+    private final StringBuilder successMsg = new StringBuilder();
+    private final StringBuilder failureMsg = new StringBuilder();
+
+    public Video2imageImportListener(Boolean isUpdateSupport) {
+        this.video2imageService = SpringUtils.getBean(IVideo2imageService.class);
+        this.isUpdateSupport = isUpdateSupport;
+    }
+
+    @Override
+    public void invoke(Video2imageImportVo video2imageVo, AnalysisContext context) {
+        try {
+
+            Video2imageBo video2imageBo = BeanUtil.toBean(video2imageVo, Video2imageBo.class);
+
+            //TODO:根据某个字段,查询数据库表中是否存在记录,不存在就新增,存在就更新
+            Video2imageVo video2imageVo1 = null;
+
+            //video2imageVo1 = video2imageService.selectBySomefield(video2imageVo.getSomefield());
+            if (ObjectUtil.isNull(video2imageVo1)) {
+                //不存在就新增
+                video2imageBo.setVersion(0);
+                ValidatorUtils.validate(video2imageBo);
+                boolean inserted = video2imageService.insert(video2imageBo);
+
+                if (inserted) {
+                    successNum++;
+                    successMsg.append("<br/>").append(successNum).append("、视频转图片 记录导入成功");
+                    return;
+                } else {
+                    failureNum++;
+                    failureMsg.append("<br/>").append(failureNum).append("、视频转图片 记录导入失败");
+                    return;
+                }
+            } else if (isUpdateSupport) {
+                //存在就更新
+                video2imageBo.setId(video2imageVo1.getId());//主键
+                video2imageBo.setVersion(video2imageVo1.getVersion());
+                boolean updated = video2imageService.update(video2imageBo);
+                if (updated) {
+                    successNum++;
+                    successMsg.append("<br/>").append(successNum).append("、视频转图片 记录更新成功");
+                    return;
+                } else {
+                    failureNum++;
+                    failureMsg.append("<br/>").append(failureNum).append("、视频转图片 记录更新失败");
+                    return;
+                }
+            }
+        } catch (Exception e) {
+            failureNum++;
+            String msg = "<br/>" + failureNum + "、视频转图片 记录导入失败:";
+            failureMsg.append(msg).append(e.getMessage());
+            log.error(msg, e);
+        }
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext context) {
+
+    }
+
+    @Override
+    public ExcelResult<Video2imageImportVo> getExcelResult() {
+        return new ExcelResult<>() {
+
+            @Override
+            public String getAnalysis() {
+                if (failureNum > 0) {
+                    failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据没有成功导入,错误如下:");
+                    throw new ServiceException(failureMsg.toString());
+                } else {
+                    successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+                }
+                return successMsg.toString();
+            }
+
+            @Override
+            public List<Video2imageImportVo> getList() {
+                return null;
+            }
+
+            @Override
+            public List<String> getErrorList() {
+                return null;
+            }
+        };
+    }
+}

+ 16 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/mapper/Video2imageMapper.java

@@ -0,0 +1,16 @@
+package com.taais.biz.mapper;
+
+import com.mybatisflex.core.BaseMapper;
+import com.taais.biz.domain.Video2image;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 视频转图片 Mapper接口
+ *
+ * @author km
+ * 2024-08-16
+ */
+@Mapper
+public interface Video2imageMapper extends BaseMapper<Video2image> {
+
+}

+ 66 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/IVideo2imageService.java

@@ -0,0 +1,66 @@
+package com.taais.biz.service;
+
+import com.taais.biz.domain.Video2image;
+import com.taais.biz.domain.bo.Video2imageBo;
+import com.taais.biz.domain.vo.Video2imageVo;
+import com.taais.common.core.core.page.PageResult;
+import com.taais.common.orm.core.service.IBaseService;
+
+import java.util.List;
+
+/**
+ * 视频转图片 Service接口
+ *
+ * @author km
+ * 2024-08-16
+ */
+public interface IVideo2imageService extends IBaseService<Video2image> {
+    /**
+     * 查询视频转图片
+     *
+     * @param id 视频转图片主键
+     * @return 视频转图片
+     */
+    Video2imageVo selectById(Long id);
+
+    /**
+     * 查询视频转图片列表
+     *
+     * @param video2imageBo 视频转图片Bo
+     * @return 视频转图片集合
+     */
+    List<Video2imageVo> selectList(Video2imageBo video2imageBo);
+
+    /**
+     * 分页查询视频转图片列表
+     *
+     * @param video2imageBo 视频转图片Bo
+     * @return 分页视频转图片集合
+     */
+    PageResult<Video2imageVo> selectPage(Video2imageBo video2imageBo);
+
+    /**
+     * 新增视频转图片
+     *
+     * @param video2imageBo 视频转图片Bo
+     * @return 结果:true 操作成功,false 操作失败
+     */
+    boolean insert(Video2imageBo video2imageBo);
+
+    /**
+     * 修改视频转图片
+     *
+     * @param video2imageBo 视频转图片Bo
+     * @return 结果:true 更新成功,false 更新失败
+     */
+    boolean update(Video2imageBo video2imageBo);
+
+    /**
+     * 批量删除视频转图片
+     *
+     * @param ids 需要删除的视频转图片主键集合
+     * @return 结果:true 删除成功,false 删除失败
+     */
+    boolean deleteByIds(Long[] ids);
+
+}

+ 144 - 0
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/Video2imageServiceImpl.java

@@ -0,0 +1,144 @@
+package com.taais.biz.service.impl;
+
+import java.util.Arrays;
+import java.util.List;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.mybatisflex.core.paginate.Page;
+import com.mybatisflex.core.query.QueryWrapper;
+import com.taais.biz.domain.Video2image;
+import com.taais.biz.domain.bo.Video2imageBo;
+import com.taais.biz.domain.vo.Video2imageVo;
+import com.taais.biz.mapper.Video2imageMapper;
+import com.taais.biz.service.IVideo2imageService;
+import com.taais.common.core.utils.MapstructUtils;
+import com.taais.common.orm.core.page.PageQuery;
+import com.taais.common.core.core.page.PageResult;
+import com.taais.common.orm.core.service.impl.BaseServiceImpl;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import static com.taais.biz.domain.table.Video2imageTableDef.VIDEO2IMAGE;
+
+/**
+ * 视频转图片 Service业务层处理
+ *
+ * @author km
+ * 2024-08-16
+ */
+@Service
+public class Video2imageServiceImpl extends BaseServiceImpl<Video2imageMapper, Video2image> implements IVideo2imageService {
+    @Resource
+    private Video2imageMapper video2imageMapper;
+
+    @Override
+    public QueryWrapper query() {
+        return super.query().from(VIDEO2IMAGE);
+    }
+
+    private QueryWrapper buildQueryWrapper(Video2imageBo video2imageBo) {
+        QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
+        queryWrapper.and(VIDEO2IMAGE.NAME.like
+            (video2imageBo.getName()));
+        queryWrapper.and(VIDEO2IMAGE.STATUS.eq
+            (video2imageBo.getStatus()));
+        queryWrapper.and(VIDEO2IMAGE.OUT_PATH.eq
+            (video2imageBo.getOutPath()));
+        queryWrapper.and(VIDEO2IMAGE.START_TIME.eq
+            (video2imageBo.getStartTime()));
+        queryWrapper.and(VIDEO2IMAGE.END_TIME.eq
+            (video2imageBo.getEndTime()));
+        queryWrapper.and(VIDEO2IMAGE.COST_SECOND.eq
+            (video2imageBo.getCostSecond()));
+        queryWrapper.and(VIDEO2IMAGE.LOG.eq
+            (video2imageBo.getLog()));
+        queryWrapper.and(VIDEO2IMAGE.REMARKS.eq
+            (video2imageBo.getRemarks()));
+        queryWrapper.and(VIDEO2IMAGE.PATH.eq
+            (video2imageBo.getPath()));
+        queryWrapper.and(VIDEO2IMAGE.FPS.eq
+            (video2imageBo.getFps()));
+
+        return queryWrapper;
+    }
+
+    /**
+     * 查询视频转图片
+     *
+     * @param id 视频转图片主键
+     * @return 视频转图片
+     */
+    @Override
+    public Video2imageVo selectById(Long id) {
+        return this.getOneAs(query().where(VIDEO2IMAGE.ID.eq(id)), Video2imageVo.class);
+
+    }
+
+    /**
+     * 查询视频转图片列表
+     *
+     * @param video2imageBo 视频转图片Bo
+     * @return 视频转图片集合
+     */
+    @Override
+    public List<Video2imageVo> selectList(Video2imageBo video2imageBo) {
+        QueryWrapper queryWrapper = buildQueryWrapper(video2imageBo);
+        return this.listAs(queryWrapper, Video2imageVo.class);
+    }
+
+    /**
+     * 分页查询视频转图片列表
+     *
+     * @param video2imageBo 视频转图片Bo
+     * @return 分页视频转图片集合
+     */
+    @Override
+    public PageResult<Video2imageVo> selectPage(Video2imageBo video2imageBo) {
+        QueryWrapper queryWrapper = buildQueryWrapper(video2imageBo);
+        Page<Video2imageVo> page = this.pageAs(PageQuery.build(), queryWrapper, Video2imageVo.class);
+        return PageResult.build(page);
+    }
+
+    /**
+     * 新增视频转图片
+     *
+     * @param video2imageBo 视频转图片Bo
+     * @return 结果:true 操作成功,false 操作失败
+     */
+    @Override
+    public boolean insert(Video2imageBo video2imageBo) {
+        Video2image video2image = MapstructUtils.convert(video2imageBo, Video2image.class);
+
+        return this.save(video2image);// 使用全局配置的雪花算法主键生成器生成ID值
+    }
+
+    /**
+     * 修改视频转图片
+     *
+     * @param video2imageBo 视频转图片Bo
+     * @return 结果:true 更新成功,false 更新失败
+     */
+    @Override
+    public boolean update(Video2imageBo video2imageBo) {
+        Video2image video2image = MapstructUtils.convert(video2imageBo, Video2image.class);
+        if (ObjectUtil.isNotNull(video2image) && ObjectUtil.isNotNull(video2image.getId())) {
+            boolean updated = this.updateById(video2image);
+            return updated;
+        }
+        return false;
+    }
+
+    /**
+     * 批量删除视频转图片
+     *
+     * @param ids 需要删除的视频转图片主键集合
+     * @return 结果:true 删除成功,false 删除失败
+     */
+    @Transactional
+    @Override
+    public boolean deleteByIds(Long[] ids) {
+        return this.removeByIds(Arrays.asList(ids));
+    }
+
+}

+ 7 - 0
taais-modules/taais-biz/src/main/resources/mapper/demo/Video2imageMapper.xml

@@ -0,0 +1,7 @@
+<?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.taais.biz.mapper.Video2imageMapper">
+
+</mapper>