192 lines
4.5 KiB
YAML
192 lines
4.5 KiB
YAML
server:
|
||
port: 8080
|
||
servlet:
|
||
context-path: /
|
||
session:
|
||
timeout: 30m
|
||
|
||
spring:
|
||
application:
|
||
name: community-fresh-group-buy-system
|
||
|
||
# 数据源配置
|
||
datasource:
|
||
url: jdbc:mysql://localhost:3306/flash_sale_db?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false
|
||
username: root
|
||
password: root
|
||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||
hikari:
|
||
maximum-pool-size: 20
|
||
minimum-idle: 5
|
||
connection-timeout: 30000
|
||
idle-timeout: 600000
|
||
max-lifetime: 1800000
|
||
|
||
# JPA配置
|
||
jpa:
|
||
hibernate:
|
||
ddl-auto: update
|
||
show-sql: true
|
||
properties:
|
||
hibernate:
|
||
dialect: org.hibernate.dialect.MySQL8Dialect
|
||
format_sql: true
|
||
|
||
# Redis配置(支持单节点和集群模式)
|
||
redis:
|
||
# 模式选择:single(单节点)、cluster(集群)
|
||
# 注释掉cluster配置即自动使用单节点模式
|
||
|
||
# === 单节点配置(默认) ===
|
||
host: localhost
|
||
port: 6379
|
||
database: 0
|
||
|
||
# === 集群配置(使用时取消注释) ===
|
||
# cluster:
|
||
# nodes: 42.192.62.91:7000,42.192.62.91:7001,42.192.62.91:7002,42.192.62.91:7003,42.192.62.91:7004,42.192.62.91:7005
|
||
|
||
# 通用配置
|
||
# password:
|
||
timeout: 5000
|
||
jedis:
|
||
pool:
|
||
max-active: 20
|
||
max-idle: 10
|
||
min-idle: 5
|
||
max-wait: 3000
|
||
|
||
# JSP配置
|
||
mvc:
|
||
view:
|
||
prefix: /WEB-INF/views/
|
||
suffix: .jsp
|
||
|
||
# 文件上传配置
|
||
servlet:
|
||
multipart:
|
||
enabled: true
|
||
max-file-size: 10MB
|
||
max-request-size: 10MB
|
||
location: ${java.io.tmpdir}
|
||
|
||
# JSON配置
|
||
jackson:
|
||
date-format: yyyy-MM-dd HH:mm:ss
|
||
time-zone: GMT+8
|
||
default-property-inclusion: non_null
|
||
serialization:
|
||
write-dates-as-timestamps: false
|
||
deserialization:
|
||
fail-on-unknown-properties: false
|
||
|
||
# 日志配置
|
||
logging:
|
||
level:
|
||
com.org.flashsalesystem: DEBUG
|
||
org.springframework.data.redis: DEBUG
|
||
org.hibernate.SQL: DEBUG
|
||
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
|
||
pattern:
|
||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||
file:
|
||
name: logs/community-fresh-group-buy-system.log
|
||
|
||
# 自定义配置
|
||
flashsale:
|
||
# 文件上传配置
|
||
upload:
|
||
# 文件上传路径
|
||
path: ${user.home}/group-buying-uploads/
|
||
# 访问URL前缀
|
||
url-prefix: /uploads/
|
||
|
||
# 限时活动配置
|
||
seckill:
|
||
# 每个用户每个商品最大购买数量
|
||
max-quantity-per-user: 1
|
||
# 接口限流配置(每分钟最大请求次数)
|
||
rate-limit:
|
||
max-requests-per-minute: 10
|
||
# 库存预热配置
|
||
stock-preload:
|
||
# 是否启用库存预热
|
||
enabled: true
|
||
# 预热提前时间(分钟)
|
||
advance-minutes: 30
|
||
|
||
# 购物车配置
|
||
cart:
|
||
# 购物车过期时间(天)
|
||
expire-days: 7
|
||
# 最大商品种类数
|
||
max-items: 20
|
||
|
||
# 缓存配置
|
||
cache:
|
||
# 用户信息缓存过期时间(分钟)
|
||
user-expire-minutes: 30
|
||
# 商品信息缓存过期时间(分钟)
|
||
product-expire-minutes: 60
|
||
# 限时活动缓存过期时间(分钟)
|
||
flashsale-expire-minutes: 10
|
||
|
||
# 退货配置
|
||
return:
|
||
# 确认收货后可申请退货的天数
|
||
max-days-after-completion: 7
|
||
|
||
# 消息队列配置
|
||
mq:
|
||
# 订单状态变更通知频道
|
||
order-status-channel: order:status:change
|
||
# 库存变更通知频道
|
||
stock-change-channel: stock:change
|
||
# 限时活动结果通知频道
|
||
flashsale-result-channel: flashsale:result
|
||
|
||
# 监控配置
|
||
management:
|
||
endpoints:
|
||
web:
|
||
exposure:
|
||
include: health,info,metrics,prometheus
|
||
endpoint:
|
||
health:
|
||
show-details: always
|
||
metrics:
|
||
export:
|
||
prometheus:
|
||
enabled: true
|
||
|
||
# Knife4j配置
|
||
knife4j:
|
||
enable: true
|
||
setting:
|
||
language: zh_cn
|
||
enable-swagger-models: true
|
||
enable-document-manage: true
|
||
swagger-model-name: 实体类列表
|
||
enable-version: false
|
||
enable-reload-cache-parameter: false
|
||
enable-after-script: true
|
||
enable-filter-multipart-api-method-type: POST
|
||
enable-filter-multipart-apis: false
|
||
enable-request-cache: true
|
||
enable-host: false
|
||
enable-host-text: ""
|
||
|
||
# SpringDoc配置
|
||
springdoc:
|
||
swagger-ui:
|
||
path: /swagger-ui.html
|
||
tags-sorter: alpha
|
||
operations-sorter: alpha
|
||
api-docs:
|
||
path: /v3/api-docs
|
||
group-configs:
|
||
- group: 'default'
|
||
paths-to-match: '/**'
|
||
packages-to-scan: com.org.flashsalesystem.controller
|