Files
yshopb2c/yshop-app/src/main/resources/config/application-prod.yml

108 lines
3.0 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.

spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/yshopb2c?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull
username: yshopb2c
password: YAimJWfpMar6dwpm
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
statViewServlet:
enabled: true
url-pattern: /monitor/druid/*
filter:
stat:
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
redis:
host: 127.0.0.1 # Redis服务器地址
database: 5 # Redis数据库索引默认为0
port: 6379 # Redis服务器连接端口
password: yshop2019@yxtw # Redis服务器连接密码默认为空
jedis:
pool:
max-active: 8 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 8 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接
timeout: 3000ms # 连接超时时间(毫秒)
cache:
# spring cache 缓存类型为redis 也可以是其他的实现
type: redis
# 是否限制单用户登录
single:
login: false
yshop:
security:
jwt-key: yshopmini
token-expired-in: 7200000
#如果生产环境要开启swagger需要配置请求地址
#springfox:
# documentation:
# swagger:
# v2:
# host: # 接口域名或外网ip
#是否开启 swagger-ui生产环境默认不开启
swagger:
enabled: false
title: yshop商城移动端API
serverUrl: http://localhost:8009
version: 3.3
# 文件存储路径
file:
path: /home/yshop/file/
avatar: /home/yshop/avatar/
# 文件大小 /M
maxSize: 100
avatarMaxSize: 5
#oss配置
oss:
endpoint: http://oss-cn-shenzhen.aliyuncs.com
custom-domain: https://xxxxx//%s
access-key: xxxxx
secret-key: xxxxx
bucket-name: xxxxx
defaultName: xxxxx