You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228 lines
7.5 KiB

2 months ago
server:
port: 30101
servlet:
context-path: /backend
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
url: jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/stray_animals_back?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&allowMultiQueries=true
username: zhc
password: Youqu48bnb1
data:
redis:
database: 12
host: r-uf63x4g5p6ir5xao87pd.redis.rds.aliyuncs.com
port: 6379
password: B2BGn4gK4htgkEwP
timeout: 10s
lettuce:
pool:
# 连接池最大连接数 默认8 ,负数表示没有限制
max-active: 8
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认-1
max-wait: -1
# 连接池中的最大空闲连接 默认8
max-idle: 8
# 连接池中的最小空闲连接 默认0
min-idle: 0
cache:
enabled: false
# 缓存类型 redis、none(不使用缓存)
type: redis
# 缓存时间(单位:ms)
redis:
time-to-live: 3600000
# 缓存null值,防止缓存穿透
cache-null-values: true
caffeine:
spec: initialCapacity=50,maximumSize=1000,expireAfterWrite=600s
# 邮件配置
mail:
host: smtp.youlai.tech
port: 587
username: your-email@example.com
password: 123456
properties:
smtp:
auth: true
starttls:
enable: true
# 邮件发送者
from: youlaitech@163.com
mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml
global-config:
db-config:
# 主键ID类型
id-type: none
# 逻辑删除对应的全局属性名(注意:须是对象属性名,不能是表字段名,如 isDeleted 而非 is_deleted,否则逻辑删除失效)
logic-delete-field: isDeleted
# 逻辑删除-删除值
logic-delete-value: 1
# 逻辑删除-未删除值
logic-not-delete-value: 0
configuration:
# 驼峰下划线转换
map-underscore-to-camel-case: true
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 安全配置
security:
session:
type: jwt # 会话方式 [jwt|redis-token]
access-token-time-to-live: 7200 # 访问令牌 有效期(单位:秒),默认 2 小时,-1 表示永不过期
refresh-token-time-to-live: 604800 # 刷新令牌有效期(单位:秒),默认 7 天,-1 表示永不过期
jwt:
secret-key: SecretKey012345678901234567890123456789012345678901234567890123456789 # JWT密钥(HS256算法至少32字符)
redis-token:
allow-multi-login: true # 是否允许多设备登录
# 安全白名单路径,仅跳过 AuthorizationFilter 过滤器,还是会走 Spring Security 的其他过滤器(CSRF、CORS等)
ignore-urls:
- /api/v1/auth/login/** # 登录接口(账号密码登录、手机验证码登录和微信登录)
- /api/v1/auth/captcha # 验证码获取接口
- /api/v1/auth/sms/code # 发送登录短信验证码
- /api/v1/auth/refresh-token # 刷新令牌接口
- /api/v1/wxma/auth/** # 微信小程序认证接口(静默登录/手机号快捷登录/绑定手机号)
- /api/v1/logs/** # 日志接口(访问日志列表)
- /api/v1/mini/public/**
- /api/v1/mini/homePage/listByBounds
2 months ago
- /healthcheck
# 非安全端点路径,完全绕过 Spring Security 的过滤器
unsecured-urls:
- ${springdoc.swagger-ui.path}
- /doc.html
- /swagger-ui/**
- /v3/api-docs/**
- /webjars/**
- /favicon.ico
# 文件存储配置
oss:
# OSS 类型 (目前支持aliyun、minio)
type: aliyun
# MinIO 对象存储服务
minio:
# 服务Endpoint
endpoint: http://localhost:9000
# 访问凭据
access-key: minioadmin
# 凭据密钥
secret-key: minioadmin
# 存储桶名称
bucket-name: public
# (可选)自定义域名,如果配置了域名,生成的文件URL是域名格式,未配置则URL则是IP格式 (eg: https://www.youlai.tech/storage)
custom-domain:
# 阿里云OSS对象存储服务
aliyun:
# 服务Endpoint
endpoint: oss-cn-beijing.aliyuncs.com
2 months ago
# 访问凭据
access-key-id: LTAI5tBKi4uysfdwHmBLchm1
2 months ago
# 凭据密钥
access-key-secret: uGTIv6i7OCQ6TtnmJTqiWi7RYHY1Pd
2 months ago
# 存储桶名称
bucket-name: pet-map
2 months ago
# 本地存储
local:
# 文件存储路径 请注意下,mac用户请使用 /Users/your-username/your-path/,否则会有权限问题,windows用户请使用 D:/your-path/
storage-path: /Users/theo/home/
# 短信配置
sms:
# 阿里云短信
aliyun:
accessKeyId: LTAI5tSMgfxxxxxxdiBJLyR
accessKeySecret: SoOWRqpjtS7xxxxxxZ2PZiMTJOVC
domain: dysmsapi.aliyuncs.com
regionId: cn-shanghai
signName: 有来技术
templates:
# 注册短信验证码模板
register: SMS_22xxx771
# 登录短信验证码模板
login: SMS_22xxx772
# 修改手机号短信验证码模板
change-mobile: SMS_22xxx773
# springdoc 配置文档: https://springdoc.org/properties.html
springdoc:
swagger-ui:
path: /swagger-ui.html # Swagger UI 访问路径
operationsSorter: alpha # 接口按方法名排序
tags-sorter: alpha # 标签按字母排序
doc-expansion: none
api-docs:
path: /v3/api-docs # OpenAPI JSON 地址
group-configs: # 分组配置
- group: "系统管理" # 分组名称
paths-to-match: "/**" # 匹配的请求路径
packages-to-scan: # 扫描的 Controller 包,限制只生成指定包的接口文档
- com.youlai.boot.auth.controller
# - com.youlai.boot.system.controller
- com.youlai.boot.mini.controller
# - com.youlai.boot.module.file.controller
# - com.youlai.boot.module.codegen.controller
2 months ago
default-flat-param-object: true # 将对象参数扁平化显示在文档中
# knife4j 配置
knife4j:
enable: true # 是否启用 Knife4j 增强功能
production: false # 是否启用生产环境保护(true=生产环境隐藏文档,false=开发环境可访问)
setting:
language: zh_cn
# xxl-job 定时任务配置
xxl:
job:
# 定时任务开关
enabled: false
admin:
# 多个地址使用,分割
addresses: http://127.0.0.1:8686/xxl-job-admin
accessToken: default_token
executor:
appname: xxl-job-executor-${spring.application.name}
address:
ip:
port: 9999
logpath: /data/applogs/xxl-job/jobhandler
logretentiondays: 30
# 验证码配置
captcha:
# 验证码类型 circle-圆圈干扰验证码|gif-Gif验证码|line-干扰线验证码|shear-扭曲干扰验证码
type: circle
# 验证码宽度
width: 120
# 验证码高度
height: 40
# 验证码干扰元素个数
interfere-count: 2
# 文本透明度(0.0-1.0)
text-alpha: 0.8
# 验证码字符配置
code:
# 验证码字符类型 math-算术|random-随机字符
type: math
# 验证码字符长度,type=算术时,表示运算位数(1:个位数运算 2:十位数运算);type=随机字符时,表示字符个数
length: 1
# 验证码字体
font:
# 字体名称 Dialog|DialogInput|Monospaced|Serif|SansSerif
name: SansSerif
# 字体样式 0-普通|1-粗体|2-斜体
weight: 1
# 字体大小
size: 24
# 验证码有效期(秒)
expire-seconds: 120
# 微信小程序配置
wx:
miniapp:
appid: Your_AppId
secret: Your_AppSecret