From 3c0b822df3f0ea0fcd1bb9e008620d0deea61954 Mon Sep 17 00:00:00 2001 From: qhd <1766646056@qq.com> Date: Mon, 26 Jan 2026 11:39:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96MongoDB=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=B9=B6=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=89=8D=E7=BC=80=E8=8E=B7=E5=8F=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.yml | 14 ++++++++++---- service/file_service.go | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/config.yml b/config.yml index b37cce7..3b6d884 100644 --- a/config.yml +++ b/config.yml @@ -5,10 +5,12 @@ rate: limit: 200 burst: 300 mongo: - logger: - level: "all" - stdout: true - address: "mongodb://192.168.3.200:27017/oss?retryWrites=true" + default: + address: "mongodb://192.168.3.200:27017/oss?retryWrites=true" + database: "oss" + maxPoolSize: 100 + minPoolSize: 10 + connectTimeout: "10s" redis: # 集群模式配置方法 default: @@ -35,6 +37,10 @@ minio: secure: false # 本地 MinIO 关闭 SSL(生产按需改为 true) region: "us-east-1" # 与 MinIO 服务端 REGION 一致(默认 us-east-1) +# 文件上传服务地址,与oss模块minio中的endpoint一致 +filePrefix: + endpoint: "192.168.3.200:9000" + # 文件存储初始化容量大小配置 oss: capacitySize: 500 #文件存储初始化容量(单位MB) \ No newline at end of file diff --git a/service/file_service.go b/service/file_service.go index 3e8d622..698ed3b 100644 --- a/service/file_service.go +++ b/service/file_service.go @@ -114,6 +114,6 @@ func (f *file) UploadFile(ctx context.Context, req *dto.UploadFileReq) (res *dto // 返回图片url return &dto.UploadFileRes{ FileURL: fileURL, - FileAddressPrefix: minio.GetIFileAddressPrefix(ctx), + FileAddressPrefix: minio.GetFileAddressPrefix(ctx), }, err }