Files
cn-rdms/rdms-project/rdms-project-boot/src/main/resources/application.yaml
hongawen 117dd91afd refactor(config): 将配置文件迁移至 Nacos 并优化通知事件
- 移除 application-dev.yaml 和 application-local.yaml 配置文件
- 将 Nacos 配置外置到根 pom 的 nacos.* 属性中
- 添加配置中心文件加载配置(rdms-common.yaml、rdms-common-secret.yaml)
- 网关服务仅用 Nacos 做服务发现,不加载配置中心文件
- 为系统服务添加独有敏感配置(rdms-system-server-secret.yaml)
- 为 mapper 添加 SQL 日志打印配置
- 为 NotifySendEvent 添加操作人用户编号字段用于排除通知
- 修改 NotifySendEvent 构造函数支持操作人排除参数
- 在通知监听器中实现操作人排除逻辑
- 添加操作人排除功能的单元测试
2026-06-17 21:01:11 +08:00

138 lines
4.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

spring:
application:
name: rdms-project-server
main:
allow-circular-references: true # 允许循环依赖,因为项目当前沿用三层架构组织方式。
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如 Feign 等会存在重复定义的服务
cloud:
# 注册中心 + 配置中心连接(值由根 pom 的 nacos.* 属性在打包时注入)
nacos:
server-addr: @nacos.server-addr@
username: @nacos.username@
password: @nacos.password@
discovery:
namespace: @nacos.namespace@
group: @nacos.group@
metadata:
version: ${rdms.info.version} # 灰度发布用的实例版本号
config:
namespace: @nacos.namespace@
group: @nacos.group@
config:
import:
- nacos:rdms-common.yaml # 公共非敏感配置(数据库地址/Redis/开关等)
- nacos:rdms-common-secret.yaml # 公共敏感配置(数据库账密/加解密秘钥)
# Servlet 配置
servlet:
# 文件上传相关配置项
multipart:
max-file-size: 16MB # 单个文件大小
max-request-size: 32MB # 设置总上传的文件大小
# Jackson 配置项
jackson:
serialization:
write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式,例如 1611460870401
write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
fail-on-empty-beans: false # 允许序列化无属性的 Bean
# Cache 配置项
cache:
type: REDIS
redis:
time-to-live: 1h # 设置过期时间为 1 小时
data:
redis:
repositories:
enabled: false # 项目未使用到 Spring Data Redis 的 Repository所以直接禁用保证启动速度
# 热部署配置
devtools:
restart:
enabled: true
server:
port: 48082
tomcat:
# 长连接保活时长:默认沿用 connection-timeout(20s),过短会和网关侧 HttpClient 连接池形成 race
# 导致网关复用已被服务端关闭的连接抛 PrematureCloseException。
# 必须大于网关 spring.cloud.gateway.server.webflux.httpclient.pool.max-idle-time(30s)。
keep-alive-timeout: 60s
logging:
file:
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
level:
com.njcn.rdms.module.project.dal.mysql: debug # 打印本模块 Mapper 的 SQL 日志
--- #################### 接口文档配置 ####################
springdoc:
api-docs:
enabled: true # 1. 是否开启 Swagger 接口文档的元数据
path: /v3/api-docs
swagger-ui:
enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
path: /swagger-ui
default-flat-param-object: true
knife4j:
enable: true
setting:
language: zh_cn
# MyBatis Plus 的配置项
mybatis-plus:
configuration:
map-underscore-to-camel-case: true # 虽然默认为 true但是还是显示指定下。
global-config:
db-config:
id-type: ASSIGN_ID # 分配 ID默认使用雪花算法
logic-delete-value: 1 # 逻辑已删除值(默认为 1
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0
banner: false # 关闭控制台的 Banner 打印
type-aliases-package: ${rdms.info.base-package}.dal.dataobject
# encryptor.password@EncryptField 字段加解密秘钥)已外置到 Nacos rdms-common-secret.yaml不再硬编码进 git
mybatis-plus-join:
banner: false # 关闭控制台的 Banner 打印
# VO 转换(数据翻译)相关
easy-trans:
is-enable-global: false # 默认禁用全局翻译,避免额外性能开销
--- #################### RDMS 相关配置 ####################
rdms:
info:
version: 1.0.0
base-package: com.njcn.rdms.module.project
web:
admin-ui:
url: https://www.baidu.com # Admin 管理后台 UI 的占位地址,联调时替换成实际前端入口
xss:
enable: false
exclude-urls:
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
swagger:
title: 项目交付域管理后台
description: 提供项目集、项目、产品、需求、任务、工单、执行等管理能力
author: RDMS
version: ${rdms.info.version}
url: https://example.com
email: dev@example.com
license: Apache 2.0
license-url: https://www.apache.org/licenses/LICENSE-2.0.html
work-report:
auto-gen:
enabled: true
weekly:
enabled: true
cron: "0 0 12 ? * FRI"
monthly:
enabled: true
cron: "0 0 12 1-31 * ?"
project:
enabled: true
cron: "0 0 12 1-31 * ?"
scope:
dept-ids: [100]
debug: false