Переглянути джерело

sendCallAlgorithm接口去掉details解密

dsx 2 роки тому
батько
коміт
dec5839d2c

+ 5 - 4
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -877,12 +877,13 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 //            log.error("details解密报错", e);
 //            return ResultData.error(ErrorCode.PARAM_FORMAT_ERROR);
 //        }
-        String details = param.getDetails();
-        SendCallAlgorithmDetail detail = JSON.parseObject(details, SendCallAlgorithmDetail.class);
+        SendCallAlgorithmDetail detail = param.getDetails();
         Integer fileChunkSum = detail.getFileChunkSum();
-
-
         String uuid = detail.getUuid();
+        if(Objects.isNull(fileChunkSum) || StrUtil.isBlank(uuid)){
+            throw new BusinessException(ErrorCode.PARAM_REQUIRED.code(), "details参数中fileChunkSum和uuid不能为空");
+        }
+
         String snCode = uuid.split("_")[0];
         String parentPath = sendCallAlgorithmPath.concat(uuid);
 //        if(FileUtil.exist(parentPath)){

+ 4 - 2
src/main/java/com/fdkankan/contro/vo/SendCallAlgorithmParam.java

@@ -1,8 +1,10 @@
 package com.fdkankan.contro.vo;
 
+import com.fdkankan.contro.bean.SendCallAlgorithmDetail;
 import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 
 @Data
 public class SendCallAlgorithmParam {
@@ -10,7 +12,7 @@ public class SendCallAlgorithmParam {
     @NotBlank(message = "filepath不能为空")
     private String filepath;
 
-    @NotBlank(message = "details不能为空")
-    private String details;
+    @NotNull(message = "details不能为空")
+    private SendCallAlgorithmDetail details;
 
 }