1. gateway:接入 nacos 配置中心,可支持动态路由

2. system-server:接入 nacos 配中心
This commit is contained in:
YunaiV
2022-06-04 23:50:46 +08:00
parent 93f4334eb6
commit 78c200ca61
13 changed files with 104 additions and 39 deletions

View File

@@ -18,6 +18,13 @@
</description>
<dependencies>
<!-- Spring Cloud 基础 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<!-- 依赖服务 -->
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-module-system-api</artifactId>
@@ -90,6 +97,10 @@
</dependency>
<!-- Config 配置中心相关 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- Job 定时任务相关 TODO 芋艿:暂时去掉 -->
<!-- <dependency>-->

View File

@@ -72,13 +72,6 @@ spring:
database: 0 # 数据库索引
# password: 123456 # 密码,建议生产环境开启
--- #################### 注册中心相关配置 ####################
spring:
cloud:
nacos:
server-addr: 127.0.0.1:8848
jasypt:
encryptor:
password: yuanma # 加解密的秘钥

View File

@@ -1,10 +1,4 @@
spring:
application:
name: system-server
profiles:
active: local
main:
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。

View File

@@ -0,0 +1,21 @@
--- #################### 注册中心相关配置 ####################
spring:
cloud:
nacos:
server-addr: 127.0.0.1:8848
discovery:
namespace: dev # 命名空间。这里使用 dev 开发环境
--- #################### 配置中心相关配置 ####################
spring:
cloud:
nacos:
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
config:
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
namespace: dev # 命名空间。这里使用 dev 开发环境
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
name: # 使用的 Nacos 配置集的 dataId默认为 spring.application.name
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties

View File

@@ -0,0 +1,6 @@
spring:
application:
name: system-server
profiles:
active: local