fix 通用下载增加下载预览次数

This commit is contained in:
lijiarao
2021-12-23 11:43:08 +08:00
parent 1526068940
commit 6ffa271ec8
2 changed files with 6 additions and 4 deletions
@@ -185,7 +185,7 @@ public class CommonController {
outputStream.write(buf, 0, len);
}
response.flushBuffer();
//统计下载和上传次数
//统计下载和预览次数
if ("download".equals(type)) {
Integer downloadNumber = ossFile.getDownloadNumber();
if (downloadNumber == null) {
@@ -194,6 +194,8 @@ public class CommonController {
ossFile.setDownloadNumber(downloadNumber + 1);
}
ossFileService.updateAndPush(ossFile);
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ossFileService.saveDownloadTimes(ossFile.getId(), loginUser.getId());
} else if ("view".equals(type)) {
Integer viewNumber = ossFile.getViewNumber();
if (viewNumber == null) {