refactor: 优化图片处理与数据库连接配置

This commit is contained in:
ikmkj
2026-03-03 17:16:44 +08:00
parent a805ff905e
commit 6d5233cb4b
16 changed files with 176 additions and 75 deletions

View File

@@ -1,38 +1,43 @@
spring:
datasource:
# driver-class-name: org.sqlite.JDBC
# url: jdbc:sqlite:/data/mydatabase.db
# jpa:
# hibernate:
# ddl-auto: none
# show-sql: false
# properties:
# hibernate:
# format_sql: false
# dialect: org.hibernate.dialect.SQLiteDialect
# 上面是 默认配置数据库为sqlite下面是 配置mysql。从环境 变量中获取
driver-class-name: ${DB_DRIVER:com.mysql.cj.jdbc.Driver}
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
# HikariCP连接池优化配置生产环境
hikari:
# 连接池名称
pool-name: BijiHikariPool
# 最小空闲连接数
minimum-idle: 10
# 最大连接数
maximum-pool-size: 50
# 连接空闲超时时间(毫秒)
idle-timeout: 600000
# 连接最大存活时间(毫秒)
max-lifetime: 1800000
# 连接超时时间(毫秒)
connection-timeout: 30000
# 测试连接是否可用的SQL
connection-test-query: SELECT 1
# 自动提交
auto-commit: true
jpa:
hibernate:
ddl-auto: update
show-sql: true
show-sql: false
properties:
hibernate:
format_sql: true
format_sql: false
dialect: org.hibernate.dialect.MySQLDialect
# MyBatis-Plus配置
mybatis-plus:
mapper-locations: classpath:mapper/*.xml
configuration:
map-underscore-to-camel-case: true
# 生产环境关闭SQL日志
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
global-config:
db-config:
logic-delete-field: isDeleted # 全局逻辑删除的实体字段名