|
|
|
@ -83,32 +83,6 @@ public class FileServiceImpl implements IFileService { |
|
|
|
return chekFileVos; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Async("mySimpleAsync") |
|
|
|
public void checkUploadSave(FileUploadDto fileUploadDto) throws IOException { |
|
|
|
//redis累计艺术家当天上传次数,12.00后过期
|
|
|
|
writeUploadTotalNum(fileUploadDto.getCreatorId()); |
|
|
|
ArrayList<MultipartFile> multipartFiles = new ArrayList<>(); |
|
|
|
for (FileDto fileDto : fileUploadDto.getFiles()) { |
|
|
|
InputStream inputStream = new ByteArrayInputStream(fileDto.getBytes()); |
|
|
|
MultipartFile files = new MockMultipartFile(fileDto.getName(), fileDto.getOriginalFilename(), ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream); |
|
|
|
//System.out.println(files.getSize());
|
|
|
|
multipartFiles.add(files); |
|
|
|
} |
|
|
|
|
|
|
|
//检测图片
|
|
|
|
for (ChekFileVo chekFileVo : checkImg(multipartFiles)) { |
|
|
|
//图片上传
|
|
|
|
String imgUrl = qiniuService.userUpload(chekFileVo.getFile()); |
|
|
|
TiktokImgMiniDto tiktokImg = new TiktokImgMiniDto(); |
|
|
|
tiktokImg.setImgUrl(imgUrl); |
|
|
|
tiktokImg.setStatus(chekFileVo.getStatus()); |
|
|
|
tiktokImg.setTypeId(fileUploadDto.getTypeId()); |
|
|
|
tiktokImg.setCreatorId(fileUploadDto.getCreatorId()); |
|
|
|
remoteImgService.insertTiktokImg(tiktokImg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void writeUploadTotalNum(Long creatorId) { |
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|