Browse Source

测试归档、解冻

dsx 2 years ago
parent
commit
182cd13f93

+ 19 - 1
src/main/java/com/fdkankan/scene/controller/TestController.java

@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.io.IOException;
+
 /**
  * <p>
  * TODO
@@ -39,8 +41,24 @@ public class TestController {
 
     @GetMapping("/jd")
     public ResultData jd(String path){
-        fYunFileService.copyFileBetweenBucket("4dkk-bak", path, "4dkk-bak", path);
+        fYunFileService.restoreFolder("4dkk-bak", path, 1);
+//        fYunFileService.copyFileBetweenBucket("4dkk-bak", path, "4dkk-bak", path);
+        return ResultData.ok();
+    }
+
+    @GetMapping("/delete")
+    public ResultData delete(String path) throws IOException {
+        fYunFileService.deleteFile("4dkk-bak", path);
+//        fYunFileService.copyFileBetweenBucket("4dkk-bak", path, "4dkk-bak", path);
         return ResultData.ok();
     }
 
+    @GetMapping("/copy")
+    public ResultData copy(String path) {
+        fYunFileService.copyFileBetweenBucket("4dkk-bak", path, "4dkankan", path);
+        fYunFileService.deleteFolder("4dkk-bak", path);
+        return ResultData.ok();
+    }
+
+
 }

+ 1 - 2
src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

@@ -114,8 +114,7 @@ public class SceneServiceImpl implements ISceneService {
     }
 
     public static void main(String[] args) throws IOException {
-        Image rotateImg = ImgUtil.rotate(ImageIO.read(FileUtil.file("C:\\Users\\dsx\\Desktop\\IMG_6633.HEIC.JPG")), 90);
-        ImgUtil.write(rotateImg, FileUtil.file("C:\\Users\\dsx\\Desktop\\IMG_6633.HEIC_2.JPG"));
+        Image rotateImg = ImgUtil.rotate(ImageIO.read(new File("C:\\Users\\dsx\\Desktop\\IMG_0231.HEIC.JPG")), 0);
     }
 
     @Override