From ad5ca8c5450c8526fa89c538c4f6d102cd5ab9b3 Mon Sep 17 00:00:00 2001 From: MichaelWin Date: Mon, 17 Nov 2025 15:10:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91mongoDB?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 3 ++- src/main/resources/application.properties | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ef188b9..b8168a9 100644 --- a/build.gradle +++ b/build.gradle @@ -36,13 +36,14 @@ dependencies { implementation 'cn.dev33:sa-token-spring-boot-starter:1.44.0' // 权限认证 implementation 'com.alibaba:druid-spring-boot-starter:1.2.27' // 数据库连接池 implementation 'org.lionsoul:ip2region:2.7.0' // IP 归属地 + implementation 'org.springframework.boot:spring-boot-starter-data-mongodb' // mongodb compileOnly 'org.projectlombok:lombok' // Lombok developmentOnly 'org.springframework.boot:spring-boot-devtools' // 热重载 runtimeOnly 'com.mysql:mysql-connector-j' // MySQL 驱动 annotationProcessor 'org.projectlombok:lombok' // Lombok 注解处理 testImplementation 'org.springframework.boot:spring-boot-starter-test' // 测试框架 implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' // thymeleaf模版引擎 - implementation 'com.aliyun.oss:aliyun-sdk-oss:3.15.1' // OSS SDK + implementation 'com.aliyun.oss:aliyun-sdk-oss:3.17.4' // OSS SDK } tasks.named('test') { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f010108..a92ac79 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -45,6 +45,11 @@ spring.redis.lettuce.pool.max-idle=8 spring.redis.lettuce.pool.min-idle=0 spring.redis.lettuce.pool.max-wait=-1ms +# MongoDB 配置 +spring.data.mongodb.host=120.24.204.180 +spring.data.mongodb.database=app +spring.data.mongodb.port=27017 + # Sa-Token 配置 sa-token.token-name=Authorization sa-token.timeout=2592000