| | |
| | | } |
| | | |
| | | @Override |
| | | public BladeFile saveAttachFile(MultipartFile file, String fileName, String type) throws IOException { |
| | | public BladeFile saveAttachFile(MultipartFile file, String fileName, List<List<String>> type) throws IOException { |
| | | BladeFile bladeFile = ossBuilder.template().putFile(pojo.getBucket(),fileName, file.getInputStream()); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile, type); |
| | | bladeFile.setAttachId(attachId); |
| | |
| | | return bladeFile; |
| | | } |
| | | |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile, String type) { |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile, List<List<String>> type) { |
| | | String fileExtension = FileUtil.getFileExtension(fileName); |
| | | Attach attach = new Attach(); |
| | | attach.setDomainUrl(bladeFile.getDomain()); |
| | |
| | | saveAttachFile(new MockMultipartFile( mediaFile.getName(), |
| | | mediaFile.getName(), |
| | | "application/octet-stream", |
| | | new FileInputStream(mediaFile)), name, Attach.RESULT_TYPE_VEDIO_SHOW); |
| | | new FileInputStream(mediaFile)), name, null); |
| | | log.info("第{}个视频保存入库完成...", (i + 1)); |
| | | |
| | | } |