feat(content): Implement content module foundation

This commit is contained in:
2025-04-08 01:16:42 +08:00
parent 730a23dee3
commit 6b5bd6daaf
90 changed files with 6284 additions and 21 deletions
@@ -224,4 +224,24 @@ public class MinioUtils {
throw new RuntimeException("获取文件基础URL失败", e);
}
}
public String uploadObject(String fileType, String fileName, InputStream inputStream, long size, String contentType) throws Exception {
// 检查存储桶是否存在
createBucket(bucketName);
// 生成对象名称
String objectName = fileType + "/" + fileName;
// 上传文件
minioClient.putObject(
PutObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.stream(inputStream, size, -1)
.contentType(contentType)
.build()
);
return objectName;
}
}