446 lines
20 KiB
YAML
446 lines
20 KiB
YAML
spring:
|
||
application:
|
||
name: jeelowcode-server
|
||
profiles:
|
||
active: local # 读取配置
|
||
main:
|
||
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||
|
||
# Servlet 配置
|
||
servlet:
|
||
# 文件上传相关配置项
|
||
multipart:
|
||
max-file-size: 100MB # 单个文件大小
|
||
max-request-size: 500MB # 设置总上传的文件大小
|
||
mvc:
|
||
pathmatch:
|
||
matching-strategy: ANT_PATH_MATCHER # 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题,参见 SpringFoxHandlerProviderBeanPostProcessor 类
|
||
|
||
# Jackson 配置项
|
||
jackson:
|
||
serialization:
|
||
write-dates-as-timestamps: true # 设置 Date 的格式,使用时间戳
|
||
write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
|
||
write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
|
||
fail-on-empty-beans: false # 允许序列化无属性的 Bean
|
||
|
||
# Cache 配置项
|
||
cache:
|
||
type: REDIS
|
||
redis:
|
||
time-to-live: 1h # 设置过期时间为 1 小时
|
||
|
||
--- #################### 接口文档配置 ####################
|
||
|
||
springdoc:
|
||
api-docs:
|
||
enabled: true
|
||
path: /v3/api-docs
|
||
swagger-ui:
|
||
enabled: true
|
||
path: /swagger-ui
|
||
default-flat-param-object: true
|
||
|
||
knife4j:
|
||
enable: true
|
||
setting:
|
||
language: zh_cn
|
||
|
||
# 工作流 Flowable 配置
|
||
flowable:
|
||
# 1. false: 默认值,Flowable 启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常
|
||
# 2. true: 启动时会对数据库中所有表进行更新操作,如果表存在,不做处理,反之,自动创建表
|
||
# 3. create_drop: 启动时自动创建表,关闭时自动删除表
|
||
# 4. drop_create: 启动时,删除旧表,再创建新表
|
||
database-schema-update: false # 设置为 false,可通过 https://github.com/flowable/flowable-sql 初始化
|
||
db-history-used: true # flowable6 默认 true 生成信息表,无需手动设置
|
||
check-process-definitions: false # 设置为 false,禁用 /resources/processes 自动部署 BPMN XML 流程
|
||
history-level: full # full:保存历史数据的最高级别,可保存全部流程相关细节,包括流程流转各节点参数
|
||
|
||
# MyBatis Plus 的配置项
|
||
mybatis-plus:
|
||
configuration:
|
||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||
jdbc-type-for-null: 'null'
|
||
global-config:
|
||
db-config:
|
||
id-type: NONE # "智能"模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||
banner: false # 关闭控制台的 Banner 打印
|
||
type-aliases-package: ${jeelowcode.info.base-package}.module.*.entity
|
||
encryptor:
|
||
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
|
||
|
||
mybatis-plus-join:
|
||
banner: false # 是否打印 mybatis plus join banner,默认true
|
||
sub-table-logic: true # 全局启用副表逻辑删除,默认true。关闭后关联查询不会加副表逻辑删除
|
||
ms-cache: true # 拦截器MappedStatement缓存,默认 true
|
||
table-alias: t # 表别名(默认 t)
|
||
logic-del-type: on # 副表逻辑删除条件的位置,支持 WHERE、ON,默认 ON
|
||
|
||
# Spring Data Redis 配置
|
||
spring:
|
||
data:
|
||
redis:
|
||
repositories:
|
||
enabled: false # 项目未使用到 Spring Data Redis 的 Repository,所以直接禁用,保证启动速度
|
||
|
||
--- #################### 数据库相关配置 ####################
|
||
spring:
|
||
mvc:
|
||
servlet:
|
||
load-on-startup: 10
|
||
# 数据源配置项
|
||
autoconfigure:
|
||
exclude:
|
||
# - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||
# - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置
|
||
# - de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置
|
||
# - de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置
|
||
# - de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
|
||
datasource:
|
||
druid: # Druid 【监控】相关的全局配置
|
||
web-stat-filter:
|
||
enabled: true
|
||
stat-view-servlet:
|
||
enabled: true
|
||
allow: # 设置白名单,不填则允许所有访问
|
||
url-pattern: /druid/*
|
||
login-username: # 控制台管理用户名和密码
|
||
login-password:
|
||
filter:
|
||
stat:
|
||
enabled: true
|
||
log-slow-sql: true # 慢 SQL 记录
|
||
slow-sql-millis: 100
|
||
merge-sql: true
|
||
wall:
|
||
config:
|
||
multi-statement-allow: true
|
||
dynamic: # 多数据源配置
|
||
druid: # Druid 【连接池】相关的全局配置
|
||
initial-size: 10 # 初始连接数
|
||
min-idle: 20 # 最小连接池数量
|
||
max-active: 100 # 最大连接池数量
|
||
max-wait: 60000 # 配置获取连接等待超时的时间,单位:毫秒
|
||
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||
min-evictable-idle-time-millis: 7200000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||
max-evictable-idle-time-millis: 25200000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||
#validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||
test-while-idle: true
|
||
test-on-borrow: false
|
||
test-on-return: false
|
||
socket-timeout: 60000 # socket超时时间,单位:毫秒
|
||
connect-timeout: 60000 # 建立数据库连接超时时间,单位:毫秒
|
||
query-timeout: 60 # SQL查询超时时间,单位:秒
|
||
transaction-query-timeout: 60 # 事务超时时间,单位:秒
|
||
|
||
|
||
|
||
--- #################### 定时任务相关配置 ####################
|
||
|
||
# Quartz 配置项,对应 QuartzProperties 配置类
|
||
spring:
|
||
quartz:
|
||
auto-startup: true # 本地开发环境,尽量不要开启 Job
|
||
scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName
|
||
job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。
|
||
wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true
|
||
properties: # 添加 Quartz Scheduler 附加属性,更多可以看 http://www.quartz-scheduler.org/documentation/2.4.0-SNAPSHOT/configuration.html 文档
|
||
org:
|
||
quartz:
|
||
# Scheduler 相关配置
|
||
scheduler:
|
||
instanceName: schedulerName
|
||
instanceId: AUTO # 自动生成 instance ID
|
||
# JobStore 相关配置
|
||
jobStore:
|
||
# JobStore 实现类。可见博客:https://blog.csdn.net/weixin_42458219/article/details/122247162
|
||
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
|
||
isClustered: true # 是集群模式
|
||
clusterCheckinInterval: 15000 # 集群检查频率,单位:毫秒。默认为 15000,即 15 秒
|
||
misfireThreshold: 60000 # misfire 阀值,单位:毫秒。
|
||
# 线程池相关配置
|
||
threadPool:
|
||
threadCount: 25 # 线程池大小。默认为 10 。
|
||
threadPriority: 5 # 线程优先级
|
||
class: org.quartz.simpl.SimpleThreadPool # 线程池类型
|
||
jdbc: # 使用 JDBC 的 JobStore 的时候,JDBC 的配置
|
||
initialize-schema: NEVER # 是否自动使用 SQL 初始化 Quartz 表结构。这里设置成 never ,我们手动创建表结构。
|
||
|
||
--- #################### 监控相关配置 ####################
|
||
# Lock4j 配置项
|
||
lock4j:
|
||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||
|
||
# Resilience4j 配置项
|
||
resilience4j:
|
||
ratelimiter:
|
||
instances:
|
||
backendA:
|
||
limit-for-period: 1 # 每个周期内,允许的请求数。默认为 50
|
||
limit-refresh-period: 60s # 每个周期的时长,单位:微秒。默认为 500
|
||
timeout-duration: 1s # 被限流时,阻塞等待的时长,单位:微秒。默认为 5s
|
||
register-health-indicator: true # 是否注册到健康监测
|
||
|
||
# Actuator 监控端点的配置项
|
||
management:
|
||
endpoints:
|
||
web:
|
||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||
exposure:
|
||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||
|
||
# Spring Boot Admin 配置项
|
||
spring:
|
||
boot:
|
||
admin:
|
||
# Spring Boot Admin Client 客户端的相关配置
|
||
client:
|
||
url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server 地址
|
||
instance:
|
||
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||
# Spring Boot Admin Server 服务端的相关配置
|
||
context-path: /admin # 配置 Spring
|
||
|
||
# 日志文件配置
|
||
logging:
|
||
file:
|
||
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
||
level:
|
||
# 配置自己写的 MyBatis Mapper 打印日志
|
||
com.jeelowcode: info
|
||
com.jeelowcode.core.framework.mapper: debug
|
||
com.jeelowcode.core.framework.service: debug
|
||
|
||
com.jeelowcode.core.flow.mapper: debug
|
||
com.jeelowcode.core.flow.service: debug
|
||
|
||
com.jeelowcode.service.bpm.mapper: debug
|
||
com.jeelowcode.service.bpm.service: debug
|
||
|
||
com.jeelowcode.service.infra.mapper: debug
|
||
com.jeelowcode.service.infra.service: debug
|
||
|
||
com.jeelowcode.service.system.mapper: debug
|
||
com.jeelowcode.service.system.service: debug
|
||
|
||
com.jeelowcode.core.framework.mapper.LogApiMapper: ERROR #日志入库不需要打印
|
||
com.jeelowcode.core.framework.mapper.LogApiErrorMapper: ERROR #日志入库不需要打印
|
||
com.jeelowcode.service.system.mapper.OperateLogMapper: error #日志入库不需要打印
|
||
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR
|
||
org.mybatis.spring.mapper.ClassPathMapperScanner: error
|
||
de.codecentric: error
|
||
|
||
--- #################### 验证码相关配置 ####################
|
||
|
||
aj:
|
||
captcha:
|
||
jigsaw: classpath:images/jigsaw # 滑动验证,底图路径,不配置将使用默认图片;以 classpath: 开头,取 resource 目录下路径
|
||
pic-click: classpath:images/pic-click # 滑动验证,底图路径,不配置将使用默认图片;以 classpath: 开头,取 resource 目录下路径
|
||
cache-type: redis # 缓存 local/redis...
|
||
cache-number: 1000 # local 缓存的阈值,达到这个值,清除缓存
|
||
timing-clear: 180 # local定时清除过期缓存(单位秒),设置为0代表不执行
|
||
type: blockPuzzle # 验证码类型 default两种都实例化。 blockPuzzle 滑块拼图 clickWord 文字点选
|
||
water-mark: JeeLowCode # 右下角水印文字(我的水印),可使用 https://tool.chinaz.com/tools/unicode.aspx 中文转 Unicode,Linux 可能需要转 unicode
|
||
interference-options: 0 # 滑动干扰项(0/1/2)
|
||
req-frequency-limit-enable: false # 接口请求次数一分钟限制是否开启 true|false
|
||
req-get-lock-limit: 5 # 验证失败 5 次,get接口锁定
|
||
req-get-lock-seconds: 10 # 验证失败后,锁定时间间隔
|
||
req-get-minute-limit: 30 # get 接口一分钟内请求数限制
|
||
req-check-minute-limit: 60 # check 接口一分钟内请求数限制
|
||
req-verify-minute-limit: 60 # verify 接口一分钟内请求数限制
|
||
|
||
--- #################### 消息队列相关 ####################
|
||
|
||
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||
rocketmq:
|
||
name-server: 127.0.0.1:9876 # RocketMQ Namesrv
|
||
# Producer 配置项
|
||
producer:
|
||
group: ${spring.application.name}_PRODUCER # 生产者分组
|
||
|
||
spring:
|
||
rabbitmq:
|
||
host: 127.0.0.1 # RabbitMQ 服务的地址
|
||
port: 5672 # RabbitMQ 服务的端口
|
||
username: rabbit # RabbitMQ 服务的账号
|
||
password: rabbit # RabbitMQ 服务的密码
|
||
# Kafka 配置项,对应 KafkaProperties 配置类
|
||
kafka:
|
||
bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔
|
||
# Kafka Producer 配置项
|
||
producer:
|
||
acks: 1 # 0-不应答。1-leader 应答。all-所有 leader 和 follower 应答。
|
||
retries: 3 # 发送失败时,重试发送的次数
|
||
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer # 消息的 value 的序列化
|
||
# Kafka Consumer 配置项
|
||
consumer:
|
||
auto-offset-reset: earliest # 设置消费者分组最初的消费进度为 earliest 。可参考博客 https://blog.csdn.net/lishuangzhe7047/article/details/74530417 理解
|
||
value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
|
||
properties:
|
||
spring.json.trusted.packages: '*'
|
||
# Kafka Consumer Listener 监听器配置
|
||
listener:
|
||
missing-topics-fatal: false # 消费监听接口监听的主题不存在时,默认会报错。所以通过设置为 false ,解决报错
|
||
|
||
--- #################### 第三方授权登录 ####################
|
||
justauth:
|
||
extend:
|
||
config:
|
||
CHINA_SATELLITE_NET:
|
||
requestClass: com.jeelowcode.service.system.config.social.ChinaSatelliteAuthRequest
|
||
client-id: asdafgfjsoiewjgoijirjgh
|
||
client-secret: asdfasdfasdfasdfasdfasdfasdfasdf
|
||
ignore-check-redirect-uri: true
|
||
redirect-uri: https://xops.chinasatnet.com.cn
|
||
enum-class: com.jeelowcode.service.system.config.social.ChinaSatelliteAuthSource
|
||
enabled: true
|
||
type:
|
||
DINGTALK: # 钉钉
|
||
client-id:
|
||
client-secret:
|
||
ignore-check-redirect-uri: true
|
||
WECHAT_ENTERPRISE: # 企业微信
|
||
client-id: wwd411c69a39ad2e54
|
||
client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
|
||
agent-id: 1000004
|
||
ignore-check-redirect-uri: true
|
||
WECHAT_MINI_APP: # 微信小程序
|
||
client-id: ${wx.miniapp.appid}
|
||
client-secret: ${wx.miniapp.secret}
|
||
ignore-check-redirect-uri: true
|
||
ignore-check-state: true # 微信小程序,不会使用到 state,所以不进行校验
|
||
WECHAT_MP: # 微信公众号
|
||
client-id: ${wx.mp.app-id}
|
||
client-secret: ${wx.mp.secret}
|
||
ignore-check-redirect-uri: true
|
||
cache:
|
||
type: REDIS
|
||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||
|
||
--- #################### 微信公众号、小程序相关配置 ####################
|
||
wx:
|
||
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
|
||
app-id: wx5b23ba7a5589ecbb # 测试号(自己的)
|
||
secret: 2a7b3b20c537e52e74afd395eb85f61f
|
||
# 存储配置,解决 AccessToken 的跨节点的共享
|
||
config-storage:
|
||
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
||
key-prefix: wx # Redis Key 的前缀
|
||
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
|
||
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
|
||
appid: wx63c280fe3248a3e7 # wenhualian的接口测试号
|
||
secret: 6f270509224a7ae1296bbf1c8cb97aed
|
||
config-storage:
|
||
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
||
key-prefix: wa # Redis Key 的前缀
|
||
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
|
||
--- #################### 框架相关配置 ####################
|
||
|
||
jeelowcode:
|
||
info:
|
||
version: 2.0.0
|
||
base-package: com.jeelowcode
|
||
web-url: www.jeelowcode.com
|
||
security:
|
||
permit-all_urls:
|
||
- /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,不需要登录
|
||
- /admin-api/jeelowcode/open/** # 低代码平台,不需要登
|
||
- /admin-api/jeelowcode/demo/**
|
||
- /admin-api/jeelowcode/dingding/open/**
|
||
websocket:
|
||
enable: true # websocket的开关
|
||
path: /infra/ws # 路径
|
||
sender-type: local # 消息发送的类型,可选值为 local、redis、rocketmq、kafka、rabbitmq
|
||
swagger:
|
||
title: JeeLowCode低代码开发平台
|
||
description: 提供管理后台所有功能
|
||
version: ${jeelowcode.info.version}
|
||
url: ${jeelowcode.info.web-url}
|
||
access-log: # 访问日志的配置项
|
||
enable: false
|
||
codegen:
|
||
base-package: ${jeelowcode.info.base-package}
|
||
db-schemas: ${spring.datasource.dynamic.datasource.master.name}
|
||
front-type: 10 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类
|
||
error-code: # 错误码相关配置项
|
||
enable: false
|
||
constants-class-list:
|
||
- com.jeelowcode.service.bpm.enums.ErrorCodeConstants
|
||
- com.jeelowcode.service.infra.enums.ErrorCodeConstants
|
||
tenant: # 多租户相关配置项
|
||
enable: true
|
||
ignore-urls:
|
||
- /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
|
||
- /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号
|
||
- /admin-api/system/captcha/get # 获取图片验证码,和租户无关
|
||
- /admin-api/system/captcha/check # 校验图片验证码,和租户无关
|
||
- /admin-api/infra/file/*/get/** # 获取图片,和租户无关
|
||
- /admin-api/system/sms/callback/* # 短信回调接口,无法带上租户编号
|
||
- /admin-api/jeelowcode/** # 低代码平台的全部放开,有自己的一套租户 规则
|
||
- /admin-api/system/user-sync
|
||
ignore-tables:
|
||
- DUAL
|
||
- dual
|
||
- ALL_TABLES
|
||
- all_tables
|
||
- ALL_INDEXES
|
||
- all_indexes
|
||
- system_tenant
|
||
- system_tenant_package
|
||
- system_dict_data
|
||
- system_dict_type
|
||
- system_error_code
|
||
- system_menu
|
||
- system_sms_channel
|
||
- system_sms_template
|
||
- system_sms_log
|
||
- system_sensitive_word
|
||
- system_oauth2_client
|
||
- system_mail_account
|
||
- system_mail_template
|
||
- system_mail_log
|
||
- system_notify_template
|
||
- system_notify_message
|
||
- infra_codegen_column
|
||
- infra_codegen_table
|
||
- infra_config
|
||
- infra_file_config
|
||
- infra_file
|
||
- infra_file_content
|
||
- infra_job
|
||
- infra_job_log
|
||
- infra_data_source_config
|
||
- tmp_report_data_1
|
||
- tmp_report_data_income
|
||
- 'lowcode_config' #低代码开头的不要多租户
|
||
- 'lowcode_dbform*' #低代码开头的不要多租户
|
||
- 'lowcode_desform*' #低代码开头的不要多租户
|
||
- 'lowcode_tab*' #低代码开头的不要多租户
|
||
- 'lowcode_report*' #低代码开头的不要多租户
|
||
- 'lowcode_log_*' #低代码开头的不要多租户
|
||
- '*_seq' #oracle自增主键等
|
||
sms-code: # 短信验证码相关的配置项
|
||
expire-times: 10m
|
||
send-frequency: 1m
|
||
send-maximum-quantity-per-day: 10
|
||
begin-code: 9999 # 这里配置 9999 的原因是,测试方便。
|
||
end-code: 9999 # 这里配置 9999 的原因是,测试方便。
|
||
excludeTableNames: #不允许该类型的表开头
|
||
- lowcode_
|
||
- qrtz_
|
||
- system_
|
||
- act_
|
||
- bpm_
|
||
- flw_
|
||
- infra_
|
||
ai:
|
||
deepseek:
|
||
apiKey: sk-b31fcf4e27bf45fbb65ace5bbc627d5d
|
||
kimi:
|
||
apiKey: sk-EE98wvDeTFvxRcBxDQmWhKQlewkGFIrfyCxvyNxDj8Vaf701
|
||
debug: false |