Skip to content

Commit a636f08

Browse files
committed
refactor: 移除冗余的文件保留时间计算函数,简化文件上传逻辑
1 parent 957b49b commit a636f08

File tree

2 files changed

+147
-357
lines changed

2 files changed

+147
-357
lines changed

src/s3/config.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ export interface FileConfig {
99
bucket: string; // 存储桶名称
1010
}
1111

12-
/**
13-
* 计算文件保留时间(毫秒)- 仅用于返回预计过期时间
14-
* 实际过期时间由 MinIO 存储桶生命周期策略自动管理
15-
*/
16-
export function getRetentionMilliseconds(retentionDays: number): number {
17-
return retentionDays * 24 * 60 * 60 * 1000;
18-
}
19-
2012
// 默认配置(动态从环境变量读取)
2113
export const defaultFileConfig: FileConfig = {
2214
maxFileSize: process.env.MAX_FILE_SIZE ? parseInt(process.env.MAX_FILE_SIZE) : 20 * 1024 * 1024, // 默认 20MB
@@ -35,6 +27,5 @@ export interface FileMetadata {
3527
contentType: string;
3628
size: number;
3729
uploadTime: Date;
38-
expiresAt: Date; // 预计过期时间(实际过期由 MinIO 生命周期策略管理)
3930
accessUrl: string;
4031
}

0 commit comments

Comments
 (0)