| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | |
| | | @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") |