c77352877d
主要更新: 1. 统一所有微服务端口配置(19000-19008) 2. 为所有服务创建本地/测试/生产三套环境配置 3. 配置Nacos认证密码(本地:Peanut2817*#, 测试/生产:EmotionMuseum2025) 4. 优化网关路由配置,支持负载均衡和WebSocket 5. 新增emotion-websocket模块,支持实时聊天 6. 前端集成WebSocket,替代HTTP轮询 7. 添加配置验证和管理工具脚本 技术特性: - 完整的环境隔离和服务发现 - WebSocket实时通信支持 - 负载均衡路由配置 - 跨域和安全配置 - 自动重连和心跳检测
87 lines
2.2 KiB
YAML
87 lines
2.2 KiB
YAML
server:
|
|
port: 19007
|
|
|
|
spring:
|
|
application:
|
|
name: emotion-websocket
|
|
profiles:
|
|
active: ${SPRING_PROFILES_ACTIVE:local}
|
|
|
|
# 数据源配置
|
|
datasource:
|
|
type: com.alibaba.druid.pool.DruidDataSource
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
url: jdbc:mysql://localhost:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
|
|
username: root
|
|
password: EmotionMuseum2025*#
|
|
druid:
|
|
initial-size: 5
|
|
min-idle: 5
|
|
max-active: 20
|
|
max-wait: 60000
|
|
time-between-eviction-runs-millis: 60000
|
|
min-evictable-idle-time-millis: 300000
|
|
validation-query: SELECT 1 FROM DUAL
|
|
test-while-idle: true
|
|
test-on-borrow: false
|
|
test-on-return: false
|
|
pool-prepared-statements: true
|
|
max-pool-prepared-statement-per-connection-size: 20
|
|
filters: stat,wall,slf4j
|
|
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
|
|
|
# Redis配置
|
|
redis:
|
|
host: localhost
|
|
port: 6379
|
|
password:
|
|
database: 0
|
|
timeout: 5000ms
|
|
lettuce:
|
|
pool:
|
|
max-active: 20
|
|
max-idle: 10
|
|
min-idle: 0
|
|
max-wait: -1ms
|
|
|
|
# MyBatis Plus配置
|
|
mybatis-plus:
|
|
configuration:
|
|
map-underscore-to-camel-case: true
|
|
cache-enabled: false
|
|
call-setters-on-nulls: true
|
|
jdbc-type-for-null: 'null'
|
|
global-config:
|
|
db-config:
|
|
id-type: ASSIGN_ID
|
|
logic-delete-field: is_deleted
|
|
logic-delete-value: 1
|
|
logic-not-delete-value: 0
|
|
mapper-locations: classpath*:mapper/**/*Mapper.xml
|
|
|
|
# 日志配置
|
|
logging:
|
|
level:
|
|
com.emotionmuseum.websocket: DEBUG
|
|
org.springframework.web.socket: DEBUG
|
|
org.springframework.messaging: DEBUG
|
|
pattern:
|
|
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n"
|
|
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n"
|
|
file:
|
|
name: logs/emotion-websocket.log
|
|
|
|
# 监控配置
|
|
management:
|
|
endpoints:
|
|
web:
|
|
exposure:
|
|
include: health,info,metrics,prometheus
|
|
endpoint:
|
|
health:
|
|
show-details: always
|
|
metrics:
|
|
export:
|
|
prometheus:
|
|
enabled: true
|