feat: 新增mongodb和rabbitmq依赖和配置

This commit is contained in:
2026-08-05 23:58:47 +08:00
parent e5fb30aec6
commit 1066f909ab
8 changed files with 56 additions and 2 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
## 后端(ecom-dmb-backend)
- 构建 `./mvnw clean package -DskipTests`,运行 `./mvnw spring-boot:run`(默认 dev profile)
- 运行依赖环境变量:`DB_URL` / `DB_USERNAME` / `DB_PASSWORD` / `REDIS_HOST` / `REDIS_PASSWORD` / `JWT_SECRET`,见 README.md 与 `application-{profile}.yml`
- 运行依赖环境变量:`DB_URL` / `DB_USERNAME` / `DB_PASSWORD` / `REDIS_HOST` / `REDIS_PASSWORD` / `JWT_SECRET`,见 README.md 与 `application-{profile}.yml`;MongoDB / RabbitMQ 连接见各 profile(与 MySQL 同机,账号 `qinghua`)
- **拼多多 POP SDK 来自本地文件仓库 `libs/repo`(pom.xml 的 project-local repository,未入库)**:不要删除或清理;全新 clone 缺少它无法编译,需从别处恢复
- 测试 `./mvnw test`,单个 `./mvnw test -Dtest=RoleAspectTest`
- 架构设计文档在 `docs/`(订单统计读模型、权限控制、时间格式等),改动相关模块前先读
+5 -1
View File
@@ -6,7 +6,9 @@
- Java 17 + Spring Boot 3.2
- MyBatis-Plus + MySQL
- Redis(消息队列 + 缓存)
- Redis(导入任务队列 + 缓存)
- MongoDB(BI 聚合统计)
- RabbitMQ(业务消息队列)
- JWT 认证(HS512)
- Knife4j API 文档
- Lombok + MapStruct
@@ -16,6 +18,8 @@
- JDK 17+
- MySQL 8.0+
- Redis 6.0+
- MongoDB 6.0+
- RabbitMQ 3.12+
- Maven 3.9+
## 快速启动
+10
View File
@@ -141,6 +141,16 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<!-- Spring Data MongoDB(BI 聚合统计) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<!-- RabbitMQ(消息队列) -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<!-- Jackson序列化支持 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
@@ -14,6 +14,12 @@ spring:
port: 6379
password: redis_qinghua
database: 2
mongodb:
uri: mongodb://qinghua:mongo_qinghua@192.168.3.100:27017/ecom_dmb_dev
rabbitmq:
host: 192.168.3.100
username: qinghua
password: rabbitmq_qinghua
jwt:
secret: your-secret-key-here-must-be-at-least-64-bytes-long-for-hs512-algorithm-security
@@ -16,6 +16,12 @@ spring:
port: 6379
password: redis_qinghua
database: 0
mongodb:
uri: mongodb://qinghua:mongo_qinghua@192.168.3.100:27017/ecom_dmb_staging
rabbitmq:
host: 192.168.3.100
username: qinghua
password: rabbitmq_qinghua
jwt:
secret: staging-jwt-secret-key-must-be-at-least-64-bytes-long-for-hs512-algorithm
@@ -17,6 +17,12 @@ spring:
port: 6379
password: redis_qinghua
database: 0
mongodb:
uri: mongodb://qinghua:mongo_qinghua@192.168.3.100:27017/ecom_dmb
rabbitmq:
host: 192.168.3.100
username: qinghua
password: rabbitmq_qinghua
jwt:
secret: prod-jwt-secret-key-must-be-at-least-64-bytes-long-for-hs512-algorithm-security
@@ -14,6 +14,12 @@ spring:
port: 6379
password: redis_qinghua
database: 3
mongodb:
uri: mongodb://qinghua:mongo_qinghua@192.168.3.100:27017/ecom_dmb_test
rabbitmq:
host: 192.168.3.100
username: qinghua
password: rabbitmq_qinghua
jwt:
secret: test-jwt-secret-key-must-be-at-least-64-bytes-long-for-hs512-algorithm
@@ -33,6 +33,22 @@ spring:
max-idle: 8
min-idle: 0
max-wait: -1ms
mongodb:
# host/uri 见各环境;这里只放公共行为
auto-index-creation: false
rabbitmq:
# host/账号见各环境
port: 5672
virtual-host: /
publisher-confirm-type: correlated
publisher-returns: true
template:
mandatory: true
listener:
simple:
acknowledge-mode: auto
prefetch: 10
default-requeue-rejected: false
# 订单统计读模型(汇总表已删,待重构前关闭写入与 miss 补算)