snack-mall/server-snack/src/main/resources/application.yml

107 lines
3.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server:
port: 8080
spring:
application:
name: server-snack
# 数据源配置
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/snack_mall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false
username: root
password: 123456
# Redis 配置
data:
redis:
host: localhost
port: 6379
password:
database: 0
lettuce:
pool:
max-active: 8
max-idle: 8
min-idle: 0
max-wait: -1ms
# 文件上传大小限制
servlet:
multipart:
max-file-size: 10MB
max-request-size: 20MB
# MyBatis-Plus 配置
mybatis-plus:
mapper-locations: classpath*:com/snack/server/module/**/mapper/**/*.xml
type-aliases-package: com.snack.server.module.**.entity
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
id-type: auto
logic-delete-field: deleted
logic-delete-value: 1
logic-not-delete-value: 0
# Sa-Token 配置
sa-token:
# token 名称(同时也是 cookie 名称)
token-name: Authorization
# token 有效期单位默认30天-1 代表永不过期
timeout: 2592000
# token 最低活跃频率(单位:秒),-1 表示不限制
active-timeout: -1
# 是否允许同一账号多地同时登录(为 true 时允许一起登录,为 false 时新登录挤掉旧登录)
is-concurrent: true
# 在多人登录同一账号时,是否共用一个 token
is-share: false
# token 风格默认可取值uuid、simple-uuid、random-32、random-64、random-128、tik
token-style: uuid
# 是否输出操作日志
is-log: false
token-prefix: Bearer
# Knife4j 配置
knife4j:
enable: true
setting:
language: zh_cn
# 文件上传本地存储路径(本地存储时使用)
snack:
storage:
# 存储类型local | s3
# local存储到 ./uploads/ 目录(适合本地开发 / 单机部署)
# s3 :存储到 S3 协议的对象存储RustFS / MinIO / AWS S3 / 阿里云 OSS
type: local
upload:
# 文件上传根路径(仅 local 模式生效)
path: ./uploads/
# 访问域名前缀(仅 local 模式生效)
domain: http://localhost:8080/uploads/
# S3 / 对象存储配置(仅 storage.type=s3 生效)
s3:
# S3 兼容服务端点RustFS / MinIO 示例http://localhost:9000
endpoint: http://localhost:9000
# 区域AWS S3 必填RustFS / MinIO 填 us-east-1 即可)
region: us-east-1
# 是否使用路径风格访问RustFS / MinIO = trueAWS S3 = false
path-style-access: true
# AccessKey
access-key: minioadmin
# SecretKey
secret-key: minioadmin
# 存储桶名称bucket 不存在时会自动尝试创建)
bucket: snack-mall
# 公网访问域名(用于拼接文件 URL可配合 CDN 域名)
public-domain: http://localhost:9000/snack-mall
seckill:
# 抢购用户限购记录在 Redis 中的过期时间(秒)—— 用于活动结束后清理
record-ttl-seconds: 86400