中扬CRM客户关系管理系统
LSH
2023-08-03 d699794bb024ae7d5bb66fa24070745eb92c9b05
src/main/java/com/zy/crm/manager/controller/PlanController.java
@@ -36,6 +36,12 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.core.io.Resource;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
@@ -254,6 +260,19 @@
        }
    }
    @RequestMapping(value = "/plan/download/file/auth")
//    @ManagerAuth
    public R downloadFile(@RequestParam("downloadUrl") String downloadUrl,HttpServletResponse response){
        System.out.println("---开始---");
//        MultipartFile
        try{
            ResponseEntity<Resource> resourceResponseEntity = FileSaveExampleUtil.downloadFile(downloadUrl, response);
            return R.ok(resourceResponseEntity);
        }catch (Exception e){
            return R.error();
        }
    }
    @PostMapping(value = "/plan/approval/auth")