|
@@ -1,6 +1,8 @@
|
|
|
package com.fdkankan.contro.controller;
|
|
|
|
|
|
+import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.http.HttpUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -16,6 +18,7 @@ import com.fdkankan.contro.vo.ResponseSceneFile;
|
|
|
import com.fdkankan.contro.vo.SceneUploadCountParamVO;
|
|
|
import com.fdkankan.contro.vo.SendCallAlgorithmParam;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
+import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -31,6 +34,7 @@ import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 场景文件上传模块
|
|
@@ -245,4 +249,43 @@ public class SceneFileController{
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 边拍边上传文件上传
|
|
|
+ * @param file
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("uploadShooting")
|
|
|
+ public ResultData uploadTest(
|
|
|
+ @RequestParam(value = "file") MultipartFile file,
|
|
|
+ @RequestPart SendCallAlgorithmDetail details) throws Exception {
|
|
|
+
|
|
|
+ String parentPath = "/oss/4dkankan/bd_server/upload_while_shooting/" + details.getUuid() + "/";
|
|
|
+ String localPath = parentPath + details.getIndex() + details.getFileName();
|
|
|
+ FileUtil.mkParentDirs(localPath);
|
|
|
+ String url = "https://survey.4dkankan.com";
|
|
|
+ if(details.getFileName().equals("config.json")){
|
|
|
+ file.transferTo(new File(parentPath + "config.json"));
|
|
|
+ url += parentPath.replace("4dkankan/", "") + "config.json";
|
|
|
+ }else{
|
|
|
+ file.transferTo(new File(localPath));
|
|
|
+ url += localPath.replace("4dkankan/", "");
|
|
|
+ }
|
|
|
+
|
|
|
+ HttpUtil.post("http://127.0.0.1:8085/api/scene/file/sendCallAlgorithm", JSON.toJSONString(param));
|
|
|
+
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 单个文件上传
|
|
|
+ * @param file
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("noticeBuildUploadShooting")
|
|
|
+ public ResultData upload(@RequestBody SendCallAlgorithmDetail details) throws Exception {
|
|
|
+ return sceneFileBuildService.uploadFile(file, params,dir);
|
|
|
+ }
|
|
|
+
|
|
|
}
|