合并日志 新增自定义文件路径

This commit is contained in:
2025-04-12 16:00:50 +08:00
parent 491165184a
commit 700479d131
3 changed files with 49 additions and 19 deletions

View File

@@ -24,6 +24,7 @@ class StorageConfig {
final String host;
final int port;
final bool ssl;
final String? path;
final String accessKey;
final String secretKey;
@@ -31,6 +32,7 @@ class StorageConfig {
{required this.host,
required this.port,
this.ssl = false,
this.path,
required this.accessKey,
required this.secretKey});
}

View File

@@ -49,6 +49,6 @@ class MinioStorage implements Storage {
Future<String> uploadObject(
String bucketName, String objectName, Uint8List data) async {
await _minio.putObject(bucketName, objectName, Stream.fromIterable([data]));
return "http${_config.ssl ? "s" : ""}://${_config.host}:${_config.port}/$bucketName/$objectName";
return "${_config.path ?? 'http${_config.ssl ? "s" : ""}://${_config.host}:${_config.port}'}/$bucketName/$objectName";
}
}