@Test void downloadFile() { }
@GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("下载文件") @PreAuthorize("isAuthenticated()") public void downloadFile(@ApiParam(value = "文件id", required = true) @PathVariable String id, HttpServletResponse response) throws IOException { fileInfoService.downloadFile(id, response); }
FileController { @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("下载文件") @PreAuthorize("isAuthenticated()") public void downloadFile(@ApiParam(value = "文件id", required = true) @PathVariable String id, HttpServletResponse response) throws IOException { fileInfoService.downloadFile(id, response); } }
FileController { @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("下载文件") @PreAuthorize("isAuthenticated()") public void downloadFile(@ApiParam(value = "文件id", required = true) @PathVariable String id, HttpServletResponse response) throws IOException { fileInfoService.downloadFile(id, response); }  }
FileController { @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("下载文件") @PreAuthorize("isAuthenticated()") public void downloadFile(@ApiParam(value = "文件id", required = true) @PathVariable String id, HttpServletResponse response) throws IOException { fileInfoService.downloadFile(id, response); }  @PostMapping @ApiOperation("上传文件") @PreAuthorize("isAuthenticated()") Result<FileInfo> uploadFile(MultipartFile file); @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("下载文件") @PreAuthorize("isAuthenticated()") void downloadFile(@ApiParam(value = "文件id", required = true) @PathVariable String id, HttpServletResponse response) thr; @GetMapping("/log") @ApiOperation("下载服务器日志") @PreAuthorize("hasAnyRole('ADMIN')") void downloadLogFile(HttpServletResponse response); }
FileController { @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("下载文件") @PreAuthorize("isAuthenticated()") public void downloadFile(@ApiParam(value = "文件id", required = true) @PathVariable String id, HttpServletResponse response) throws IOException { fileInfoService.downloadFile(id, response); }  @PostMapping @ApiOperation("上传文件") @PreAuthorize("isAuthenticated()") Result<FileInfo> uploadFile(MultipartFile file); @GetMapping("/{id:^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9]+$}") @ApiOperation("下载文件") @PreAuthorize("isAuthenticated()") void downloadFile(@ApiParam(value = "文件id", required = true) @PathVariable String id, HttpServletResponse response) thr; @GetMapping("/log") @ApiOperation("下载服务器日志") @PreAuthorize("hasAnyRole('ADMIN')") void downloadLogFile(HttpServletResponse response);  }