dengsixing vor 9 Monaten
Ursprung
Commit
735e52af23

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

@@ -108,8 +108,8 @@ public class SceneFileController{
      */
     @PostMapping("uploadCustom")
     public ResultData uploadCustom(@RequestParam(value = "file") MultipartFile file,
-                             String params) throws Exception {
-        return sceneFileBuildService.uploadFile(file, params);
+                             String path) throws Exception {
+        return sceneFileBuildService.uploadFileCustom(file, path);
     }
 
 

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

@@ -34,5 +34,5 @@ public interface ISceneFileBuildService extends IService<SceneFileBuild> {
 
     ResultData uploadFile(MultipartFile file, String params) throws Exception;
 
-    ResultData uploadFileCustom(MultipartFile file, String params) throws Exception;
+    ResultData uploadFileCustom(MultipartFile file, String path) throws Exception;
 }

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

@@ -2027,21 +2027,21 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     }
 
     @Override
-    public ResultData uploadFileCustom(MultipartFile file, String params) 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);
-
-
-
-        return null;
+    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