|
@@ -1,6 +1,7 @@
|
|
|
package com.nokia.service;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.google.common.collect.ImmutableMap;
|
|
|
import com.nokia.common.R;
|
|
|
import com.nokia.common.exception.MyRuntimeException;
|
|
|
import com.nokia.dao.OperationLogDao;
|
|
@@ -23,9 +24,14 @@ import java.time.LocalDateTime;
|
|
|
import java.time.LocalTime;
|
|
|
import java.time.temporal.TemporalAdjusters;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
public class LogService {
|
|
|
+ /**
|
|
|
+ * 临时文件标签,1天后自动删除
|
|
|
+ */
|
|
|
+ private static final Map<String, String> TAGS = ImmutableMap.of("tmp", "1");
|
|
|
private final OperationLogDao operationLogDao;
|
|
|
private final VerificationLogDao verificationLogDao;
|
|
|
private final UserService userService;
|
|
@@ -80,7 +86,7 @@ public class LogService {
|
|
|
byte[] bytes = os.toByteArray();
|
|
|
long objectSize = bytes.length;
|
|
|
// 保存文件
|
|
|
- fileService.putObject(object, new ByteArrayInputStream(bytes), objectSize);
|
|
|
+ fileService.putObject(object, new ByteArrayInputStream(bytes), objectSize, TAGS);
|
|
|
// 生成下载链接
|
|
|
String url = fileService.getDownloadUrl(object);
|
|
|
// 记录操作日志
|
|
@@ -142,7 +148,7 @@ public class LogService {
|
|
|
byte[] bytes = os.toByteArray();
|
|
|
long objectSize = bytes.length;
|
|
|
// 保存文件
|
|
|
- fileService.putObject(object, new ByteArrayInputStream(bytes), objectSize);
|
|
|
+ fileService.putObject(object, new ByteArrayInputStream(bytes), objectSize, TAGS);
|
|
|
// 生成下载链接
|
|
|
String url = fileService.getDownloadUrl(object);
|
|
|
// 记录操作日志
|