| | |
| | | @PostMapping("/put-file") |
| | | @ApiOperation(value = "上传文件", notes = "上传文件") |
| | | public R<BladeFile> putFile(@RequestParam MultipartFile file) { |
| | | BladeFile bladeFile = ossBuilder.template().putFile(file.getOriginalFilename(), file.getInputStream()); |
| | | BladeFile bladeFile = ossBuilder.template("estack").putFile(file.getOriginalFilename(), file.getInputStream()); |
| | | return R.data(bladeFile); |
| | | } |
| | | |
| | |
| | | @NotNull |
| | | private BladeFile getBladeFile(@RequestParam MultipartFile file) throws IOException { |
| | | String fileName = file.getOriginalFilename(); |
| | | BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | BladeFile bladeFile = ossBuilder.template("estack").putFile(fileName, file.getInputStream()); |
| | | Long attachId = buildAttach(fileName, null, file.getSize(), bladeFile); |
| | | bladeFile.setAttachId(attachId); |
| | | return bladeFile; |