|
|
|
|
@ -1,25 +1,33 @@
|
|
|
|
|
# MQTT??????????
|
|
|
|
|
mqtt.enabled=false
|
|
|
|
|
# MQTT 配置(是否启用 + 连接参数)
|
|
|
|
|
mqtt:
|
|
|
|
|
enabled: true # 是否启用 MQTT 客户端
|
|
|
|
|
|
|
|
|
|
# ??Bean????
|
|
|
|
|
spring.main.allow-bean-definition-overriding=true
|
|
|
|
|
|
|
|
|
|
# Database Configuration
|
|
|
|
|
spring.datasource.url=jdbc:mysql://localhost:3306/campus_water_management?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
|
|
|
|
|
spring.datasource.username=root
|
|
|
|
|
spring.datasource.password=wl1113
|
|
|
|
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
|
|
|
|
# Spring 核心配置:允许 Bean 定义覆盖(解决 Bean 重复定义冲突)
|
|
|
|
|
spring:
|
|
|
|
|
main:
|
|
|
|
|
allow-bean-definition-overriding: true # 缩进在 spring 下,作为子配置
|
|
|
|
|
# 数据库配置
|
|
|
|
|
datasource:
|
|
|
|
|
url: jdbc:mysql://localhost:3306/campus_water_management?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
|
|
|
|
|
username: root
|
|
|
|
|
password: wl1113
|
|
|
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
|
|
|
# JPA 配置
|
|
|
|
|
jpa:
|
|
|
|
|
hibernate:
|
|
|
|
|
ddl-auto: update # 自动更新表结构(开发环境用,生产环境建议改为 none)
|
|
|
|
|
show-sql: true # 打印 SQL 语句
|
|
|
|
|
properties:
|
|
|
|
|
hibernate:
|
|
|
|
|
format_sql: true # 格式化 SQL 语句
|
|
|
|
|
jdbc.lob.non_contextual_creation: true # 解决 LOB 字段创建警告
|
|
|
|
|
dialect: org.hibernate.dialect.MySQL8Dialect # MySQL 8 方言
|
|
|
|
|
|
|
|
|
|
# JPA Configuration
|
|
|
|
|
spring.jpa.hibernate.ddl-auto=update
|
|
|
|
|
spring.jpa.show-sql=true
|
|
|
|
|
spring.jpa.properties.hibernate.format_sql=true
|
|
|
|
|
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
|
|
|
|
|
|
|
|
|
|
# Database Dialect
|
|
|
|
|
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
|
|
|
|
|
|
|
|
|
|
# ????
|
|
|
|
|
server.servlet.encoding.charset=UTF-8
|
|
|
|
|
server.servlet.encoding.enabled=true
|
|
|
|
|
server.servlet.encoding.force=true
|
|
|
|
|
# 服务器编码配置
|
|
|
|
|
server:
|
|
|
|
|
servlet:
|
|
|
|
|
encoding:
|
|
|
|
|
charset: UTF-8
|
|
|
|
|
enabled: true
|
|
|
|
|
force: true # 移除末尾多余的 zs
|