FileServiceController.java 1012 B

1234567891011121314151617181920212223242526272829303132333435
  1. package com.fjhx.common.controller;
  2. import com.alibaba.fastjson2.JSONObject;
  3. import com.fjhx.common.service.file.FtpFileService;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.PostMapping;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RestController;
  8. /**
  9. * FTP文件服务控制器
  10. */
  11. @RestController
  12. @RequestMapping("/fileService")
  13. public class FileServiceController {
  14. @Autowired
  15. private FtpFileService ftpFileService;
  16. /**
  17. * 创建临时文件夹
  18. */
  19. @PostMapping("/createTempFolder")
  20. public JSONObject createTempFolder() {
  21. return ftpFileService.createTempFolder();
  22. }
  23. /**
  24. * 将临时文件移动到永久文件夹
  25. */
  26. @PostMapping("/moveTempFolderToPermanent")
  27. public void moveFolder(String sourceFolderPath, String targetFolderPath) {
  28. ftpFileService.moveFolder(sourceFolderPath, targetFolderPath);
  29. }
  30. }