提交 629d37cf 编写于 作者: yesgohome123's avatar yesgohome123

2023年5月28日22:04:28

上级 04c464bd
......@@ -80,7 +80,7 @@
<guava.version>30.0-jre</guava.version>
<checker.version>3.19.0</checker.version>
<errorprone.version>2.10.0</errorprone.version>
<hutool.version>5.7.14</hutool.version>
<hutool.version>5.8.16</hutool.version>
<hibernate-validator.version>6.1.5.Final</hibernate-validator.version>
<jakarta.el.version>3.0.4</jakarta.el.version>
<classmate.version>1.5.1</classmate.version>
......
......@@ -7,8 +7,10 @@ import com.alibaba.fastjson.JSONArray;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/**
* @author
......@@ -17,6 +19,7 @@ import org.springframework.boot.test.context.SpringBootTest;
* @modify
**/
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ColaApplication.class)
public class MateEntityTest {
......
# 项目相关配置
ruoyi:
# 名称
name: RuoYi
# 版本
version: 4.7.7
# 版权年份
copyrightYear: 2023
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
# 用户配置
user:
password:
# 密码错误{maxRetryCount}次锁定10分钟
maxRetryCount: 5
spring:
arthas: # 在线诊断组件
enabled: false # 默认关闭,请按需开启
h2: # 内存数据库
console:
enabled: true # 线上环境请勿设置
path: /h2-console
settings:
trace: false
web-allow-others: false
datasource: # 数据源管理
#username: sa
#password: demo
#url: jdbc:h2:mem:db;DB_CLOSE_ON_EXIT=TRUE
#driver-class-name: org.h2.Driver
username: root
password: 123456
url: jdbc:mysql://192.168.3.51:3306/ry?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.jdbc.Driver
dynamic: # 多数据源,使用 @DS 切换
enabled: false # 默认关闭,请按需开启
strict: true
primary: ds1
datasource:
ds1:
username:
password:
url: jdbc:mysql://localhost:3306/ds1?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
ds2:
username:
password:
url: jdbc:mysql://localhost:3306/ds2?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
shardingsphere: # 分库分表组件
enabled: false # 默认关闭,请按需开启,目前 5.x 版本对 Liquibase 兼容性不友好
datasource:
names: ds1,ds2
ds1:
username: root
password: demo@123
url: jdbc:mysql://localhost:3306/ds1?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
ds2:
username: root
password: demo@123
url: jdbc:mysql://localhost:3306/ds2?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
rules:
replica-query:
data-sources:
rw:
primary-data-source-name: ds1
replica-data-source-names: ds2
load-balancer-name: ROUND_ROBIN
query-consistent: true
load-balancers:
round-robin:
type: ROUND_ROBIN
props:
workId: 1
props:
sql.show: true
liquibase:
enabled: true # 默认开启,请按需关闭
cloud:
sentinel: # 服务流量治理
enabled: false # 默认关闭,请按需开启
transport:
dashboard: localhost:8090
datasource:
flow:
nacos:
server-addr: ${spring.cloud.nacos.config.server-addr}
namespace: ${spring.cloud.nacos.config.namespace}
groupId: sentinel
dataId: ${spring.application.name}-flow-rule
rule-type: flow
data-type: json
redis: # 缓存数据库
enabled: false # 默认关闭,请按需开启
password: demo@123
timeout: 5000
database: 1
host: localhost
port: 6379
thymeleaf: # 模板引擎
cache: false # 本地开发建议关闭缓存
zipkin: # 链路跟踪
base-url: http://localhost:9411
kafka: # 消息队列
bootstrap-servers: localhost:9092
rocketmq: # 消息队列
enabled: false # 默认关闭,请按需开启
name-server: localhost:9876;localhost:9876
producer:
group: ${spring.application.name}
access-key:
secret-key:
consumer:
group: ${spring.application.name}
topic: demo
xxl: # 分布式调度平台
job:
enable: false # 默认关闭,请按需开启
access-token:
admin:
addresses: http://localhost:8090/xxl-job
executor:
app-name: ${spring.application.name}
ip:
port:
log-path: /logs/xxl-job/job-handler/
log-retention-days: 7
cat: # 实时监控平台
enabled: false # 默认关闭,请按需开启
trace-mode: true # 开启访问观测
home: /tmp
servers: localhost
tcp-port: 2280
http-port: 8080
opentracing: # Jaeger 链路跟踪
jaeger:
enabled: false
udp-sender:
host: localhost
port: 6831
# 项目相关配置
ruoyi:
# 名称
name: RuoYi
# 版本
version: 4.7.7
# 版权年份
copyrightYear: 2023
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
# 用户配置
user:
password:
# 密码错误{maxRetryCount}次锁定10分钟
maxRetryCount: 5
spring:
arthas: # 在线诊断组件
enabled: false # 默认关闭,请按需开启
......@@ -9,10 +28,14 @@ spring:
trace: false
web-allow-others: false
datasource: # 数据源管理
username: sa
password: demo
url: jdbc:h2:mem:db;DB_CLOSE_ON_EXIT=TRUE
driver-class-name: org.h2.Driver
#username: sa
#password: demo
#url: jdbc:h2:mem:db;DB_CLOSE_ON_EXIT=TRUE
#driver-class-name: org.h2.Driver
username: root
password: 123456
url: jdbc:mysql://192.168.3.51:3306/ry?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.jdbc.Driver
dynamic: # 多数据源,使用 @DS 切换
enabled: false # 默认关闭,请按需开启
strict: true
......@@ -22,28 +45,47 @@ spring:
username:
password:
url: jdbc:mysql://localhost:3306/ds1?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
type: ${spring.datasource.type}
driver-class-name: ${spring.datasource.driver-class-name}
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
ds2:
username:
password:
url: jdbc:mysql://localhost:3306/ds2?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: ${spring.datasource.driver-class-name}
type: ${spring.datasource.type}
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
shardingsphere: # 分库分表组件
enabled: false # 默认关闭,请按需开启
enabled: false # 默认关闭,请按需开启,目前 5.x 版本对 Liquibase 兼容性不友好
datasource:
names: ds1,ds2
ds1:
username: root
password: demo@123
url: jdbc:mysql://localhost:3306/ds1?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
ds2:
username: root
password: demo@123
url: jdbc:mysql://localhost:3306/ds2?rewriteBatchedStatements=true&useSSL=false&useOldAliasMetadataBehavior=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
rules:
replica-query:
data-sources:
rw:
primary-data-source-name: ds1
replica-data-source-names: ds2
load-balancer-name: ROUND_ROBIN
query-consistent: true
load-balancers:
round-robin:
type: ROUND_ROBIN
props:
workId: 1
props:
sql.show: true
datasource:
names: demo
demo:
username: ${spring.datasource.username}
password: ${spring.datasource.password}
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
type: ${spring.datasource.type}
sharding:
defaultDataSourceName: demo
liquibase:
enabled: true # 默认开启,请按需关闭
cloud:
sentinel: # 服务流量治理
enabled: false # 默认关闭,请按需开启
......@@ -60,7 +102,7 @@ spring:
data-type: json
redis: # 缓存数据库
enabled: false # 默认关闭,请按需开启
password:
password: demo@123
timeout: 5000
database: 1
host: localhost
......@@ -74,7 +116,7 @@ spring:
rocketmq: # 消息队列
enabled: false # 默认关闭,请按需开启
name-server: localhost:9876;localhost:9877
name-server: localhost:9876;localhost:9876
producer:
group: ${spring.application.name}
access-key:
......@@ -98,7 +140,15 @@ xxl: # 分布式调度平台
cat: # 实时监控平台
enabled: false # 默认关闭,请按需开启
trace-mode: true # 开启访问观测
home: /tmp
servers: localhost
tcp-port: 2280
http-port: 8080
opentracing: # Jaeger 链路跟踪
jaeger:
enabled: false
udp-sender:
host: localhost
port: 6831
spring:
profiles:
active: local
arthas:
enabled: false # 默认关闭,请按需开启
datasource:
......@@ -9,7 +11,7 @@ spring:
maximumPoolSize: 10
idleTimeout: 300000
maxLifetime: 1200000
# connection-init-sql: SET NAMES utf8mb4 # 针对云数据库出现乱码的解决方案
# connection-init-sql: SET NAMES utf8mb4 # 针对云数据库出现乱码的解决方案
cloud:
sentinel: # 流量治理组件
enabled: false # 默认关闭,请按需开启
......@@ -61,14 +63,36 @@ spring:
buffer-memory: 40960
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.apache.kafka.common.serialization.StringSerializer
logging:
file:
name: ${spring.application.name}
config: classpath:log4j2.yml
level:
ROOT: INFO
org.ylzl.eden: INFO
dynamic:
tp: # 动态线程池
enabled: false
enabledBanner: false
enabledCollect: true
collectorTypes: micrometer
logPath: ${user.home}/logs
monitorInterval: 5
undertowTp:
corePoolSize: 16
maximumPoolSize: 256
keepAliveTime: 60
dubboTp:
- threadPoolName: ${spring.application.name}#dubboTp
corePoolSize: 16
maximumPoolSize: 256
keepAliveTime: 60
rocketMqTp:
- threadPoolName: ${spring.application.name}#rocketMqTp
corePoolSize: 16
maximumPoolSize: 256
keepAliveTime: 60
executors:
- threadPoolName: ${spring.application.name}#dtpExecutor
executorType: common
corePoolSize: 16
maximumPoolSize: 256
queueCapacity: 500
queueType: VariableLinkedBlockingQueue
rejectedHandlerType: CallerRunsPolicy
server:
port: 8081
......@@ -90,16 +114,23 @@ server:
# max: 500 # 最大并发数
# min-spare: 20 # 初始线程数
liquibase: # 数据库迁移工具
async: true # 异步执行
mybatis-plus: # ORM 组件
global-config:
banner: false
configuration:
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
map-underscore-to-camel-case: true
auto-mapping-behavior: full
call-setters-on-nulls: true
use-column-label: true
# PageHelper分页插件
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
arthas: # 在线诊断工具
agent-id: ${spring.application.name}@${random.value}
tunnel-server: ws://localhost:7777/ws
......@@ -108,9 +139,9 @@ arthas: # 在线诊断工具
http-port: 0 # 随机端口
dubbo: # 分布式调用组件
enabled: false # 默认关闭,请按需开启
enabled: false # 默认关闭,请按需开启,请不要使用 @EnabledDubbo 原生注解,否则无法关闭
scan:
base-packages: org.ylzl.eden.demo.adapter
base-packages: org.ylzl.eden.demo.adapter # Dubbo 服务扫描
application:
id: ${spring.application.name}
name: ${spring.application.name}
......@@ -131,10 +162,12 @@ dubbo: # 分布式调用组件
retries: 0 # 重试次数
timeout: 3000 # 超时时间
check: false # 是否开启检查
filter: cat-tracing
consumer:
retries: 0 # 重试次数
timeout: 3000 # 超时时间
check: false # 是否开启检查
filter: cat-tracing,cat-consumer
xxl: # 分布式调度平台
job:
......@@ -142,3 +175,106 @@ xxl: # 分布式调度平台
cat: # 实时监控平台
enabled: false # 默认关闭,请按需开启
opentracing: # Jaeger
jaeger:
service-name: ${spring.application.name}
enabled: false
log-spans: true
enable-b3-propagation: true
enable-w3c-propagation: true
const-sampler:
decision: true
probabilistic-sampler:
sampling-rate: 1
spring:
cloud:
async:
enabled: false
# springdoc-openapi项目配置
springdoc:
swagger-ui:
path: /swagger-ui.html
tags-sorter: alpha
operations-sorter: alpha
api-docs:
path: /v3/api-docs
group-configs:
- group: 'default'
paths-to-match: '/**'
packages-to-scan: cn.easycode.akina.chrm.adapter.*
# knife4j的增强配置,不需要增强可以不配
knife4j:
enable: true
setting:
language: zh_cn
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice/*
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
# 项目相关配置
ruoyi:
# 名称
name: RuoYi
# 版本
version: 4.7.7
# 版权年份
copyrightYear: 2023
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
# 用户配置
user:
password:
# 密码错误{maxRetryCount}次锁定10分钟
maxRetryCount: 5
shiro:
user:
# 登录地址
loginUrl: /login
# 权限认证失败地址
unauthorizedUrl: /unauth
# 首页地址
indexUrl: /index
# 验证码开关
captchaEnabled: true
# 验证码类型 math 数组计算 char 字符
captchaType: math
cookie:
# 设置Cookie的域名 默认空,即当前访问的域名
domain:
# 设置cookie的有效访问路径
path: /
# 设置HttpOnly属性
httpOnly: true
# 设置Cookie的过期时间,天为单位
maxAge: 30
# 设置密钥,务必保持唯一性(生成方式,直接拷贝到main运行即可)Base64.encodeToString(CipherUtils.generateNewKey(128, "AES").getEncoded()) (默认启动生成随机秘钥,随机秘钥会导致之前客户端RememberMe Cookie无效,如设置固定秘钥RememberMe Cookie则有效)
cipherKey:
session:
# Session超时时间,-1代表永不过期(默认30分钟)
expireTime: 30
# 同步session到数据库的周期(默认1分钟)
dbSyncPeriod: 1
# 相隔多久检查一次session的有效性,默认就是10分钟
validationInterval: 10
# 同一个用户最大会话数,比如2的意思是同一个账号允许最多同时两个人登录(默认-1不限制)
maxSession: -1
# 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户
kickoutAfter: false
rememberMe:
# 是否开启记住我
enabled: true
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册