From 74c08a504d55ae137004cb44e0145010f62f9585 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期五, 25 八月 2023 14:47:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MinioTask.java | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MinioTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MinioTask.java
index 3ca0f65..69ea287 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MinioTask.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/MinioTask.java
@@ -6,6 +6,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
+import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
@@ -21,6 +22,8 @@
@Component("MinioTask")
@Slf4j(topic = "minio")
public class MinioTask {
+ @Resource
+ MinioUtils minioUtil;
public void delHistoryTask(Integer saveDays) {
log.debug("鎵ц鍘嗗彶鏁版嵁鍒犻櫎");
@@ -30,7 +33,7 @@
buckets.add("pic");
buckets.add("record");
for (String name : buckets) {
- Iterable<Result<Item>> listObjectsPic = MinioUtils.getObjectsByBucket(name);
+ Iterable<Result<Item>> listObjectsPic = minioUtil.getObjectsByBucket(name);
for (Result<Item> result : listObjectsPic) {
Item item = result.get();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.of("Asia/Shanghai"));
@@ -48,7 +51,7 @@
log.debug("objectTime : " + objectTime);
log.debug("expireTime : " + expireTime);
log.debug("objectTime 鏃堕棿鍦� expireTime 涔嬪墠,鎵ц鍒犻櫎");
- boolean b = MinioUtils.removeObject(name, item.objectName());
+ boolean b = minioUtil.removeObject(name, item.objectName());
if (b) {
log.debug("鎴愬姛鍒犻櫎杩囨湡鏁版嵁锛�" + item.objectName() + "---" + item.lastModified());
}
--
Gitblit v1.9.3