|
|
@ -90,7 +90,7 @@ public class FileServiceImpl implements IFileService { |
|
|
@Async("mySimpleAsync") |
|
|
@Async("mySimpleAsync") |
|
|
public void checkUploadSave(FileUploadDto fileUploadDto) throws IOException { |
|
|
public void checkUploadSave(FileUploadDto fileUploadDto) throws IOException { |
|
|
//redis累计平台用户当天下载次数,12.00后过期
|
|
|
//redis累计平台用户当天下载次数,12.00后过期
|
|
|
writeDownloadTotalNum(fileUploadDto.getCreatorId()); |
|
|
writeUploadTotalNum(fileUploadDto.getCreatorId()); |
|
|
ArrayList<MultipartFile> multipartFiles = new ArrayList<>(); |
|
|
ArrayList<MultipartFile> multipartFiles = new ArrayList<>(); |
|
|
for (FileDto fileDto : fileUploadDto.getFiles()) { |
|
|
for (FileDto fileDto : fileUploadDto.getFiles()) { |
|
|
InputStream inputStream = new ByteArrayInputStream(fileDto.getBytes()); |
|
|
InputStream inputStream = new ByteArrayInputStream(fileDto.getBytes()); |
|
|
@ -113,12 +113,12 @@ public class FileServiceImpl implements IFileService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void writeDownloadTotalNum(Long creator) { |
|
|
public void writeUploadTotalNum(Long creatorId) { |
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
String date = df.format(new Date()); |
|
|
String date = df.format(new Date()); |
|
|
log.info("日期【{}】艺术家【{}】下载数+1",date,creator); |
|
|
log.info("日期【{}】艺术家【{}】下载数+1",date,creatorId); |
|
|
String redisKey = RedisKeyConstant.CREATOR_DOWNLOAD_KEY + date; |
|
|
String redisKey = RedisKeyConstant.CREATOR_UPLOAD_KEY + date; |
|
|
redisService.hashIncr(redisKey, creator.toString(), 1); |
|
|
redisService.hashIncr(redisKey, creatorId.toString(), 1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|