后台完成修复,初始化项目
This commit is contained in:
158
src/main/resources/application.yml
Normal file
158
src/main/resources/application.yml
Normal file
@@ -0,0 +1,158 @@
|
||||
server:
|
||||
port: 8080
|
||||
servlet:
|
||||
context-path: /
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: flash-sale-system
|
||||
|
||||
# 数据源配置
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/flash_sale_db?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
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:
|
||||
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: 6HU3cw1drNjfQ0zo1Uyx
|
||||
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
|
||||
|
||||
# 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/flash-sale-system.log
|
||||
|
||||
# 自定义配置
|
||||
flashsale:
|
||||
# 秒杀配置
|
||||
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
|
||||
|
||||
# 消息队列配置
|
||||
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
|
||||
Reference in New Issue
Block a user