diff --git a/backend/config-templates/application-template.yml b/backend/config-templates/application-template.yml index b7697dc..8548490 100644 --- a/backend/config-templates/application-template.yml +++ b/backend/config-templates/application-template.yml @@ -56,6 +56,23 @@ spring: # 无 MyBatis 的模块(gateway)请删除下面这行 - optional:nacos:rui-data.${spring.cloud.nacos.config.file-extension:yaml} +# ============================================================================ +# 模块管理配置(可选,仅在需要管理租户模块时配置) +# 配置位置:Nacos rui-service-starter.yaml 或本模块的 Nacos 配置 +# ============================================================================ +# rui: +# modules: +# # 全局可用模块列表(供租户管理的模块配置弹窗使用) +# available: +# - code: system +# name: 系统管理 +# icon: tabler:settings +# - code: user +# name: 用户管理 +# icon: tabler:users +# # 默认启用模块(新租户默认开启,逗号分隔) +# default-enabled: system,user + management: endpoints: web: diff --git a/backend/config-templates/nacos/rui-service-starter.yaml b/backend/config-templates/nacos/rui-service-starter.yaml new file mode 100644 index 0000000..ee8ae91 --- /dev/null +++ b/backend/config-templates/nacos/rui-service-starter.yaml @@ -0,0 +1,82 @@ +# rui-service-starter.yaml — 聚合服务启动模块配置 +# Data ID: rui-service-starter.yaml +# Group: DEFAULT_GROUP + +# 服务端口:9399(聚合启动器) +server: + port: 9399 + +# 模块管理配置(全局可用模块列表,供租户管理模块配置使用) +rui: + modules: + # 全局可用模块列表(系统层面定义有哪些模块可选) + available: + - code: system + name: 系统管理 + icon: tabler:settings + - code: user + name: 用户管理 + icon: tabler:users + - code: order + name: 订单管理 + icon: tabler:shopping-cart + - code: cms + name: 内容管理 + icon: tabler:edit + - code: marketing + name: 营销中心 + icon: tabler:present + - code: demo + name: 演示中心 + icon: tabler:device-desktop + # 默认启用模块(新租户默认开启,逗号分隔) + default-enabled: system,user,demo + +# 数据库配置(聚合模式下复用各模块数据源) +spring: + datasource: + url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DB:rui}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true + username: ${MYSQL_USERNAME:root} + password: ${MYSQL_PASSWORD:root} + driver-class-name: com.mysql.cj.jdbc.Driver + hikari: + maximum-pool-size: 20 + minimum-idle: 5 + idle-timeout: 300000 + connection-timeout: 20000 + max-lifetime: 1200000 + +# MyBatis-Plus 配置 +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + map-underscore-to-camel-case: true + global-config: + db-config: + logic-delete-field: deleted + logic-delete-value: 1 + logic-not-delete-value: 0 + id-type: auto + mapper-locations: classpath*:/mapper/**/*.xml + +# Redis 配置 +spring: + data: + redis: + host: ${REDIS_HOST:localhost} + port: ${REDIS_PORT:6379} + password: ${REDIS_PASSWORD:} + database: 0 + timeout: 10s + lettuce: + pool: + max-active: 20 + max-idle: 10 + min-idle: 5 + max-wait: 10s + +# 日志配置 +logging: + level: + com.rui: INFO + org.springframework.web: WARN