dengsixing 9 月之前
父节点
当前提交
3c9859cf36

+ 12 - 0
src/main/java/com/fdkankan/contro/controller/SceneFileController.java

@@ -100,6 +100,18 @@ public class SceneFileController{
         return sceneFileBuildService.uploadFile(file, params);
         return sceneFileBuildService.uploadFile(file, params);
     }
     }
 
 
+    /**
+     * 自定义上传
+     * @param file
+     * @param params
+     * @return
+     */
+    @PostMapping("uploadCustom")
+    public ResultData uploadCustom(@RequestParam(value = "file") MultipartFile file,
+                             String path) throws Exception {
+        return sceneFileBuildService.uploadFileCustom(file, path);
+    }
+
 
 
     /**
     /**
      * 国际八目相机调用
      * 国际八目相机调用

+ 2 - 0
src/main/java/com/fdkankan/contro/service/ISceneFileBuildService.java

@@ -33,4 +33,6 @@ public interface ISceneFileBuildService extends IService<SceneFileBuild> {
     ResultData uploadFile(MultipartFile file, String params) throws Exception;
     ResultData uploadFile(MultipartFile file, String params) throws Exception;
 
 
     ResultData uploadLiguang(String num, String snCode, String ossPath) throws Exception;
     ResultData uploadLiguang(String num, String snCode, String ossPath) throws Exception;
+
+    ResultData uploadFileCustom(MultipartFile file, String path) throws Exception;
 }
 }

+ 18 - 0
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -1883,6 +1883,24 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     }
     }
 
 
     @Override
     @Override
+    public ResultData uploadFileCustom(MultipartFile file, String path) throws Exception {
+//        log.info("uploadFileCustom-params: "+params);
+//        params = params.replaceAll("%2B", "+");
+//        Base64 base64 = new Base64();
+//        String cipher = params;
+//        // 私钥解密过程
+//        byte[] res = RSAEncrypt.decrypt(RSAEncrypt.loadPrivateKeyByStr(RSAEncrypt.loadPrivateKeyByFile()),
+//                base64.decode(cipher));
+//        String restr = new String(res, "UTF-8");
+//        log.info("uploadFileCustom-params解密结果:" + restr);
+//        JSONObject jsonObject = JSON.parseObject(restr);
+        File tempFile = FileUtil.createTempFile(new File(ConstantFilePath.BASE_PATH + "/temp"));
+
+        fYunFileService.uploadFile(tempFile.getAbsolutePath(), path);
+        return ResultData.ok();
+    }
+
+    @Override
     public ResultData uploadFile(MultipartFile file, String params) throws Exception {
     public ResultData uploadFile(MultipartFile file, String params) throws Exception {
 
 
         String uuid = UUID.randomUUID().toString();
         String uuid = UUID.randomUUID().toString();