|
@@ -1044,7 +1044,7 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void removePrice() {
|
|
|
+ public void removePrice(Integer number) {
|
|
|
try {
|
|
|
// 创建MinioClient对象
|
|
|
MinioClient minioClient = MinioClient.builder()
|
|
@@ -1057,7 +1057,7 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
|
String prefix = "/camera_picture/normal/";
|
|
|
|
|
|
// 指定要删除的时间点(此处为当前时间之前的时间)
|
|
|
- ZonedDateTime deleteTime = ZonedDateTime.now().minusDays(9); // 删除30天前的文件
|
|
|
+ ZonedDateTime deleteTime = ZonedDateTime.now().minusDays(number); // 删除30天前的文件
|
|
|
|
|
|
// 递归删除指定目录下的所有文件和空目录
|
|
|
deleteObjectsAndEmptyDirectoriesRecursively(minioClient, bucketName, prefix, deleteTime);
|
|
@@ -1112,26 +1112,8 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void test() {
|
|
|
- try {
|
|
|
- // Initialize Minio client
|
|
|
- MinioClient minioClient = MinioClient.builder()
|
|
|
- .endpoint(endpoint)
|
|
|
- .credentials(accessKey, secretKey)
|
|
|
- .build();
|
|
|
-
|
|
|
- // Bucket name
|
|
|
- String bucketName = this.bucketName;
|
|
|
-
|
|
|
- // List all objects in the bucket
|
|
|
- Iterable<Result<Item>> results = minioClient.listObjects(ListObjectsArgs.builder().bucket(bucketName).recursive(true).build());
|
|
|
- for (Result<Item> result : results) {
|
|
|
- Item item = result.get();
|
|
|
- log.info(item.objectName());
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("Error occurred: " + e);
|
|
|
- }
|
|
|
+ public void test(Integer number) {
|
|
|
+ removePrice(number);
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|