-
Notifications
You must be signed in to change notification settings - Fork 87
/
application.yml
281 lines (272 loc) · 9.69 KB
/
application.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
--- ### 项目配置
project:
# 名称
name: ContiNew Admin
# 应用名称
appName: continew-admin
# 版本
version: 2.0.0-SNAPSHOT
# 描述
description: ContiNew Admin 中后台管理框架/脚手架,Continue New Admin,持续以最新流行技术栈构建,拥抱变化,迭代优化。
# 基本包
basePackage: top.charles7c.cnadmin
## 作者信息配置
author:
name: Charles7c
email: [email protected]
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:
config: classpath:logback-spring.xml
## 系统日志配置
system:
# 是否启用系统日志
enabled: true
# 是否记录内网 IP 操作
includeInnerIp: true
# 排除请求方式
#excludeMethods:
# - GET
# 脱敏字段
desensitizeFields:
- password
- Authorization
--- ### 接口文档配置
springdoc:
# 设置对象型参数的展示形式(设为 true 表示将对象型参数平展开,即对象内的属性直接作为参数展示而不是嵌套在对象内,默认为 false)
# 如果不添加该全局配置,可以在需要如此处理的对象参数类上使用 @ParameterObject
default-flat-param-object: true
swagger-ui:
path: /swagger-ui.html
tags-sorter: alpha
operations-sorter: alpha
show-extensions: true
api-docs:
enabled: ${springdoc.swagger-ui.enabled}
path: /v3/api-docs
group-configs:
- group: 'all'
paths-to-match: '/**'
packages-to-scan: ${project.basePackage}.webapi.controller
- group: 'auth'
display-name: '系统认证'
paths-to-match:
- '/auth/**'
- '/oauth/**'
packages-to-scan: ${project.basePackage}.webapi.controller.auth
- group: 'common'
display-name: '通用接口'
paths-to-match:
- '/common/**'
- '/dashboard/**'
packages-to-scan: ${project.basePackage}.webapi.controller.common
- group: 'system'
display-name: '系统管理'
paths-to-match: '/system/**'
packages-to-scan: ${project.basePackage}.webapi.controller.system
- group: 'tool'
display-name: '系统工具'
paths-to-match: '/tool/**'
packages-to-scan: ${project.basePackage}.webapi.controller.tool
- group: 'monitor'
display-name: '系统监控'
paths-to-match: '/monitor/**'
packages-to-scan: ${project.basePackage}.webapi.controller.monitor
## 接口文档增强配置
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 [${project.author.name}](${project.author.url}) ⋅ [${project.name}](${project.url}) v${project.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 最低活跃频率(单位:秒,默认 -1,代表不限制,永不冻结。如果 token 超过此时间没有访问系统就会被冻结)
active-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: ${project.basePackage}.**.mapper
# Mapper XML 文件目录配置
mapper-locations: classpath*:/mapper/**/*Mapper.xml
# 类型别名扫描包配置
type-aliases-package: ${project.basePackage}.**.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: ${project.appName}
## 环境配置
profiles:
# 启用的环境
active: dev
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
--- ### 健康检查配置
management.health:
mail:
# 关闭邮箱健康检查(邮箱配置错误或邮箱服务器不可用时,健康检查会报错)
enabled: false
--- ### 线程池配置
thread-pool:
# 是否启用线程池
enabled: true
# 队列容量
queueCapacity: 128
# 活跃时间
keepAliveSeconds: 300
--- ### 代码生成器配置
generator:
# 排除数据表
excludeTables:
- DATABASECHANGELOG
- DATABASECHANGELOGLOCK
- gen_config
- gen_field_config
# 模板配置
templateConfigs:
DO:
# 模板路径
templatePath: generator/Entity.ftl
# 包名称
packageName: model.entity
# 排除字段
excludeFields:
- id
- createUser
- createTime
- updateUser
- updateTime
Query:
templatePath: generator/Query.ftl
packageName: model.query
Req:
templatePath: generator/Req.ftl
packageName: model.req
Resp:
templatePath: generator/Resp.ftl
packageName: model.resp
excludeFields:
- id
- createUser
- createTime
DetailResp:
templatePath: generator/DetailResp.ftl
packageName: model.resp
excludeFields:
- id
- createUser
- createTime
- updateUser
- updateTime
Mapper:
templatePath: generator/Mapper.ftl
packageName: mapper
Service:
templatePath: generator/Service.ftl
packageName: service
ServiceImpl:
templatePath: generator/ServiceImpl.ftl
packageName: service.impl
Controller:
templatePath: generator/Controller.ftl
packageName: controller