【新增】mongoDB支持

This commit is contained in:
2025-11-17 15:10:09 +08:00
parent 95e7b752e3
commit ad5ca8c545
2 changed files with 7 additions and 1 deletions

View File

@@ -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') {

View File

@@ -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