Browse Source

feat: 添加去抖动完善

WANGKANG 9 months ago
parent
commit
883c6c72e8

+ 2 - 2
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/VideoStable.java

@@ -47,12 +47,12 @@ public class VideoStable extends BaseEntity {
     /**
      * 输入oss_ID
      */
-    private String inputOssId;
+    private Long inputOssId;
 
     /**
      * 去抖动的图片集ossID
      */
-    private String outputOssId;
+    private Long outputOssId;
 
     /**
      * 开始时间

+ 5 - 4
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/bo/VideoStableBo.java

@@ -2,8 +2,9 @@ package com.taais.biz.domain.bo;
 
 import com.taais.biz.domain.VideoStable;
 import io.github.linpeilie.annotations.AutoMapper;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
 import lombok.*;
-import jakarta.validation.constraints.*;
 import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.taais.common.orm.core.domain.BaseEntity;
@@ -40,13 +41,13 @@ public class VideoStableBo extends BaseEntity{
     /**
      * 输入图片集ossId
      */
-    @NotBlank(message = "输入图片集ossId不能为空")
-    private String inputOssId;
+    @NotNull(message = "输入图片集ossId不能为空")
+    private Long inputOssId;
 
     /**
      * 去抖动的图片集ossId
      */
-    private String outputOssId;
+    private Long outputOssId;
 
     /**
      * 开始时间

+ 2 - 2
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/vo/VideoStableImportVo.java

@@ -33,11 +33,11 @@ public class VideoStableImportVo implements Serializable
 
      /** 输入图片集路径 */
     @ExcelProperty(value = "输入图片集ossId")
-    private String inputOssId;
+    private Long inputOssId;
 
      /** 去抖动的图片集路径 */
     @ExcelProperty(value = "去抖动的图片集ossId")
-    private String outputOssId;
+    private Long outputOssId;
 
      /** 开始时间 */
     @ExcelProperty(value = "开始时间")

+ 2 - 2
taais-modules/taais-biz/src/main/java/com/taais/biz/domain/vo/VideoStableVo.java

@@ -40,11 +40,11 @@ private static final long serialVersionUID = 1L;
 
     /** 输入图片集路径 */
     @ExcelProperty(value = "输入图片集ossID")
-    private String inputOssId;
+    private Long inputOssId;
 
     /** 去抖动的图片集路径 */
     @ExcelProperty(value = "去抖动的图片集ossId")
-    private String outputOssId;
+    private Long outputOssId;
 
     /** 开始时间 */
     @ExcelProperty(value = "开始时间")

+ 16 - 3
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/VideoStableServiceImpl.java

@@ -14,13 +14,13 @@ import com.taais.common.json.utils.JsonUtils;
 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 io.swagger.v3.oas.annotations.Parameter;
+import com.taais.system.domain.vo.SysOssVo;
+import com.taais.system.service.ISysOssService;
 import jakarta.annotation.Resource;
-import lombok.Builder;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.entity.StringEntity;
-import org.opencv.video.Video;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -49,6 +49,9 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
     @Value("${server.video_stable_url}")
     private String video_stable_url;
 
+    @Autowired
+    private ISysOssService ossService;
+
     @Resource
     private VideoStableMapper videoStableMapper;
 
@@ -124,6 +127,16 @@ public class VideoStableServiceImpl extends BaseServiceImpl<VideoStableMapper, V
      */
     @Override
     public boolean insert(VideoStableBo videoStableBo) {
+        // 检查input_oss_id是否存在
+        if (ObjectUtil.isNull(videoStableBo.getInputOssId())) {
+            return false;
+        }
+
+        SysOssVo ossEntity = ossService.getById(videoStableBo.getInputOssId());
+        if (ObjectUtil.isNull(ossEntity)) {
+            return false;
+        }
+
         VideoStable videoStable = MapstructUtils.convert(videoStableBo, VideoStable.class);
         videoStable.setStatus(BizConstant.VideoStatus.NOT_START);