zayac-admin/continew-admin-webapi/src/main/resources/application.yml
2023-03-30 20:29:05 +08:00

198 lines
7.3 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.

--- ### 项目配置
continew-admin:
# 名称
name: ContiNew Admin
# 应用名称
appName: continew-admin
# 版本
version: 1.0.1-SNAPSHOT
# 描述
description: ContiNew Admin 中后台管理框架/脚手架Continue New Admin持续以最新流行技术栈构建拥抱变化迭代优化。
# URL
url: https://github.com/Charles7c/continew-admin
# 基本包
basePackage: top.charles7c.cnadmin
## 作者信息配置
author:
name: Charles7c
email: charles7c@126.com
url: https://blog.charles7c.top/about/me
## 许可协议信息配置
license:
name: Apache-2.0
url: https://github.com/Charles7c/continew-admin/blob/dev/LICENSE
# 是否本地解析 IP 归属地
ipAddrLocalParseEnabled: true
--- ### 日志配置(重叠部分,优先级高于 logback-spring.xml 中的配置)
logging:
level:
top.charles7c: @logging.level@
file:
path: @logging.file.path@
config: classpath:logback-spring.xml
## 系统日志配置
system:
# 是否启用系统日志
enabled: true
# 是否记录内网 IP 操作
includeInnerIp: true
# 哪些请求方式不记录系统日志
#excludeMethods:
# - GET
# 脱敏字段
desensitizeFields:
- password
- Authorization
--- ### 接口文档配置
springdoc:
swagger-ui:
path: /swagger-ui.html
tags-sorter: alpha
operations-sorter: alpha
api-docs:
enabled: ${springdoc.swagger-ui.enabled}
path: /v3/api-docs
group-configs:
- group: 'default'
paths-to-match: '/**'
packages-to-scan: top.charles7c.cnadmin.webapi
## 接口文档增强配置
knife4j:
enable: true
setting:
language: zh_cn
swagger-model-name: 实体类列表
# 是否显示默认的 footer默认 true 显示)
enable-footer: false
# 是否自定义 footer默认 false 非自定义)
enable-footer-custom: true
# 自定义 footer 内容,支持 Markdown 语法
footer-custom-content: 'Copyright © 2022-present [${continew-admin.author.name}](${continew-admin.author.url}) ⋅ [${continew-admin.name}](${continew-admin.url}) v${continew-admin.version}'
--- ### Sa-Token 配置
sa-token:
# token名称同时也是 cookie 名称)
token-name: Authorization
# token前缀例如填写 Bearer 实际传参 Authorization: Bearer xxxx-xxxx-xxxx-xxxx
token-prefix: Bearer
# token有效期单位默认 30 天,-1 代表永不过期)
timeout: 86400
# token临时有效期单位指定时间内无操作就视为 token 过期)
activity-timeout: 1800
# 是否打开自动续签(如果此值为 true框架会在每次直接或间接调用 getLoginId() 时进行一次过期检查与续签操作)
auto-renew: true
# 是否允许同一账号并发登录(为 true 时允许一起登录,为 false 时新登录挤掉旧登录)
is-concurrent: true
# 在多人登录同一账号时,是否共用一个 token为 true 时所有登录共用一个 token为 false 时每次登录新建一个 token
is-share: false
# 是否尝试从 header 里读取 Token
is-read-header: true
# 是否尝试从 cookie 里读取 Token此值为 false 后StpUtil.login(id) 登录时也不会再往前端注入 Cookie适合前后端分离模式
is-read-cookie: false
# 是否打印操作日志
is-log: false
# JWT秘钥
jwt-secret-key: asdasdasifhueuiwyurfewbfjsdafjk
--- ### MyBatis Plus 配置
mybatis-plus:
# Mapper 接口扫描包配置(该配置为自定义配置,非 MP 配置,不支持多包,如有需要可通过注解配置或提升扫描包层级)
# 该配置目前的唯一使用场景为:@MapperScan("${mybatis-plus.mapper-package}")
mapper-package: top.charles7c.**.mapper
# Mapper XML 文件目录配置
mapper-locations: classpath*:/mapper/**/*Mapper.xml
# 类型别名扫描包配置
type-aliases-package: top.charles7c.**.model
check-config-location: true
configuration:
# 自动驼峰命名规则camel case映射
map-underscore-to-camel-case: true
# MyBatis 自动映射策略
# NONE不启用 PARTIAL只对非嵌套 resultMap 自动映射 FULL对所有 resultMap 自动映射
auto-mapping-behavior: PARTIAL
# MyBatis 自动映射时未知列或未知属性处理策略
# NONE不做处理 WARNING打印相关警告 FAILING抛出异常和详细信息
auto-mapping-unknown-column-behavior: NONE
# 日志配置
# 默认org.apache.ibatis.logging.slf4j.Slf4jImpl
# 更详细会有性能损耗org.apache.ibatis.logging.stdout.StdOutImpl
# 关闭(可单纯使用 p6spy 分析org.apache.ibatis.logging.nologging.NoLoggingImpl
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
global-config:
banner: true
db-config:
# 主键类型(默认 assign_id 表示自行赋值)
# auto 代表使用数据库自增策略(需要在表中设置好自增约束)
id-type: AUTO
# 逻辑删除字段
logic-delete-field: isDeleted
# 逻辑删除全局值(默认 1表示已删除
logic-delete-value: 1
# 逻辑未删除全局值(默认 0表示未删除
logic-not-delete-value: 0
--- ### 服务器配置
server:
servlet:
# 应用访问路径
context-path: /
## Undertow 服务器配置
undertow:
# HTTP POST 请求内容的大小上限(默认 -1 不限制)
max-http-post-size: -1
# 以下的配置会影响 buffer这些 buffer 会用于服务器连接的 IO 操作,有点类似 Netty 的池化内存管理
# 每块 buffer的空间大小越小的空间被利用越充分不要设置太大以免影响其他应用合适即可
buffer-size: 512
# 是否分配的直接内存NIO 直接分配的堆外内存)
direct-buffers: true
threads:
# 设置 IO 线程数,它主要执行非阻塞的任务,它们会负责多个连接(默认每个 CPU 核心一个线程)
io: 8
# 阻塞任务线程池,当执行类似 Servlet 请求阻塞操作Undertow 会从这个线程池中取得线程(它的值设置取决于系统的负载)
worker: 256
--- ### Spring 配置
spring:
application:
name: ${continew-admin.appName}
## 环境配置
profiles:
# 启用的环境
# 配合 Maven Profile 选择不同配置文件进行启动,在 IntelliJ IDEA 右侧 Maven 工具窗口可以快速切换环境
active: @profiles.active@
main:
# 允许定义重名的 bean 对象覆盖原有的 bean
allow-bean-definition-overriding: true
# 允许循环依赖
allow-circular-references: true
## MVC 配置
mvc:
format:
# 日期格式化(针对 java.util.Date
date-time: yyyy-MM-dd HH:mm:ss
## JSON 配置
jackson:
# 时区配置
time-zone: GMT+8
# 日期格式化(针对 java.util.Date
date-format: yyyy-MM-dd HH:mm:ss
# 序列化配置Bean -> JSON
serialization:
# 允许序列化无属性的 Bean
FAIL_ON_EMPTY_BEANS: false
# 反序列化配置JSON -> Bean
deserialization:
# 允许反序列化不存在的属性
FAIL_ON_UNKNOWN_PROPERTIES: false
--- ### 线程池配置
thread-pool:
# 是否启用线程池
enabled: true
# 队列容量
queueCapacity: 128
# 活跃时间
keepAliveSeconds: 300