3.2.0-beta,重构很大:升级springboot2.6.6、spring-cloud-alibaba 2021.1、mybatisplus3.5.1、代码规范部分重构

This commit is contained in:
zhangdaiscott
2022-04-18 09:37:28 +08:00
parent 948e1668b6
commit 9dcff93372
487 changed files with 9754 additions and 2928 deletions

View File

@ -3,14 +3,83 @@ server:
spring:
application:
name: jeecg-gateway
main:
#循环依赖默认情况下已经被禁止了
allow-circular-references: true
allow-bean-definition-overriding: true
cloud:
#Sentinel配置
sentinel:
web-context-unify: false
transport:
dashboard: localhost:8087
# 懒加载Sentinel Dashboard菜单
dashboard: jeecg-boot-sentinel:9000
# 支持链路限流
web-context-unify: false
filter:
enabled: false
# 取消Sentinel控制台懒加载
eager: false
datasource:
#流控规则
flow: # 指定数据源名称
# 指定nacos数据源
nacos:
server-addr: @config.server-addr@
# 指定配置文件
dataId: ${spring.application.name}-flow-rules
# 指定分组
groupId: SENTINEL_GROUP
# 指定配置文件规则类型
rule-type: flow
# 指定配置文件数据格式
data-type: json
#降级规则
degrade:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-degrade-rules
groupId: SENTINEL_GROUP
rule-type: degrade
data-type: json
#系统规则
system:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-system-rules
groupId: SENTINEL_GROUP
rule-type: system
data-type: json
#授权规则
authority:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-authority-rules
groupId: SENTINEL_GROUP
rule-type: authority
data-type: json
#热点参数
param-flow:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-param-rules
groupId: SENTINEL_GROUP
rule-type: param-flow
data-type: json
#网关流控规则
gw-flow:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-flow-rules
groupId: SENTINEL_GROUP
rule-type: gw-flow
data-type: json
#API流控规则
gw-api-group:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-api-rules
groupId: SENTINEL_GROUP
rule-type: gw-api-group
data-type: json
gateway:
discovery:
locator:
@ -19,11 +88,14 @@ spring:
cors-configurations:
'[/**]':
allowCredentials: true
allowedOrigins: "*"
#springboot2.4后需用allowedOriginPatterns
allowedOriginPatterns: "*"
allowedMethods: "*"
allowedHeaders: "*"
# #如果启用nacos或者数据库配置请删除一下配置
# routes:
# httpclient:
# connect-timeout: 1000
# response-timeout: 5s
# # Nacos的yml方式路由配置(默认注释掉,采用数据库加载)
# - id: jeecg-demo
# uri: lb://jeecg-demo
# predicates:
@ -39,30 +111,4 @@ spring:
# - id: jeecg-demo-websocket
# uri: lb:ws://jeecg-demo
# predicates:
# - Path=/vxeSocket/**
# 全局熔断降级配置
default-filters:
- name: Hystrix
args:
name: default
#转发地址
fallbackUri: 'forward:/fallback'
- name: Retry
args:
#重试次数,默认值是 3 次
retries: 3
#HTTP 的状态返回码
statuses: BAD_GATEWAY,BAD_REQUEST
#指定哪些方法的请求需要进行重试逻辑,默认值是 GET 方法
methods: GET,POST
# hystrix 信号量隔离3秒后自动超时
hystrix:
enabled: true
shareSecurityContext: true
command:
default:
execution:
isolation:
strategy: SEMAPHORE
thread:
timeoutInMilliseconds: 9000
# - Path=/vxeSocket/**