From 40f998657a5dac52190c3d7bf5c358a722f15827 Mon Sep 17 00:00:00 2001 From: Leo <98382335+gaoziman@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:18:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=9B=86=E6=88=90OSS=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E5=BA=94=E7=94=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在Web启动模块中集成OSS插件依赖 - 启用@EnableCoderOss注解激活OSS功能 - 配置阿里云OSS存储服务参数 - 添加存储服务类型切换支持 - 优化应用端口配置显示 - 完善开发环境配置文件 --- coder-common-thin-web/pom.xml | 6 +++++ .../leocoder/thin/web/CoderApplication.java | 4 ++- .../src/main/resources/application-dev.yml | 26 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/coder-common-thin-web/pom.xml b/coder-common-thin-web/pom.xml index f311bd4..e2694d1 100644 --- a/coder-common-thin-web/pom.xml +++ b/coder-common-thin-web/pom.xml @@ -31,6 +31,12 @@ org.springdoc springdoc-openapi-starter-webmvc-ui + + + org.leocoder.thin + coder-common-thin-oss + ${revision} + diff --git a/coder-common-thin-web/src/main/java/org/leocoder/thin/web/CoderApplication.java b/coder-common-thin-web/src/main/java/org/leocoder/thin/web/CoderApplication.java index c970fbf..cc1f17b 100644 --- a/coder-common-thin-web/src/main/java/org/leocoder/thin/web/CoderApplication.java +++ b/coder-common-thin-web/src/main/java/org/leocoder/thin/web/CoderApplication.java @@ -6,6 +6,7 @@ import org.leocoder.thin.easyexcel.anno.EnableCoderEasyExcel; import org.leocoder.thin.limit.anno.EnableCoderLimit; import org.leocoder.thin.mybatisplus.anno.EnableMybatisPlus; import org.leocoder.thin.operlog.annotation.EnableOperLog; +import org.leocoder.thin.oss.annotation.EnableCoderOss; import org.leocoder.thin.repect.anno.EnableCoderRepeatSubmit; import org.leocoder.thin.resultex.anno.EnableResultEx; import org.leocoder.thin.satoken.anno.EnableCoderSaToken; @@ -27,6 +28,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; @EnableMybatisPlus @EnableResultEx @EnableOperLog +@EnableCoderOss // @EnableCoderDict @EnableScheduling @Slf4j @@ -45,7 +47,7 @@ public class CoderApplication { "| | ( <_> ) | /_____/ / | \\| ` \\/ Y \\ / | \\ \n" + "|____|__ \\____/|__| \\____|__ /_______ /\\____|__ /___\\____|__ / \n" + " \\/ \\/ \\/ \\/ \\/ \n" + - "CoderApplication[18088] => 闪亮登场(๑•̀ㅂ•́) ✧" + "CoderApplication[18099] => 闪亮登场(๑•̀ㅂ•́) ✧" ); } } diff --git a/coder-common-thin-web/src/main/resources/application-dev.yml b/coder-common-thin-web/src/main/resources/application-dev.yml index 3330afa..b11dbb8 100755 --- a/coder-common-thin-web/src/main/resources/application-dev.yml +++ b/coder-common-thin-web/src/main/resources/application-dev.yml @@ -90,6 +90,32 @@ coder: projectVersion: 1.0.0 # 文件路径 示例[Windows配置D:/CoderFile,Linux配置 /usr/local/CoderFile] filePath: /Users/leocoder/leocoder/develop/templates/coder-common-thin/coder-common-thin-backend/picture + # 存储服务配置 + storage: + # 存储类型:local(本地存储) | minio(MinIO对象存储) | oss(阿里云OSS) + type: oss + # 阿里云OSS配置 + oss: + # 是否启用OSS存储 + enabled: true + # OSS服务端点 + endpoint: oss-cn-hangzhou.aliyuncs.com + # 访问密钥ID + access-key-id: ${OSS_ACCESS_KEY_ID:LTAI5t982gXi7A72gAa9yugE} + # 访问密钥Secret + access-key-secret: ${OSS_ACCESS_KEY_SECRET:Mi9ZsSWLGkvFoMiLNiZ71hHFzVso30} + # 存储桶名称 + bucket-name: gaoziman + # 自定义域名(可选) + domain: https://gaoziman.oss-cn-hangzhou.aliyuncs.com + # 路径前缀 + path-prefix: coder-files + # 是否使用HTTPS + https: true + # 连接超时时间(毫秒) + connect-timeout: 10000 + # 读取超时时间(毫秒) + read-timeout: 10000 # 全局限流 globalLimit: # 是否开启全局限流