feat(file): 配置Minio文件存储支持

- 新增Minio存储类型配置选项- 配置Minio服务地址、访问密钥和存储桶名称
- 更新默认模块名称以使用Minio存储
- 保留原有基础路径和URL前缀配置- 支持MinioClient Bean的自动配置
- 确保存储桶具有读写权限并提前创建
This commit is contained in:
2025-11-08 11:07:53 +08:00
parent 3beeec7296
commit 73db43e220
2 changed files with 15 additions and 3 deletions

View File

@@ -15,10 +15,22 @@ SiWu:
gc: gc:
starter: starter:
file: file:
# 一个存储文件的绝对路径需要有写入权限这里可以直接引用SiWu的配置 # 存储类型指定为minio启用MinioClient Bean
type: minio
# 基础存储路径(保留原有配置,不冲突)
basePath: ${SiWu.profile} basePath: ${SiWu.profile}
# 静态资源访问接口前缀 # 静态资源访问前缀(保留原有配置)
urlPrefix: http://127.0.0.1:${server.port}${server.servlet.context-path}static/ urlPrefix: http://127.0.0.1:${server.port}${server.servlet.context-path}static/
# Minio核心配置根据你的Minio服务实际信息修改
minio:
# Minio服务地址格式http://ip:端口例如本地默认9000端口
url: http://49.232.154.205:10900
# Minio访问密钥对应Minio的accessKey
accessKey: 4EsLD9g9OM09DT0HaBKj
# Minio密钥对应Minio的secretKey
secretKey: 05SFC5fleqTnaLRYBrxHiphMFYbGX5nYicj0WCHA
# 存储桶名称必须提前在Minio中创建且有读写权限
bucketName: dashboard
# 开发环境配置 # 开发环境配置
server: server:

View File

@@ -61,7 +61,7 @@ public class DataRoomFileController extends SuperController {
DataRoomFileEntity entity = new DataRoomFileEntity(); DataRoomFileEntity entity = new DataRoomFileEntity();
// 不同业务自己控制 // 不同业务自己控制
if (StringUtils.isBlank(module)) { if (StringUtils.isBlank(module)) {
module = "other"; module = "minio";
} }
entity.setModule(module); entity.setModule(module);
sysOssService.upload(file, entity, response, request); sysOssService.upload(file, entity, response, request);