fix(定时报告): 第三方平台无法下载报告附件

This commit is contained in:
fit2cloud-chenyw 2022-09-30 15:21:04 +08:00
parent 78baaac873
commit 2c953f3a89

View File

@ -24,6 +24,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -109,9 +110,10 @@ public class SystemParameterController {
return new ResponseEntity<>(bytes, headers, HttpStatus.OK);
}
@GetMapping("/filedown/{fileId}/{fileName}")
public ResponseEntity<ByteArrayResource> down(@PathVariable("fileId") String fileId, @PathVariable("fileName") String fileName) throws Exception {
@GetMapping("/filedown/{fileId}/{fileName}/{suffix}")
public ResponseEntity<ByteArrayResource> down(@PathVariable("fileId") String fileId, @PathVariable("fileName") String fileName, @PathVariable("suffix") String suffix) throws Exception {
fileName = URLDecoder.decode(fileName, "UTF-8");
fileName += ("." + suffix);
return GlobalFileUtil.down(fileId, fileName);
}